@testset "minimal_cancel_plus_test" begin
    @test cancelplus(interval(-Inf, -1.0), emptyinterval()) == entireinterval()
    @test cancelplus(interval(-1.0, Inf), emptyinterval()) == entireinterval()
    @test cancelplus(entireinterval(), emptyinterval()) == entireinterval()
    @test cancelplus(interval(-Inf, -1.0), interval(-5.0,1.0)) == entireinterval()
    @test cancelplus(interval(-1.0, Inf), interval(-5.0,1.0)) == entireinterval()
    @test cancelplus(entireinterval(), interval(-5.0,1.0)) == entireinterval()
    @test cancelplus(interval(-Inf, -1.0), entireinterval()) == entireinterval()
    @test cancelplus(interval(-1.0, Inf), entireinterval()) == entireinterval()
    @test cancelplus(emptyinterval(), interval(1.0, Inf)) == entireinterval()
    @test cancelplus(emptyinterval(), interval(-Inf,1.0)) == entireinterval()
    @test cancelplus(emptyinterval(), entireinterval()) == entireinterval()
    @test cancelplus(interval(-1.0,5.0), interval(1.0,Inf)) == entireinterval()
    @test cancelplus(interval(-1.0,5.0), interval(-Inf,1.0)) == entireinterval()
    @test cancelplus(interval(-1.0,5.0), entireinterval()) == entireinterval()
    @test cancelplus(entireinterval(), interval(1.0,Inf)) == entireinterval()
    @test cancelplus(entireinterval(), interval(-Inf,1.0)) == entireinterval()
    @test cancelplus(entireinterval(), entireinterval()) == entireinterval()
    @test cancelplus(interval(-5.0, -1.0), interval(1.0,5.1)) == entireinterval()
    @test cancelplus(interval(-5.0, -1.0), interval(0.9,5.0)) == entireinterval()
    @test cancelplus(interval(-5.0, -1.0), interval(0.9,5.1)) == entireinterval()
    @test cancelplus(interval(-10.0, 5.0), interval(-5.0,10.1)) == entireinterval()
    @test cancelplus(interval(-10.0, 5.0), interval(-5.1,10.0)) == entireinterval()
    @test cancelplus(interval(-10.0, 5.0), interval(-5.1,10.1)) == entireinterval()
    @test cancelplus(interval(1.0, 5.0), interval(-5.0,-0.9)) == entireinterval()
    @test cancelplus(interval(1.0, 5.0), interval(-5.1,-1.0)) == entireinterval()
    @test cancelplus(interval(1.0, 5.0), interval(-5.1,-0.9)) == entireinterval()
    @test cancelplus(interval(-10.0, -1.0), emptyinterval()) == entireinterval()
    @test cancelplus(interval(-10.0, 5.0), emptyinterval()) == entireinterval()
    @test cancelplus(interval(1.0, 5.0), emptyinterval()) == entireinterval()
    @test cancelplus(emptyinterval(), emptyinterval()) == emptyinterval()
    @test cancelplus(emptyinterval(), interval(1.0,10.0)) == emptyinterval()
    @test cancelplus(emptyinterval(), interval(-5.0,10.0)) == emptyinterval()
    @test cancelplus(emptyinterval(), interval(-5.0,-1.0)) == emptyinterval()
    @test cancelplus(interval(-5.1,-0.0), interval(0.0,5.0)) == interval(-0x1.999999999998P-4,0.0)
    @test cancelplus(interval(-5.1,-1.0), interval(1.0,5.0)) == interval(-0x1.999999999998P-4,0.0)
    @test cancelplus(interval(-5.0,-0.9), interval(1.0,5.0)) == interval(0.0, 0x1.9999999999998P-4)
    @test cancelplus(interval(-5.1,-0.9), interval(1.0,5.0)) == interval(-0x1.999999999998P-4,0x1.9999999999998P-4)
    @test cancelplus(interval(-5.0,-1.0), interval(1.0,5.0)) == interval(0.0,0.0)
    @test cancelplus(interval(-10.1, 5.0), interval(-5.0,10.0)) == interval(-0x1.999999999998P-4,0.0)
    @test cancelplus(interval(-10.0, 5.1), interval(-5.0,10.0)) == interval(0.0,0x1.999999999998P-4)
    @test cancelplus(interval(-10.1, 5.1), interval(-5.0,10.0)) == interval(-0x1.999999999998P-4,0x1.999999999998P-4)
    @test cancelplus(interval(-10.0, 5.0), interval(-5.0,10.0)) == interval(0.0,0.0)
    @test cancelplus(interval(0.9, 5.0), interval(-5.0,-1.0)) == interval(-0x1.9999999999998P-4,0.0)
    @test cancelplus(interval(1.0, 5.1), interval(-5.0,-1.0)) == interval(0.0,0x1.999999999998P-4)
    @test cancelplus(interval(0.0, 5.1), interval(-5.0,-0.0)) == interval(0.0,0x1.999999999998P-4)
    @test cancelplus(interval(0.9, 5.1), interval(-5.0,-1.0)) == interval(-0x1.9999999999998P-4,0x1.999999999998P-4)
    @test cancelplus(interval(1.0, 5.0), interval(-5.0,-1.0)) == interval(0.0,0.0)
    @test cancelplus(interval(0.0, 5.0), interval(-5.0,-0.0)) == interval(0.0,0.0)
    @test cancelplus(interval(0x1.FFFFFFFFFFFFP+0,0x1.FFFFFFFFFFFFP+0), interval(-0x1.999999999999AP-4,-0x1.999999999999AP-4)) == interval(0x1.E666666666656P+0,0x1.E666666666657P+0)
    @test cancelplus(interval(-0x1.999999999999AP-4,0x1.FFFFFFFFFFFFP+0), interval(-0x1.999999999999AP-4,0.01)) == interval(-0x1.70A3D70A3D70BP-4,0x1.E666666666657P+0)
    @test cancelplus(interval(0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFFp1023), interval(0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFFp1023)) == interval(0x1.FFFFFFFFFFFFFp1023,Inf)
    @test cancelplus(interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFFp1023), interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFFp1023)) == interval(0.0,0.0)
    @test cancelplus(interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFFp1023), interval(-0x1.FFFFFFFFFFFFEP+1023,0x1.FFFFFFFFFFFFFp1023)) == interval(0.0,0x1P+971)
    @test cancelplus(interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFFp1023), interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFEP+1023)) == interval(-0x1P+971,0.0)
    @test cancelplus(interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFEP+1023), interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFFp1023)) == entireinterval()
    @test cancelplus(interval(-0x1.FFFFFFFFFFFFEP+1023,0x1.FFFFFFFFFFFFFp1023), interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFFp1023)) == entireinterval()
    @test cancelplus(interval(-0x1P+0,0x1.FFFFFFFFFFFFFP-53), interval(-0x1P+0,0x1.FFFFFFFFFFFFEP-53)) == interval(-0x1.FFFFFFFFFFFFFP-1,-0x1.FFFFFFFFFFFFEP-1)
    @test cancelplus(interval(-0x1P+0,0x1.FFFFFFFFFFFFEP-53), interval(-0x1P+0,0x1.FFFFFFFFFFFFFP-53)) == entireinterval()
end

@testset "minimal_cancel_minus_test" begin
    @test cancelminus(interval(-Inf, -1.0), emptyinterval()) == entireinterval()
    @test cancelminus(interval(-1.0, Inf), emptyinterval()) == entireinterval()
    @test cancelminus(entireinterval(), emptyinterval()) == entireinterval()
    @test cancelminus(interval(-Inf, -1.0), interval(-1.0,5.0)) == entireinterval()
    @test cancelminus(interval(-1.0, Inf), interval(-1.0,5.0)) == entireinterval()
    @test cancelminus(entireinterval(), interval(-1.0,5.0)) == entireinterval()
    @test cancelminus(interval(-Inf, -1.0), entireinterval()) == entireinterval()
    @test cancelminus(interval(-1.0, Inf), entireinterval()) == entireinterval()
    @test cancelminus(emptyinterval(), interval(-Inf, -1.0)) == entireinterval()
    @test cancelminus(emptyinterval(), interval(-1.0, Inf)) == entireinterval()
    @test cancelminus(emptyinterval(), entireinterval()) == entireinterval()
    @test cancelminus(interval(-1.0,5.0), interval(-Inf, -1.0)) == entireinterval()
    @test cancelminus(interval(-1.0,5.0), interval(-1.0, Inf)) == entireinterval()
    @test cancelminus(interval(-1.0,5.0), entireinterval()) == entireinterval()
    @test cancelminus(entireinterval(), interval(-Inf, -1.0)) == entireinterval()
    @test cancelminus(entireinterval(), interval(-1.0, Inf)) == entireinterval()
    @test cancelminus(entireinterval(), entireinterval()) == entireinterval()
    @test cancelminus(interval(-5.0, -1.0), interval(-5.1,-1.0)) == entireinterval()
    @test cancelminus(interval(-5.0, -1.0), interval(-5.0,-0.9)) == entireinterval()
    @test cancelminus(interval(-5.0, -1.0), interval(-5.1,-0.9)) == entireinterval()
    @test cancelminus(interval(-10.0, 5.0), interval(-10.1, 5.0)) == entireinterval()
    @test cancelminus(interval(-10.0, 5.0), interval(-10.0, 5.1)) == entireinterval()
    @test cancelminus(interval(-10.0, 5.0), interval(-10.1, 5.1)) == entireinterval()
    @test cancelminus(interval(1.0, 5.0), interval(0.9, 5.0)) == entireinterval()
    @test cancelminus(interval(1.0, 5.0), interval(1.0, 5.1)) == entireinterval()
    @test cancelminus(interval(1.0, 5.0), interval(0.9, 5.1)) == entireinterval()
    @test cancelminus(interval(-10.0, -1.0), emptyinterval()) == entireinterval()
    @test cancelminus(interval(-10.0, 5.0), emptyinterval()) == entireinterval()
    @test cancelminus(interval(1.0, 5.0), emptyinterval()) == entireinterval()
    @test cancelminus(emptyinterval(), emptyinterval()) == emptyinterval()
    @test cancelminus(emptyinterval(), interval(-10.0, -1.0)) == emptyinterval()
    @test cancelminus(emptyinterval(), interval(-10.0, 5.0)) == emptyinterval()
    @test cancelminus(emptyinterval(), interval(1.0, 5.0)) == emptyinterval()
    @test cancelminus(interval(-5.1,-0.0), interval(-5.0, 0.0)) == interval(-0x1.999999999998P-4,0.0)
    @test cancelminus(interval(-5.1,-1.0), interval(-5.0, -1.0)) == interval(-0x1.999999999998P-4,0.0)
    @test cancelminus(interval(-5.0,-0.9), interval(-5.0, -1.0)) == interval(0.0, 0x1.9999999999998P-4)
    @test cancelminus(interval(-5.1,-0.9), interval(-5.0, -1.0)) == interval(-0x1.999999999998P-4,0x1.9999999999998P-4)
    @test cancelminus(interval(-5.0,-1.0), interval(-5.0, -1.0)) == interval(0.0,0.0)
    @test cancelminus(interval(-10.1, 5.0), interval(-10.0, 5.0)) == interval(-0x1.999999999998P-4,0.0)
    @test cancelminus(interval(-10.0, 5.1), interval(-10.0, 5.0)) == interval(0.0,0x1.999999999998P-4)
    @test cancelminus(interval(-10.1, 5.1), interval(-10.0, 5.0)) == interval(-0x1.999999999998P-4,0x1.999999999998P-4)
    @test cancelminus(interval(-10.0, 5.0), interval(-10.0, 5.0)) == interval(0.0,0.0)
    @test cancelminus(interval(0.9, 5.0), interval(1.0, 5.0)) == interval(-0x1.9999999999998P-4,0.0)
    @test cancelminus(interval(-0.0, 5.1), interval(0.0, 5.0)) == interval(0.0,0x1.999999999998P-4)
    @test cancelminus(interval(1.0, 5.1), interval(1.0, 5.0)) == interval(0.0,0x1.999999999998P-4)
    @test cancelminus(interval(0.9, 5.1), interval(1.0, 5.0)) == interval(-0x1.9999999999998P-4,0x1.999999999998P-4)
    @test cancelminus(interval(1.0, 5.0), interval(1.0, 5.0)) == interval(0.0,0.0)
    @test cancelminus(interval(-5.0, 1.0), interval(-1.0, 5.0)) == interval(-4.0,-4.0)
    @test cancelminus(interval(-5.0, 0.0), interval(-0.0, 5.0)) == interval(-5.0,-5.0)
    @test cancelminus(interval(0x1.FFFFFFFFFFFFP+0,0x1.FFFFFFFFFFFFP+0), interval(0x1.999999999999AP-4,0x1.999999999999AP-4)) == interval(0x1.E666666666656P+0,0x1.E666666666657P+0)
    @test cancelminus(interval(-0x1.999999999999AP-4,0x1.FFFFFFFFFFFFP+0), interval(-0.01,0x1.999999999999AP-4)) == interval(-0x1.70A3D70A3D70BP-4,0x1.E666666666657P+0)
    @test cancelminus(interval(0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFFp1023), interval(-0x1.FFFFFFFFFFFFFp1023,-0x1.FFFFFFFFFFFFFp1023)) == interval(0x1.FFFFFFFFFFFFFp1023,Inf)
    @test cancelminus(interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFFp1023), interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFFp1023)) == interval(0.0,0.0)
    @test cancelminus(interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFFp1023), interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFEP+1023)) == interval(0.0,0x1P+971)
    @test cancelminus(interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFFp1023), interval(-0x1.FFFFFFFFFFFFEP+1023,0x1.FFFFFFFFFFFFFp1023)) == interval(-0x1P+971,0.0)
    @test cancelminus(interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFEP+1023), interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFFp1023)) == entireinterval()
    @test cancelminus(interval(-0x1.FFFFFFFFFFFFEP+1023,0x1.FFFFFFFFFFFFFp1023), interval(-0x1.FFFFFFFFFFFFFp1023,0x1.FFFFFFFFFFFFFp1023)) == entireinterval()
    @test cancelminus(interval(0x0.0000000000001p-1022,0x0.0000000000001p-1022), interval(0x0.0000000000001p-1022,0x0.0000000000001p-1022)) == interval(0.0,0.0)
    @test cancelminus(interval(0x0.0000000000001p-1022,0x0.0000000000001p-1022), interval(-0x0.0000000000001p-1022,-0x0.0000000000001p-1022)) == interval(0x0.0000000000002p-1022,0x0.0000000000002p-1022)
    @test cancelminus(interval(0x1P-1022,0x1.0000000000002P-1022), interval(0x1P-1022,0x1.0000000000001P-1022)) == interval(0.0,0x0.0000000000001P-1022)
    @test cancelminus(interval(0x1P-1022,0x1.0000000000001P-1022), interval(0x1P-1022,0x1.0000000000002P-1022)) == entireinterval()
    @test cancelminus(interval(-0x1P+0,0x1.FFFFFFFFFFFFFP-53), interval(-0x1.FFFFFFFFFFFFEP-53,0x1P+0)) == interval(-0x1.FFFFFFFFFFFFFP-1,-0x1.FFFFFFFFFFFFEP-1)
    @test cancelminus(interval(-0x1P+0,0x1.FFFFFFFFFFFFEP-53), interval(-0x1.FFFFFFFFFFFFFP-53,0x1P+0)) == entireinterval()
end

