text:
@testset "minimal_mulRevToPair_test" begin

    @test mul_rev_to_pair(emptyinterval(), interval(1.0, 2.0))[1] === emptyinterval() && mul_rev_to_pair(emptyinterval(), interval(1.0, 2.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(1.0, 2.0), emptyinterval())[1] === emptyinterval() && mul_rev_to_pair(interval(1.0, 2.0), emptyinterval())[2] === emptyinterval()

    @test mul_rev_to_pair(emptyinterval(), emptyinterval())[1] === emptyinterval() && mul_rev_to_pair(emptyinterval(), emptyinterval())[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, -0.1), interval(-2.1, -0.4))[1] === Interval(0x1.999999999999AP-3, 0x1.5P+4) && mul_rev_to_pair(interval(-2.0, -0.1), interval(-2.1, -0.4))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 0.0), interval(-2.1, -0.4))[1] === Interval(0x1.999999999999AP-3, Inf) && mul_rev_to_pair(interval(-2.0, 0.0), interval(-2.1, -0.4))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 1.1), interval(-2.1, -0.4))[1] === Interval(-Inf, -0x1.745D1745D1745P-2) && mul_rev_to_pair(interval(-2.0, 1.1), interval(-2.1, -0.4))[2] === Interval(0x1.999999999999AP-3, Inf)

    @test mul_rev_to_pair(interval(0.0, 1.1), interval(-2.1, -0.4))[1] === Interval(-Inf, -0x1.745D1745D1745P-2) && mul_rev_to_pair(interval(0.0, 1.1), interval(-2.1, -0.4))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, 1.1), interval(-2.1, -0.4))[1] === Interval(-0x1.A400000000001P+7, -0x1.745D1745D1745P-2) && mul_rev_to_pair(interval(0.01, 1.1), interval(-2.1, -0.4))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 0.0), interval(-2.1, -0.4))[1] === emptyinterval() && mul_rev_to_pair(interval(0.0, 0.0), interval(-2.1, -0.4))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, -0.1), interval(-2.1, -0.4))[1] === Interval(0.0, 0x1.5P+4) && mul_rev_to_pair(interval(-Inf, -0.1), interval(-2.1, -0.4))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 0.0), interval(-2.1, -0.4))[1] === Interval(0.0, Inf) && mul_rev_to_pair(interval(-Inf, 0.0), interval(-2.1, -0.4))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 1.1), interval(-2.1, -0.4))[1] === Interval(-Inf, -0x1.745D1745D1745P-2) && mul_rev_to_pair(interval(-Inf, 1.1), interval(-2.1, -0.4))[2] === Interval(0.0, Inf)

    @test mul_rev_to_pair(interval(-2.0, Inf), interval(-2.1, -0.4))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(interval(-2.0, Inf), interval(-2.1, -0.4))[2] === Interval(0x1.999999999999AP-3, Inf)

    @test mul_rev_to_pair(interval(0.0, Inf), interval(-2.1, -0.4))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(interval(0.0, Inf), interval(-2.1, -0.4))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, Inf), interval(-2.1, -0.4))[1] === Interval(-0x1.A400000000001P+7, 0.0) && mul_rev_to_pair(interval(0.01, Inf), interval(-2.1, -0.4))[2] === emptyinterval()

    @test mul_rev_to_pair(entireinterval(), interval(-2.1, -0.4))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(entireinterval(), interval(-2.1, -0.4))[2] === Interval(0.0, Inf)

    @test mul_rev_to_pair(interval(-2.0, -0.1), interval(-2.1, 0.0))[1] === Interval(0.0, 0x1.5P+4) && mul_rev_to_pair(interval(-2.0, -0.1), interval(-2.1, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 0.0), interval(-2.1, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 0.0), interval(-2.1, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 1.1), interval(-2.1, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 1.1), interval(-2.1, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 1.1), interval(-2.1, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 1.1), interval(-2.1, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, 1.1), interval(-2.1, 0.0))[1] === Interval(-0x1.A400000000001P+7, 0.0) && mul_rev_to_pair(interval(0.01, 1.1), interval(-2.1, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 0.0), interval(-2.1, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 0.0), interval(-2.1, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, -0.1), interval(-2.1, 0.0))[1] === Interval(0.0, 0x1.5P+4) && mul_rev_to_pair(interval(-Inf, -0.1), interval(-2.1, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 0.0), interval(-2.1, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 0.0), interval(-2.1, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 1.1), interval(-2.1, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 1.1), interval(-2.1, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, Inf), interval(-2.1, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, Inf), interval(-2.1, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, Inf), interval(-2.1, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, Inf), interval(-2.1, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, Inf), interval(-2.1, 0.0))[1] === Interval(-0x1.A400000000001P+7, 0.0) && mul_rev_to_pair(interval(0.01, Inf), interval(-2.1, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(entireinterval(), interval(-2.1, 0.0))[1] === entireinterval() && mul_rev_to_pair(entireinterval(), interval(-2.1, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, -0.1), interval(-2.1, 0.12))[1] === Interval(-0x1.3333333333333P+0, 0x1.5P+4) && mul_rev_to_pair(interval(-2.0, -0.1), interval(-2.1, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 0.0), interval(-2.1, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 0.0), interval(-2.1, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 1.1), interval(-2.1, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 1.1), interval(-2.1, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 1.1), interval(-2.1, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 1.1), interval(-2.1, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, 1.1), interval(-2.1, 0.12))[1] === Interval(-0x1.A400000000001P+7 , 0x1.8P+3) && mul_rev_to_pair(interval(0.01, 1.1), interval(-2.1, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 0.0), interval(-2.1, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 0.0), interval(-2.1, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, -0.1), interval(-2.1, 0.12))[1] === Interval(-0x1.3333333333333P+0, 0x1.5P+4) && mul_rev_to_pair(interval(-Inf, -0.1), interval(-2.1, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 0.0), interval(-2.1, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 0.0), interval(-2.1, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 1.1), interval(-2.1, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 1.1), interval(-2.1, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, Inf), interval(-2.1, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, Inf), interval(-2.1, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, Inf), interval(-2.1, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, Inf), interval(-2.1, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, Inf), interval(-2.1, 0.12))[1] === Interval(-0x1.A400000000001P+7 , 0x1.8P+3) && mul_rev_to_pair(interval(0.01, Inf), interval(-2.1, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(entireinterval(), interval(-2.1, 0.12))[1] === entireinterval() && mul_rev_to_pair(entireinterval(), interval(-2.1, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, -0.1), interval(0.0, 0.12))[1] === Interval(-0x1.3333333333333P+0, 0.0) && mul_rev_to_pair(interval(-2.0, -0.1), interval(0.0, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 0.0), interval(0.0, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 0.0), interval(0.0, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 1.1), interval(0.0, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 1.1), interval(0.0, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 1.1), interval(0.0, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 1.1), interval(0.0, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, 1.1), interval(0.0, 0.12))[1] === Interval(0.0, 0x1.8P+3) && mul_rev_to_pair(interval(0.01, 1.1), interval(0.0, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 0.0), interval(0.0, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 0.0), interval(0.0, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, -0.1), interval(0.0, 0.12))[1] === Interval(-0x1.3333333333333P+0, 0.0) && mul_rev_to_pair(interval(-Inf, -0.1), interval(0.0, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 0.0), interval(0.0, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 0.0), interval(0.0, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 1.1), interval(0.0, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 1.1), interval(0.0, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, Inf), interval(0.0, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, Inf), interval(0.0, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, Inf), interval(0.0, 0.12))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, Inf), interval(0.0, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, Inf), interval(0.0, 0.12))[1] === Interval(0.0, 0x1.8P+3) && mul_rev_to_pair(interval(0.01, Inf), interval(0.0, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(entireinterval(), interval(0.0, 0.12))[1] === entireinterval() && mul_rev_to_pair(entireinterval(), interval(0.0, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, -0.1), interval(0.01, 0.12))[1] === Interval(-0x1.3333333333333P+0, -0x1.47AE147AE147BP-8) && mul_rev_to_pair(interval(-2.0, -0.1), interval(0.01, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 0.0), interval(0.01, 0.12))[1] === Interval(-Inf, -0x1.47AE147AE147BP-8) && mul_rev_to_pair(interval(-2.0, 0.0), interval(0.01, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 1.1), interval(0.01, 0.12))[1] === Interval(-Inf, -0x1.47AE147AE147BP-8) && mul_rev_to_pair(interval(-2.0, 1.1), interval(0.01, 0.12))[2] === Interval(0x1.29E4129E4129DP-7, Inf)

    @test mul_rev_to_pair(interval(0.0, 1.1), interval(0.01, 0.12))[1] === Interval(0x1.29E4129E4129DP-7, Inf) && mul_rev_to_pair(interval(0.0, 1.1), interval(0.01, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, 1.1), interval(0.01, 0.12))[1] === Interval(0x1.29E4129E4129DP-7, 0x1.8P+3) && mul_rev_to_pair(interval(0.01, 1.1), interval(0.01, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 0.0), interval(0.01, 0.12))[1] === emptyinterval() && mul_rev_to_pair(interval(0.0, 0.0), interval(0.01, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, -0.1), interval(0.01, 0.12))[1] === Interval(-0x1.3333333333333P+0, 0.0) && mul_rev_to_pair(interval(-Inf, -0.1), interval(0.01, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 0.0), interval(0.01, 0.12))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(interval(-Inf, 0.0), interval(0.01, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 1.1), interval(0.01, 0.12))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(interval(-Inf, 1.1), interval(0.01, 0.12))[2] === Interval(0x1.29E4129E4129DP-7, Inf)

    @test mul_rev_to_pair(interval(-2.0, Inf), interval(0.01, 0.12))[1] === Interval(-Inf, -0x1.47AE147AE147BP-8) && mul_rev_to_pair(interval(-2.0, Inf), interval(0.01, 0.12))[2] === Interval(0.0, Inf)

    @test mul_rev_to_pair(interval(0.0, Inf), interval(0.01, 0.12))[1] === Interval(0.0, Inf) && mul_rev_to_pair(interval(0.0, Inf), interval(0.01, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, Inf), interval(0.01, 0.12))[1] === Interval(0.0, 0x1.8P+3) && mul_rev_to_pair(interval(0.01, Inf), interval(0.01, 0.12))[2] === emptyinterval()

    @test mul_rev_to_pair(entireinterval(), interval(0.01, 0.12))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(entireinterval(), interval(0.01, 0.12))[2] === Interval(0.0, Inf)

    @test mul_rev_to_pair(interval(-2.0, -0.1), interval(0.0, 0.0))[1] === Interval(0.0, 0.0) && mul_rev_to_pair(interval(-2.0, -0.1), interval(0.0, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 0.0), interval(0.0, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 0.0), interval(0.0, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 1.1), interval(0.0, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 1.1), interval(0.0, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 1.1), interval(0.0, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 1.1), interval(0.0, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, 1.1), interval(0.0, 0.0))[1] === Interval(0.0, 0.0) && mul_rev_to_pair(interval(0.01, 1.1), interval(0.0, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 0.0), interval(0.0, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 0.0), interval(0.0, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, -0.1), interval(0.0, 0.0))[1] === Interval(0.0, 0.0) && mul_rev_to_pair(interval(-Inf, -0.1), interval(0.0, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 0.0), interval(0.0, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 0.0), interval(0.0, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 1.1), interval(0.0, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 1.1), interval(0.0, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, Inf), interval(0.0, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, Inf), interval(0.0, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, Inf), interval(0.0, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, Inf), interval(0.0, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, Inf), interval(0.0, 0.0))[1] === Interval(0.0, 0.0) && mul_rev_to_pair(interval(0.01, Inf), interval(0.0, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(entireinterval(), interval(0.0, 0.0))[1] === entireinterval() && mul_rev_to_pair(entireinterval(), interval(0.0, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, -0.1), interval(-Inf, -0.1))[1] === Interval(0x1.999999999999AP-5, Inf) && mul_rev_to_pair(interval(-2.0, -0.1), interval(-Inf, -0.1))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 0.0), interval(-Inf, -0.1))[1] === Interval(0x1.999999999999AP-5 , Inf) && mul_rev_to_pair(interval(-2.0, 0.0), interval(-Inf, -0.1))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 1.1), interval(-Inf, -0.1))[1] === Interval(-Inf , -0x1.745D1745D1745P-4) && mul_rev_to_pair(interval(-2.0, 1.1), interval(-Inf, -0.1))[2] === Interval(0x1.999999999999AP-5 , Inf)

    @test mul_rev_to_pair(interval(0.0, 1.1), interval(-Inf, -0.1))[1] === Interval(-Inf, -0x1.745D1745D1745P-4) && mul_rev_to_pair(interval(0.0, 1.1), interval(-Inf, -0.1))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, 1.1), interval(-Inf, -0.1))[1] === Interval(-Inf, -0x1.745D1745D1745P-4) && mul_rev_to_pair(interval(0.01, 1.1), interval(-Inf, -0.1))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 0.0), interval(-Inf, -0.1))[1] === emptyinterval() && mul_rev_to_pair(interval(0.0, 0.0), interval(-Inf, -0.1))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, -0.1), interval(-Inf, -0.1))[1] === Interval(0.0, Inf) && mul_rev_to_pair(interval(-Inf, -0.1), interval(-Inf, -0.1))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 0.0), interval(-Inf, -0.1))[1] === Interval(0.0, Inf) && mul_rev_to_pair(interval(-Inf, 0.0), interval(-Inf, -0.1))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 1.1), interval(-Inf, -0.1))[1] === Interval(-Inf, -0x1.745D1745D1745P-4) && mul_rev_to_pair(interval(-Inf, 1.1), interval(-Inf, -0.1))[2] === Interval(0.0, Inf)

    @test mul_rev_to_pair(interval(-2.0, Inf), interval(-Inf, -0.1))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(interval(-2.0, Inf), interval(-Inf, -0.1))[2] === Interval(0x1.999999999999AP-5 , Inf)

    @test mul_rev_to_pair(interval(0.0, Inf), interval(-Inf, -0.1))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(interval(0.0, Inf), interval(-Inf, -0.1))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, Inf), interval(-Inf, -0.1))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(interval(0.01, Inf), interval(-Inf, -0.1))[2] === emptyinterval()

    @test mul_rev_to_pair(entireinterval(), interval(-Inf, -0.1))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(entireinterval(), interval(-Inf, -0.1))[2] === Interval(0.0, Inf)

    @test mul_rev_to_pair(interval(-2.0, -0.1), interval(-Inf, 0.0))[1] === Interval(0.0, Inf) && mul_rev_to_pair(interval(-2.0, -0.1), interval(-Inf, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 0.0), interval(-Inf, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 0.0), interval(-Inf, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 1.1), interval(-Inf, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 1.1), interval(-Inf, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 1.1), interval(-Inf, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 1.1), interval(-Inf, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, 1.1), interval(-Inf, 0.0))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(interval(0.01, 1.1), interval(-Inf, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 0.0), interval(-Inf, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 0.0), interval(-Inf, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, -0.1), interval(-Inf, 0.0))[1] === Interval(0.0, Inf) && mul_rev_to_pair(interval(-Inf, -0.1), interval(-Inf, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 0.0), interval(-Inf, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 0.0), interval(-Inf, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 1.1), interval(-Inf, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 1.1), interval(-Inf, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, Inf), interval(-Inf, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, Inf), interval(-Inf, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, Inf), interval(-Inf, 0.0))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, Inf), interval(-Inf, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, Inf), interval(-Inf, 0.0))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(interval(0.01, Inf), interval(-Inf, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(entireinterval(), interval(-Inf, 0.0))[1] === entireinterval() && mul_rev_to_pair(entireinterval(), interval(-Inf, 0.0))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, -0.1), interval(-Inf, 0.3))[1] === Interval(-0x1.8P+1, Inf) && mul_rev_to_pair(interval(-2.0, -0.1), interval(-Inf, 0.3))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 0.0), interval(-Inf, 0.3))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 0.0), interval(-Inf, 0.3))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 1.1), interval(-Inf, 0.3))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 1.1), interval(-Inf, 0.3))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 1.1), interval(-Inf, 0.3))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 1.1), interval(-Inf, 0.3))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, 1.1), interval(-Inf, 0.3))[1] === Interval(-Inf, 0x1.EP+4) && mul_rev_to_pair(interval(0.01, 1.1), interval(-Inf, 0.3))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 0.0), interval(-Inf, 0.3))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 0.0), interval(-Inf, 0.3))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, -0.1), interval(-Inf, 0.3))[1] === Interval(-0x1.8P+1, Inf) && mul_rev_to_pair(interval(-Inf, -0.1), interval(-Inf, 0.3))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 0.0), interval(-Inf, 0.3))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 0.0), interval(-Inf, 0.3))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 1.1), interval(-Inf, 0.3))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 1.1), interval(-Inf, 0.3))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, Inf), interval(-Inf, 0.3))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, Inf), interval(-Inf, 0.3))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, Inf), interval(-Inf, 0.3))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, Inf), interval(-Inf, 0.3))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, Inf), interval(-Inf, 0.3))[1] === Interval(-Inf, 0x1.EP+4) && mul_rev_to_pair(interval(0.01, Inf), interval(-Inf, 0.3))[2] === emptyinterval()

    @test mul_rev_to_pair(entireinterval(), interval(-Inf, 0.3))[1] === entireinterval() && mul_rev_to_pair(entireinterval(), interval(-Inf, 0.3))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, -0.1), interval(-0.21, Inf))[1] === Interval(-Inf , 0x1.0CCCCCCCCCCCDP+1) && mul_rev_to_pair(interval(-2.0, -0.1), interval(-0.21, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 0.0), interval(-0.21, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 0.0), interval(-0.21, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 1.1), interval(-0.21, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 1.1), interval(-0.21, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 1.1), interval(-0.21, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 1.1), interval(-0.21, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, 1.1), interval(-0.21, Inf))[1] === Interval(-0x1.5P+4, Inf) && mul_rev_to_pair(interval(0.01, 1.1), interval(-0.21, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 0.0), interval(-0.21, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 0.0), interval(-0.21, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, -0.1), interval(-0.21, Inf))[1] === Interval(-Inf, 0x1.0CCCCCCCCCCCDP+1) && mul_rev_to_pair(interval(-Inf, -0.1), interval(-0.21, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 0.0), interval(-0.21, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 0.0), interval(-0.21, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 1.1), interval(-0.21, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 1.1), interval(-0.21, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, Inf), interval(-0.21, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, Inf), interval(-0.21, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, Inf), interval(-0.21, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, Inf), interval(-0.21, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, Inf), interval(-0.21, Inf))[1] === Interval(-0x1.5P+4, Inf) && mul_rev_to_pair(interval(0.01, Inf), interval(-0.21, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(entireinterval(), interval(-0.21, Inf))[1] === entireinterval() && mul_rev_to_pair(entireinterval(), interval(-0.21, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, -0.1), interval(0.0, Inf))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(interval(-2.0, -0.1), interval(0.0, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 0.0), interval(0.0, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 0.0), interval(0.0, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 1.1), interval(0.0, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 1.1), interval(0.0, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 1.1), interval(0.0, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 1.1), interval(0.0, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, 1.1), interval(0.0, Inf))[1] === Interval(0.0, Inf) && mul_rev_to_pair(interval(0.01, 1.1), interval(0.0, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 0.0), interval(0.0, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 0.0), interval(0.0, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, -0.1), interval(0.0, Inf))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(interval(-Inf, -0.1), interval(0.0, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 0.0), interval(0.0, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 0.0), interval(0.0, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 1.1), interval(0.0, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 1.1), interval(0.0, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, Inf), interval(0.0, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, Inf), interval(0.0, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, Inf), interval(0.0, Inf))[1] === entireinterval() && mul_rev_to_pair(interval(0.0, Inf), interval(0.0, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, Inf), interval(0.0, Inf))[1] === Interval(0.0, Inf) && mul_rev_to_pair(interval(0.01, Inf), interval(0.0, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(entireinterval(), interval(0.0, Inf))[1] === entireinterval() && mul_rev_to_pair(entireinterval(), interval(0.0, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, -0.1), interval(0.04, Inf))[1] === Interval(-Inf, -0x1.47AE147AE147BP-6) && mul_rev_to_pair(interval(-2.0, -0.1), interval(0.04, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 0.0), interval(0.04, Inf))[1] === Interval(-Inf, -0x1.47AE147AE147BP-6) && mul_rev_to_pair(interval(-2.0, 0.0), interval(0.04, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 1.1), interval(0.04, Inf))[1] === Interval(-Inf, -0x1.47AE147AE147BP-6) && mul_rev_to_pair(interval(-2.0, 1.1), interval(0.04, Inf))[2] === Interval(0x1.29E4129E4129DP-5, Inf)

    @test mul_rev_to_pair(interval(0.0, 1.1), interval(0.04, Inf))[1] === Interval(0x1.29E4129E4129DP-5, Inf) && mul_rev_to_pair(interval(0.0, 1.1), interval(0.04, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, 1.1), interval(0.04, Inf))[1] === Interval(0x1.29E4129E4129DP-5, Inf) && mul_rev_to_pair(interval(0.01, 1.1), interval(0.04, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 0.0), interval(0.04, Inf))[1] === emptyinterval() && mul_rev_to_pair(interval(0.0, 0.0), interval(0.04, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, -0.1), interval(0.04, Inf))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(interval(-Inf, -0.1), interval(0.04, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 0.0), interval(0.04, Inf))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(interval(-Inf, 0.0), interval(0.04, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 1.1), interval(0.04, Inf))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(interval(-Inf, 1.1), interval(0.04, Inf))[2] === Interval(0x1.29E4129E4129DP-5, Inf)

    @test mul_rev_to_pair(interval(-2.0, Inf), interval(0.04, Inf))[1] === Interval(-Inf, -0x1.47AE147AE147BP-6) && mul_rev_to_pair(interval(-2.0, Inf), interval(0.04, Inf))[2] === Interval(0.0, Inf)

    @test mul_rev_to_pair(interval(0.0, Inf), interval(0.04, Inf))[1] === Interval(0.0, Inf) && mul_rev_to_pair(interval(0.0, Inf), interval(0.04, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, Inf), interval(0.04, Inf))[1] === Interval(0.0, Inf) && mul_rev_to_pair(interval(0.01, Inf), interval(0.04, Inf))[2] === emptyinterval()

    @test mul_rev_to_pair(entireinterval(), interval(0.04, Inf))[1] === Interval(-Inf, 0.0) && mul_rev_to_pair(entireinterval(), interval(0.04, Inf))[2] === Interval(0.0, Inf)

    @test mul_rev_to_pair(interval(-2.0, -0.1), entireinterval())[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, -0.1), entireinterval())[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 0.0), entireinterval())[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 0.0), entireinterval())[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, 1.1), entireinterval())[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, 1.1), entireinterval())[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 1.1), entireinterval())[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 1.1), entireinterval())[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, 1.1), entireinterval())[1] === entireinterval() && mul_rev_to_pair(interval(0.01, 1.1), entireinterval())[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, 0.0), entireinterval())[1] === entireinterval() && mul_rev_to_pair(interval(0.0, 0.0), entireinterval())[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, -0.1), entireinterval())[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, -0.1), entireinterval())[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 0.0), entireinterval())[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 0.0), entireinterval())[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-Inf, 1.1), entireinterval())[1] === entireinterval() && mul_rev_to_pair(interval(-Inf, 1.1), entireinterval())[2] === emptyinterval()

    @test mul_rev_to_pair(interval(-2.0, Inf), entireinterval())[1] === entireinterval() && mul_rev_to_pair(interval(-2.0, Inf), entireinterval())[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.0, Inf), entireinterval())[1] === entireinterval() && mul_rev_to_pair(interval(0.0, Inf), entireinterval())[2] === emptyinterval()

    @test mul_rev_to_pair(interval(0.01, Inf), entireinterval())[1] === entireinterval() && mul_rev_to_pair(interval(0.01, Inf), entireinterval())[2] === emptyinterval()

    @test mul_rev_to_pair(entireinterval(), entireinterval())[1] === entireinterval() && mul_rev_to_pair(entireinterval(), entireinterval())[2] === emptyinterval()

end

@testset "minimal_mulRevToPair_dec_test" begin

    @test isnai(mul_rev_to_pair(nai(), DecoratedInterval(interval(1.0,2.0), def))[1]) && isnai(mul_rev_to_pair(nai(), DecoratedInterval(interval(1.0,2.0), def))[2])

    @test isnai(mul_rev_to_pair(DecoratedInterval(interval(1.0,2.0), com), nai())[1]) && isnai(mul_rev_to_pair(DecoratedInterval(interval(1.0,2.0), com), nai())[2])

    @test isnai(mul_rev_to_pair(nai(), nai())[1]) && isnai(mul_rev_to_pair(nai(), nai())[2])

    @test mul_rev_to_pair(DecoratedInterval(emptyinterval(), trv), DecoratedInterval(interval(1.0, 2.0), def))[1] === DecoratedInterval(emptyinterval(), trv) && mul_rev_to_pair(DecoratedInterval(emptyinterval(), trv), DecoratedInterval(interval(1.0, 2.0), def))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(1.0, 2.0), com), DecoratedInterval(emptyinterval(), trv))[1] === DecoratedInterval(emptyinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(1.0, 2.0), com), DecoratedInterval(emptyinterval(), trv))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(emptyinterval(), trv), DecoratedInterval(emptyinterval(), trv))[1] === DecoratedInterval(emptyinterval(), trv) && mul_rev_to_pair(DecoratedInterval(emptyinterval(), trv), DecoratedInterval(emptyinterval(), trv))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), com), DecoratedInterval(interval(-2.1, -0.4), com))[1] === DecoratedInterval(Interval(0x1.999999999999AP-3, 0x1.5P+4), com) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), com), DecoratedInterval(interval(-2.1, -0.4), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(-2.1, -0.4), com))[1] === DecoratedInterval(Interval(0x1.999999999999AP-3, Inf), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(-2.1, -0.4), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), com), DecoratedInterval(interval(-2.1, -0.4), dac))[1] === DecoratedInterval(Interval(-Inf, -0x1.745D1745D1745P-2), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), com), DecoratedInterval(interval(-2.1, -0.4), dac))[2] === DecoratedInterval(Interval(0x1.999999999999AP-3, Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), trv), DecoratedInterval(interval(-2.1, -0.4), def))[1] === DecoratedInterval(Interval(-Inf, -0x1.745D1745D1745P-2), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), trv), DecoratedInterval(interval(-2.1, -0.4), def))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), com), DecoratedInterval(interval(-2.1, -0.4), com))[1] === DecoratedInterval(Interval(-0x1.A400000000001P+7, -0x1.745D1745D1745P-2), com) && mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), com), DecoratedInterval(interval(-2.1, -0.4), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(-2.1, -0.4), def))[1] === DecoratedInterval(emptyinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(-2.1, -0.4), def))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(-2.1, -0.4), dac))[1] === DecoratedInterval(Interval(0.0, 0x1.5P+4), dac) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(-2.1, -0.4), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), def), DecoratedInterval(interval(-2.1, -0.4), com))[1] === DecoratedInterval(Interval(0.0, Inf), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), def), DecoratedInterval(interval(-2.1, -0.4), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), trv), DecoratedInterval(interval(-2.1, -0.4), def))[1] === DecoratedInterval(Interval(-Inf, -0x1.745D1745D1745P-2), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), trv), DecoratedInterval(interval(-2.1, -0.4), def))[2] === DecoratedInterval(Interval(0.0, Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(-2.1, -0.4), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(-2.1, -0.4), dac))[2] === DecoratedInterval(Interval(0x1.999999999999AP-3, Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), def), DecoratedInterval(interval(-2.1, -0.4), com))[1] === DecoratedInterval(Interval(-Inf, 0.0), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), def), DecoratedInterval(interval(-2.1, -0.4), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), def), DecoratedInterval(interval(-2.1, -0.4), def))[1] === DecoratedInterval(Interval(-0x1.A400000000001P+7, 0.0), def) && mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), def), DecoratedInterval(interval(-2.1, -0.4), def))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(-2.1, -0.4), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), trv) && mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(-2.1, -0.4), dac))[2] === DecoratedInterval(Interval(0.0, Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(-2.1, 0.0), com))[1] === DecoratedInterval(Interval(0.0, 0x1.5P+4), dac) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(-2.1, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(-2.1, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(-2.1, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(-2.1, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(-2.1, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(-2.1, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(-2.1, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(-2.1, 0.0), com))[1] === DecoratedInterval(Interval(-0x1.A400000000001P+7, 0.0), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(-2.1, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(-2.1, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(-2.1, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(-2.1, 0.0), com))[1] === DecoratedInterval(Interval(0.0, 0x1.5P+4), dac) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(-2.1, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(-2.1, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(-2.1, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(-2.1, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(-2.1, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(-2.1, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(-2.1, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(-2.1, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(-2.1, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(-2.1, 0.0), com))[1] === DecoratedInterval(Interval(-0x1.A400000000001P+7, 0.0), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(-2.1, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(-2.1, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(-2.1, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), def), DecoratedInterval(interval(-2.1, 0.12), dac))[1] === DecoratedInterval(Interval(-0x1.3333333333333P+0, 0x1.5P+4), def) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), def), DecoratedInterval(interval(-2.1, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), def), DecoratedInterval(interval(-2.1, 0.12), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), def), DecoratedInterval(interval(-2.1, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), def), DecoratedInterval(interval(-2.1, 0.12), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), def), DecoratedInterval(interval(-2.1, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), def), DecoratedInterval(interval(-2.1, 0.12), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), def), DecoratedInterval(interval(-2.1, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), def), DecoratedInterval(interval(-2.1, 0.12), dac))[1] === DecoratedInterval(Interval(-0x1.A400000000001P+7 , 0x1.8P+3), def) && mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), def), DecoratedInterval(interval(-2.1, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), def), DecoratedInterval(interval(-2.1, 0.12), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), def), DecoratedInterval(interval(-2.1, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), def), DecoratedInterval(interval(-2.1, 0.12), dac))[1] === DecoratedInterval(Interval(-0x1.3333333333333P+0, 0x1.5P+4), def) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), def), DecoratedInterval(interval(-2.1, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), def), DecoratedInterval(interval(-2.1, 0.12), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), def), DecoratedInterval(interval(-2.1, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), def), DecoratedInterval(interval(-2.1, 0.12), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), def), DecoratedInterval(interval(-2.1, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), def), DecoratedInterval(interval(-2.1, 0.12), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), def), DecoratedInterval(interval(-2.1, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), def), DecoratedInterval(interval(-2.1, 0.12), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), def), DecoratedInterval(interval(-2.1, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), def), DecoratedInterval(interval(-2.1, 0.12), dac))[1] === DecoratedInterval(Interval(-0x1.A400000000001P+7 , 0x1.8P+3), def) && mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), def), DecoratedInterval(interval(-2.1, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(entireinterval(), def), DecoratedInterval(interval(-2.1, 0.12), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(entireinterval(), def), DecoratedInterval(interval(-2.1, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), com), DecoratedInterval(interval(0.0, 0.12), com))[1] === DecoratedInterval(Interval(-0x1.3333333333333P+0, 0.0), com) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), com), DecoratedInterval(interval(0.0, 0.12), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), com), DecoratedInterval(interval(0.0, 0.12), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), com), DecoratedInterval(interval(0.0, 0.12), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), com), DecoratedInterval(interval(0.0, 0.12), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), com), DecoratedInterval(interval(0.0, 0.12), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), com), DecoratedInterval(interval(0.0, 0.12), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), com), DecoratedInterval(interval(0.0, 0.12), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), com), DecoratedInterval(interval(0.0, 0.12), com))[1] === DecoratedInterval(Interval(0.0, 0x1.8P+3), com) && mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), com), DecoratedInterval(interval(0.0, 0.12), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), com), DecoratedInterval(interval(0.0, 0.12), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), com), DecoratedInterval(interval(0.0, 0.12), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(0.0, 0.12), com))[1] === DecoratedInterval(Interval(-0x1.3333333333333P+0, 0.0), dac) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(0.0, 0.12), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(0.0, 0.12), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(0.0, 0.12), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(0.0, 0.12), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(0.0, 0.12), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(0.0, 0.12), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(0.0, 0.12), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(0.0, 0.12), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(0.0, 0.12), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(0.0, 0.12), com))[1] === DecoratedInterval(Interval(0.0, 0x1.8P+3), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(0.0, 0.12), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(0.0, 0.12), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(0.0, 0.12), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(0.01, 0.12), dac))[1] === DecoratedInterval(Interval(-0x1.3333333333333P+0, -0x1.47AE147AE147BP-8), dac) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(0.01, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(0.01, 0.12), dac))[1] === DecoratedInterval(Interval(-Inf, -0x1.47AE147AE147BP-8), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(0.01, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(0.01, 0.12), dac))[1] === DecoratedInterval(Interval(-Inf, -0x1.47AE147AE147BP-8), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(0.01, 0.12), dac))[2] === DecoratedInterval(Interval(0x1.29E4129E4129DP-7, Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(0.01, 0.12), dac))[1] === DecoratedInterval(Interval(0x1.29E4129E4129DP-7, Inf), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(0.01, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(0.01, 0.12), dac))[1] === DecoratedInterval(Interval(0x1.29E4129E4129DP-7, 0x1.8P+3), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(0.01, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(0.01, 0.12), dac))[1] === DecoratedInterval(emptyinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(0.01, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(0.01, 0.12), dac))[1] === DecoratedInterval(Interval(-0x1.3333333333333P+0, 0.0), dac) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(0.01, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(0.01, 0.12), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(0.01, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(0.01, 0.12), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(0.01, 0.12), dac))[2] === DecoratedInterval(Interval(0x1.29E4129E4129DP-7, Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(0.01, 0.12), dac))[1] === DecoratedInterval(Interval(-Inf, -0x1.47AE147AE147BP-8), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(0.01, 0.12), dac))[2] === DecoratedInterval(Interval(0.0, Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(0.01, 0.12), dac))[1] === DecoratedInterval(Interval(0.0, Inf), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(0.01, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(0.01, 0.12), dac))[1] === DecoratedInterval(Interval(0.0, 0x1.8P+3), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(0.01, 0.12), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(0.01, 0.12), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), trv) && mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(0.01, 0.12), dac))[2] === DecoratedInterval(Interval(0.0, Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), com), DecoratedInterval(interval(0.0, 0.0), com))[1] === DecoratedInterval(Interval(0.0, 0.0), com) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), com), DecoratedInterval(interval(0.0, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), com), DecoratedInterval(interval(0.0, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), com), DecoratedInterval(interval(0.0, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), com), DecoratedInterval(interval(0.0, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), com), DecoratedInterval(interval(0.0, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), com), DecoratedInterval(interval(0.0, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), com), DecoratedInterval(interval(0.0, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), com), DecoratedInterval(interval(0.0, 0.0), com))[1] === DecoratedInterval(Interval(0.0, 0.0), com) && mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), com), DecoratedInterval(interval(0.0, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), com), DecoratedInterval(interval(0.0, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), com), DecoratedInterval(interval(0.0, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(0.0, 0.0), com))[1] === DecoratedInterval(Interval(0.0, 0.0), dac) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(0.0, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(0.0, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(0.0, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(0.0, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(0.0, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(0.0, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(0.0, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(0.0, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(0.0, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(0.0, 0.0), com))[1] === DecoratedInterval(Interval(0.0, 0.0), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(0.0, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(0.0, 0.0), com))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(0.0, 0.0), com))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[1] === DecoratedInterval(Interval(0x1.999999999999AP-5, Inf), dac) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[1] === DecoratedInterval(Interval(0x1.999999999999AP-5 , Inf), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[1] === DecoratedInterval(Interval(-Inf , -0x1.745D1745D1745P-4), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[2] === DecoratedInterval(Interval(0x1.999999999999AP-5 , Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[1] === DecoratedInterval(Interval(-Inf, -0x1.745D1745D1745P-4), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[1] === DecoratedInterval(Interval(-Inf, -0x1.745D1745D1745P-4), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[1] === DecoratedInterval(emptyinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[1] === DecoratedInterval(Interval(0.0, Inf), dac) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[1] === DecoratedInterval(Interval(0.0, Inf), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[1] === DecoratedInterval(Interval(-Inf, -0x1.745D1745D1745P-4), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[2] === DecoratedInterval(Interval(0.0, Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[2] === DecoratedInterval(Interval(0x1.999999999999AP-5 , Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), trv) && mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(-Inf, -0.1), dac))[2] === DecoratedInterval(Interval(0.0, Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[1] === DecoratedInterval(Interval(0.0, Inf), dac) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[1] === DecoratedInterval(Interval(0.0, Inf), dac) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(-Inf, 0.0), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[1] === DecoratedInterval(Interval(-0x1.8P+1, Inf), dac) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[1] === DecoratedInterval(Interval(-Inf, 0x1.EP+4), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[1] === DecoratedInterval(Interval(-0x1.8P+1, Inf), dac) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[1] === DecoratedInterval(Interval(-Inf, 0x1.EP+4), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(-Inf, 0.3), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(-0.21, Inf), dac))[1] === DecoratedInterval(Interval(-Inf , 0x1.0CCCCCCCCCCCDP+1), dac) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(-0.21, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(-0.21, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(-0.21, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(-0.21, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(-0.21, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(-0.21, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(-0.21, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(-0.21, Inf), dac))[1] === DecoratedInterval(Interval(-0x1.5P+4, Inf), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(-0.21, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(-0.21, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(-0.21, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(-0.21, Inf), dac))[1] === DecoratedInterval(Interval(-Inf, 0x1.0CCCCCCCCCCCDP+1), dac) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(-0.21, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(-0.21, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(-0.21, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(-0.21, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(-0.21, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(-0.21, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(-0.21, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(-0.21, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(-0.21, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(-0.21, Inf), dac))[1] === DecoratedInterval(Interval(-0x1.5P+4, Inf), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(-0.21, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(-0.21, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(-0.21, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(0.0, Inf), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), dac) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(0.0, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(0.0, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(0.0, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(0.0, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(0.0, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(0.0, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(0.0, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(0.0, Inf), dac))[1] === DecoratedInterval(Interval(0.0, Inf), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(0.0, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(0.0, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(0.0, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(0.0, Inf), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), dac) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(0.0, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(0.0, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(0.0, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(0.0, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(0.0, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(0.0, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(0.0, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(0.0, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(0.0, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(0.0, Inf), dac))[1] === DecoratedInterval(Interval(0.0, Inf), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(0.0, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(0.0, Inf), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(0.0, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(0.04, Inf), dac))[1] === DecoratedInterval(Interval(-Inf, -0x1.47AE147AE147BP-6), dac) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(interval(0.04, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(0.04, Inf), dac))[1] === DecoratedInterval(Interval(-Inf, -0x1.47AE147AE147BP-6), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(interval(0.04, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(0.04, Inf), dac))[1] === DecoratedInterval(Interval(-Inf, -0x1.47AE147AE147BP-6), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(interval(0.04, Inf), dac))[2] === DecoratedInterval(Interval(0x1.29E4129E4129DP-5, Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(0.04, Inf), dac))[1] === DecoratedInterval(Interval(0x1.29E4129E4129DP-5, Inf), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(interval(0.04, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(0.04, Inf), dac))[1] === DecoratedInterval(Interval(0x1.29E4129E4129DP-5, Inf), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(interval(0.04, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(0.04, Inf), dac))[1] === DecoratedInterval(emptyinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(interval(0.04, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(0.04, Inf), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), dac) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(interval(0.04, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(0.04, Inf), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(interval(0.04, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(0.04, Inf), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(interval(0.04, Inf), dac))[2] === DecoratedInterval(Interval(0x1.29E4129E4129DP-5, Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(0.04, Inf), dac))[1] === DecoratedInterval(Interval(-Inf, -0x1.47AE147AE147BP-6), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(interval(0.04, Inf), dac))[2] === DecoratedInterval(Interval(0.0, Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(0.04, Inf), dac))[1] === DecoratedInterval(Interval(0.0, Inf), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(interval(0.04, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(0.04, Inf), dac))[1] === DecoratedInterval(Interval(0.0, Inf), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(interval(0.04, Inf), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(0.04, Inf), dac))[1] === DecoratedInterval(Interval(-Inf, 0.0), trv) && mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(interval(0.04, Inf), dac))[2] === DecoratedInterval(Interval(0.0, Inf), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(entireinterval(), dac))[1] === DecoratedInterval(entireinterval(), dac) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, -0.1), dac), DecoratedInterval(entireinterval(), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(entireinterval(), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 0.0), dac), DecoratedInterval(entireinterval(), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(entireinterval(), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, 1.1), dac), DecoratedInterval(entireinterval(), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(entireinterval(), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 1.1), dac), DecoratedInterval(entireinterval(), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(entireinterval(), dac))[1] === DecoratedInterval(entireinterval(), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, 1.1), dac), DecoratedInterval(entireinterval(), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(entireinterval(), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, 0.0), dac), DecoratedInterval(entireinterval(), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(entireinterval(), dac))[1] === DecoratedInterval(entireinterval(), dac) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, -0.1), dac), DecoratedInterval(entireinterval(), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(entireinterval(), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 0.0), dac), DecoratedInterval(entireinterval(), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(entireinterval(), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-Inf, 1.1), dac), DecoratedInterval(entireinterval(), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(entireinterval(), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(-2.0, Inf), dac), DecoratedInterval(entireinterval(), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(entireinterval(), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(interval(0.0, Inf), dac), DecoratedInterval(entireinterval(), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(entireinterval(), dac))[1] === DecoratedInterval(entireinterval(), dac) && mul_rev_to_pair(DecoratedInterval(interval(0.01, Inf), dac), DecoratedInterval(entireinterval(), dac))[2] === DecoratedInterval(emptyinterval(), trv)

    @test mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(entireinterval(), dac))[1] === DecoratedInterval(entireinterval(), trv) && mul_rev_to_pair(DecoratedInterval(entireinterval(), dac), DecoratedInterval(entireinterval(), dac))[2] === DecoratedInterval(emptyinterval(), trv)

end


text:
# dependencies
using LFAToolkit
using LinearAlgebra
using Plots

# setup
finep = 4
coarsep = 1
numbercomponents = 1
dimension = 1
mesh = Mesh1D(1.0)

ctofbasis = TensorH1LagrangePProlongationBasis(coarsep+1, finep+1, numbercomponents, dimension)

# diffusion operators
finediffusion = GalleryOperator("diffusion", finep+1, finep+1, mesh)
coarsediffusion = GalleryOperator("diffusion", coarsep+1, finep+1, mesh)

# Chebyshev smoother
chebyshev = ChebSchwarz(finediffusion)

# p-multigrid preconditioner
multigrid = PMultigrid(finediffusion, coarsediffusion, chebyshev, [ctofbasis])

# full operator symbols
numbersteps = 250
maxeigenvalue = 0
θ_min = -π/2
θ_max = 3π/2
θ_step = 2π/(numbersteps-1)
θ_range = θ_min:θ_step:θ_max

# compute and plot smoothing factor
# setup
eigenvalues = zeros(4)

# compute
xrange = [1, 2, 3, 4]
for i in 1:numbersteps, j in xrange
    θ = [θ_range[i]]
    ω = [j]
    if abs(θ[1]) >  π/128
        A = computesymbols(multigrid, ω, [1, 1], θ)
        currenteigenvalues = [abs(val) for val in eigvals(A)]
        eigenvalues[j] = max(eigenvalues[j], currenteigenvalues...)
    end
end

# plot
bar(
    xrange,
    xlabel="k",
    xtickfont=font(12, "Courier"),
    eigenvalues,
    ytickfont=font(12, "Courier"),
    ylabel="spectral radius",
    linewidth=3,
    legend=:none,
    title="Two-Grid Convergence Factor",
    palette=palette(:tab10)
)
ylims!(min(0.0, eigenvalues...) * 1.1, max(eigenvalues...) * 1.1)

savefig("two_grid_converge_4_to_1_cheby_schwarz")

ext: jl


text:
using StratiGraphics
using Meshes
using GeoStatsBase
using Plots; gr(size=(600,400))
using ReferenceTests, ImageIO
using Test, Random

# workaround for GR warnings
ENV["GKSwstype"] = "100"

# environment settings
isCI = "CI" ∈ keys(ENV)
islinux = Sys.islinux()
visualtests = !isCI || (isCI && islinux)
datadir = joinpath(@__DIR__,"data")

include("dummysolver.jl")

@testset "StratiGraphics.jl" begin
  if visualtests
    Random.seed!(2019)
    proc   = GeoStatsProcess(Dummy())
    env    = Environment([proc, proc], [0.5 0.5; 0.5 0.5], ExponentialDuration(1.0))
    record = simulate(env, LandState(zeros(50,50)), 10)
    strata = Strata(record)

    @test_reference "data/strata.png" plot(strata)

    Random.seed!(2019)
    problem = SimulationProblem(CartesianGrid(50,50,20), :strata => Float64, 3)
    solver₁ = StratSim(:strata => (environment=env,))
    solver₂ = StratSim(:strata => (environment=env,fillbase=0))
    solver₃ = StratSim(:strata => (environment=env,fillbase=0,filltop=0))
    solvers = [solver₁, solver₂, solver₃]

    solutions = [solve(problem, solver) for solver in solvers]
    snames = ["voxel1","voxel2","voxel3"]

    for (solution, sname) in zip(solutions, snames)
      reals = solution[:strata]
      plts = map(reals) do real
        R = reshape(real, 50, 50, 20)
        heatmap(rotr90(R[1,:,:]))
      end
      plt = plot(plts...,layout=(3,1))
      @test_reference "data/$(sname).png" plt
    end
  end
end


text:
struct PositiveDefRBatchedCache{Ta,Tb,Tc,Td,Te}
    σr::Tc
    σc::Tc

    ∑σ::Tc
    Δσ::Tc

    out::Tb

    δℒℒ::Td
    δℒr::Te
    δℒc::Te

    θ::Tb
    θr::Ta
    θr2::Ta
    valid::Bool
end

function cache(l::PositiveDefR{Ta,Tb}, arr_T, in_T ,in_sz, batch_sz) where {Ta,Tb}
    c = PositiveDefRBatchedCache(
            similar(l.Wr, size(l.Wr,2), batch_sz),
            similar(l.Wr, size(l.Wr,2), batch_sz),

            similar(l.Wr, size(l.Wr,2), batch_sz),
            similar(l.Wr, size(l.Wr,2), batch_sz),

            similar(l.b, Complex{eltype(l.b)}, size(l.b,1), batch_sz),

            similar(l.Wr, Complex{eltype(l.b)}, size(l.Wr,1), batch_sz),
            similar(l.Wr, Complex{eltype(l.b)}, size(l.Wr,2), batch_sz),
            similar(l.Wr, Complex{eltype(l.b)}, size(l.Wr,2), batch_sz),

            similar(l.b, Complex{eltype(l.b)}, size(l.b,1), batch_sz),
            similar(l.b, size(l.b,1), batch_sz),
            similar(l.b, size(l.b,1), batch_sz),
            false)
    return c
end

batch_size(c::PositiveDefRBatchedCache) = size(c.out, 2)

function (l::PositiveDefR)(c::PositiveDefRBatchedCache, (xr, xc))
    # The preallocated caches
    out  = c.out
    θ    = c.θ
    θᵣ₁  = c.θr
    θᵣ₂  = c.θr2

    # Store the input to this layer for the backpropagation
    σr = copyto!(c.σr, xr)
    σc = copyto!(c.σc, xc)

    c.∑σ .= σr .+ σc
    c.Δσ .= σr .- σc

    #θ .= net.b .+ net.W * x
    mul!(θᵣ₁, l.Wr, c.∑σ)
    mul!(θᵣ₂, l.Wi, c.Δσ)
    θ .= θᵣ₁ .+ im .* θᵣ₂ .+ l.b

    # Apply the nonlinear function
    out  .= l.σ.(θ)
    return out
end

function backprop(∇, l::PositiveDefR, c::PositiveDefRBatchedCache, δℒ)
    # The preallocated caches
    θ = c.θ
    δℒℒ = c.δℒℒ

    # Compute the actual sensitivity
    copyto!(δℒℒ, δℒ)
    δℒℒ .*= fwd_der.(l.σ, θ)

    _batched_outer_prod_noconj!(∇.Wr, δℒℒ, c.∑σ)
    _batched_outer_prod_noconj!(∇.Wi, δℒℒ, c.Δσ)
    ∇.Wi .*= im

    ∇.b .= δℒℒ

    δℒr = 0 #mul!(c.δℒr, transpose(l.Wr), δℒℒ)
    δℒc = 0 #mul!(c.δℒc, transpose(l.Wi), δℒℒ)
    return (δℒr, δℒc)
end


text:
using DataFrames
using CSV
using Plots
#%%
data = open("orbit.dat")
df=CSV.read(data, header=false, delim=" ")

#%%
plot(df[1],df[2], label="orbita circolare", dpi=600)
savefig("cirolare.png")
# xaxis!(:log10)
# yaxis!(:log10)

max_stars_repo_name: aurelio-amerio/corso-cpp


text:
module PolytopesTests

using Test
using LinearAlgebra
using InplaceArrays.Helpers
using InplaceArrays.TensorValues
using InplaceArrays.Arrays
using InplaceArrays.Fields
using InplaceArrays.ReferenceFEs

import InplaceArrays.ReferenceFEs: Polytope
import InplaceArrays.ReferenceFEs: get_faces
import InplaceArrays.ReferenceFEs: get_dimrange
import InplaceArrays.ReferenceFEs: get_vertex_coordinates
import Base: ==

struct MockVertex <: Polytope{0} end

get_faces(p::MockVertex) = [[1]]

get_dimrange(p::MockVertex) = [1:1]

function Polytope{0}(p::MockVertex,faceid::Integer)
  @assert faceid == 1
  p
end

function (==)(a::MockVertex,b::MockVertex)
  true
end

get_vertex_coordinates(p::MockVertex) = [zero(Point{0,Float64})]

struct MockSegment <: Polytope{1} end

get_faces(p::MockSegment) = [[1],[2],[1,2,3]]

get_dimrange(p::MockSegment) = [1:2,3:3]

function Polytope{0}(p::MockSegment,faceid::Integer)
  @assert faceid in 1:2
  MockVertex()
end

function Polytope{1}(p::MockSegment,faceid::Integer)
  @assert faceid == 1
  p
end

function (==)(a::MockSegment,b::MockSegment)
  true
end

get_vertex_coordinates(p::MockSegment) = Point{1,Float64}[(0),(1)]

struct MockQuad <: Polytope{2} end

function get_faces(p::MockQuad)
  [
    [1],[2],[3],[4],
    [1,2,5],[3,4,6],[1,3,7],[2,4,8],
    [1,2,3,4,5,6,7,8,9]
  ]
end

function get_dimrange(p::MockQuad)
  [1:4,5:8,9:9]
end

function Polytope{0}(p::MockQuad,faceid::Integer)
  @assert faceid in 1:4
  MockVertex()
end

function Polytope{1}(p::MockQuad,faceid::Integer)
  @assert faceid in 1:4
  MockSegment()
end

function Polytope{2}(p::MockQuad,faceid::Integer)
  @assert faceid == 1
  p
end

function (==)(a::MockQuad,b::MockQuad)
  true
end

get_vertex_coordinates(p::MockQuad) = Point{2,Float64}[(0,0),(1,0),(0,1),(1,1)]

v = MockVertex()
test_polytope(v)
@test get_faces(v,0,0) == [[1]]
@test get_facedims(v) == [0]
@test get_offsets(v) == [0]
@test num_facets(v) == 0
@test num_edges(v) == 0

s = MockSegment()
test_polytope(s)
@test get_faces(s,0,0) == [[1], [2]]
@test get_faces(s,1,0) == [[1, 2]]
@test get_faces(s,0,1) == [[1], [1]]
@test get_faces(s,1,1) == [[1]]
@test get_facedims(s) == [0,0,1]
@test get_offsets(s) == [0,2]
@test num_facets(s) == 2
@test num_edges(s) == 1

q = MockQuad()
test_polytope(q)
@test get_faces(q,0,0) == [[1], [2], [3], [4]]
@test get_faces(q,1,0) == [[1, 2], [3, 4], [1, 3], [2, 4]]
@test get_faces(q,2,0) == [[1, 2, 3, 4]]
@test get_faces(q,0,1) == [[1, 3], [1, 4], [2, 3], [2, 4]]
@test get_faces(q,1,1) == [[1], [2], [3], [4]]
@test get_faces(q,2,1) == [[1, 2, 3, 4]]
@test get_faces(q,0,2) == [[1], [1], [1], [1]]
@test get_faces(q,1,2) == [[1], [1], [1], [1]]
@test get_faces(q,2,2) == [[1]]
@test get_facedims(q) == [0,0,0,0,1,1,1,1,2]
@test get_offsets(q) == [0,4,8]
@test num_facets(q) == 4
@test num_edges(q) == 4

end # module