(FPCore (x y z t a b)
:precision binary64
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
↓
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ z (/ t (/ y x))) b))
(t_2 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_2 -4e-306)
(/ (fma (/ y t) z x) (+ a (fma (/ y t) b 1.0)))
(if (<= t_2 0.0) t_1 (if (<= t_2 5e+292) t_2 t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
↓
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + (t / (y / x))) / b;
double t_2 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_2 <= -4e-306) {
tmp = fma((y / t), z, x) / (a + fma((y / t), b, 1.0));
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 5e+292) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b)
return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)))
end
↓
function code(x, y, z, t, a, b)
t_1 = Float64(Float64(z + Float64(t / Float64(y / x))) / b)
t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0)))
tmp = 0.0
if (t_2 <= -4e-306)
tmp = Float64(fma(Float64(y / t), z, x) / Float64(a + fma(Float64(y / t), b, 1.0)));
elseif (t_2 <= 0.0)
tmp = t_1;
elseif (t_2 <= 5e+292)
tmp = t_2;
else
tmp = t_1;
end
return tmp
end
(/.f64 (fma.f64 (/.f64 y t) z x) (+.f64 a (fma.f64 (/.f64 y t) b 1))): 0 points increase in error, 0 points decrease in error
(/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 y t) z) x)) (+.f64 a (fma.f64 (/.f64 y t) b 1))): 2 points increase in error, 0 points decrease in error
(/.f64 (+.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 y z) t)) x) (+.f64 a (fma.f64 (/.f64 y t) b 1))): 21 points increase in error, 23 points decrease in error
(/.f64 (Rewrite<= +-commutative_binary64 (+.f64 x (/.f64 (*.f64 y z) t))) (+.f64 a (fma.f64 (/.f64 y t) b 1))): 0 points increase in error, 0 points decrease in error
(/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 a (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 y t) b) 1)))): 0 points increase in error, 0 points decrease in error
(/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 a (+.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 y b) t)) 1))): 10 points increase in error, 9 points decrease in error
(/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 a (Rewrite<= +-commutative_binary64 (+.f64 1 (/.f64 (*.f64 y b) t))))): 0 points increase in error, 0 points decrease in error
(/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t)))): 0 points increase in error, 0 points decrease in error
if -4.00000000000000011e-306 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -0.0 or 4.9999999999999996e292 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t)))
(/.f64 (+.f64 x (*.f64 (/.f64 y t) z)) (+.f64 1 (+.f64 a (*.f64 (/.f64 y t) b)))): 0 points increase in error, 0 points decrease in error
(/.f64 (+.f64 x (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 y z) t))) (+.f64 1 (+.f64 a (*.f64 (/.f64 y t) b)))): 21 points increase in error, 23 points decrease in error
(/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 1 (+.f64 a (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 y b) t))))): 10 points increase in error, 9 points decrease in error
(/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 1 a) (/.f64 (*.f64 y b) t)))): 0 points increase in error, 0 points decrease in error
(/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 a 1)) (/.f64 (*.f64 y b) t))): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 (*.f64 t x) b) (*.f64 (/.f64 t b) (/.f64 (+.f64 z (*.f64 a z)) b))) y)): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 (*.f64 t x) b) (*.f64 (/.f64 t b) (/.f64 (+.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 z)) (*.f64 a z)) b))) y)): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 (*.f64 t x) b) (*.f64 (/.f64 t b) (/.f64 (Rewrite<= distribute-rgt-in_binary64 (*.f64 z (+.f64 1 a))) b))) y)): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 (*.f64 t x) b) (*.f64 (/.f64 t b) (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 1 a) z)) b))) y)): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 (*.f64 t x) b) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (*.f64 b b)))) y)): 19 points increase in error, 7 points decrease in error
(+.f64 (/.f64 z b) (/.f64 (-.f64 (/.f64 (*.f64 t x) b) (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (Rewrite<= unpow2_binary64 (pow.f64 b 2)))) y)): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 z b) (/.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 (-.f64 (/.f64 (*.f64 t x) b) (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (pow.f64 b 2))))) y)): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 z b) (/.f64 (*.f64 (Rewrite<= metadata-eval (*.f64 -1 -1)) (-.f64 (/.f64 (*.f64 t x) b) (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (pow.f64 b 2)))) y)): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 z b) (/.f64 (Rewrite<= associate-*r*_binary64 (*.f64 -1 (*.f64 -1 (-.f64 (/.f64 (*.f64 t x) b) (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (pow.f64 b 2)))))) y)): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 z b) (/.f64 (*.f64 -1 (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 -1 (/.f64 (*.f64 t x) b)) (*.f64 -1 (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (pow.f64 b 2)))))) y)): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 z b) (Rewrite<= associate-*r/_binary64 (*.f64 -1 (/.f64 (-.f64 (*.f64 -1 (/.f64 (*.f64 t x) b)) (*.f64 -1 (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (pow.f64 b 2)))) y)))): 0 points increase in error, 0 points decrease in error
(Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 (-.f64 (*.f64 -1 (/.f64 (*.f64 t x) b)) (*.f64 -1 (/.f64 (*.f64 t (*.f64 (+.f64 1 a) z)) (pow.f64 b 2)))) y)) (/.f64 z b))): 0 points increase in error, 0 points decrease in error
herbie shell --seed 2022332
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:herbie-target
(if (< t -1.3659085366310088e-271) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))