(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 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_1 (- INFINITY))
(/ (- z (/ t (/ (- y) x))) b)
(if (<= t_1 -5e-57)
t_1
(if (<= t_1 -4e-319)
(/ (+ x (* z (/ y t))) (+ 1.0 (+ a (* b (/ y t)))))
(if (<= t_1 0.0)
(+ (/ z b) (* (/ t y) (/ x b)))
(if (<= t_1 1e+304) t_1 (/ z b))))))))
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 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (z - (t / (-y / x))) / b;
} else if (t_1 <= -5e-57) {
tmp = t_1;
} else if (t_1 <= -4e-319) {
tmp = (x + (z * (y / t))) / (1.0 + (a + (b * (y / t))));
} else if (t_1 <= 0.0) {
tmp = (z / b) + ((t / y) * (x / b));
} else if (t_1 <= 1e+304) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
public static 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));
}
↓
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (z - (t / (-y / x))) / b;
} else if (t_1 <= -5e-57) {
tmp = t_1;
} else if (t_1 <= -4e-319) {
tmp = (x + (z * (y / t))) / (1.0 + (a + (b * (y / t))));
} else if (t_1 <= 0.0) {
tmp = (z / b) + ((t / y) * (x / b));
} else if (t_1 <= 1e+304) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b):
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
↓
def code(x, y, z, t, a, b):
t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0))
tmp = 0
if t_1 <= -math.inf:
tmp = (z - (t / (-y / x))) / b
elif t_1 <= -5e-57:
tmp = t_1
elif t_1 <= -4e-319:
tmp = (x + (z * (y / t))) / (1.0 + (a + (b * (y / t))))
elif t_1 <= 0.0:
tmp = (z / b) + ((t / y) * (x / b))
elif t_1 <= 1e+304:
tmp = t_1
else:
tmp = z / b
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
(/.f64 (+.f64 x (/.f64 y (/.f64 t z))) (+.f64 (+.f64 a 1) (/.f64 y (/.f64 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 (+.f64 a 1) (/.f64 y (/.f64 t b)))): 21 points increase in error, 21 points decrease in error
(/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y b) t)))): 9 points increase in error, 14 points decrease in error
(*.f64 (/.f64 t b) (/.f64 (fma.f64 y (/.f64 z t) x) y)): 0 points increase in error, 0 points decrease in error
(*.f64 (/.f64 t b) (/.f64 (Rewrite=> fma-udef_binary64 (+.f64 (*.f64 y (/.f64 z t)) x)) y)): 0 points increase in error, 0 points decrease in error
(*.f64 (/.f64 t b) (/.f64 (+.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 y z) t)) x) y)): 20 points increase in error, 3 points decrease in error
(Rewrite<= times-frac_binary64 (/.f64 (*.f64 t (+.f64 (/.f64 (*.f64 y z) t) x)) (*.f64 b y))): 35 points increase in error, 40 points decrease in error
(/.f64 (*.f64 t (+.f64 (/.f64 (*.f64 y z) t) x)) (Rewrite<= *-commutative_binary64 (*.f64 y b))): 0 points increase in error, 0 points decrease in error
(-.f64 z (/.f64 t (/.f64 (neg.f64 y) x))): 0 points increase in error, 0 points decrease in error
(-.f64 z (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 t x) (neg.f64 y)))): 23 points increase in error, 22 points decrease in error
(Rewrite<= unsub-neg_binary64 (+.f64 z (neg.f64 (/.f64 (*.f64 t x) (neg.f64 y))))): 0 points increase in error, 0 points decrease in error
(+.f64 z (Rewrite=> distribute-neg-frac_binary64 (/.f64 (neg.f64 (*.f64 t x)) (neg.f64 y)))): 0 points increase in error, 0 points decrease in error
(+.f64 z (/.f64 (Rewrite<= distribute-rgt-neg-out_binary64 (*.f64 t (neg.f64 x))) (neg.f64 y))): 0 points increase in error, 0 points decrease in error
(+.f64 z (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 (*.f64 t (neg.f64 x)) 1)) (neg.f64 y))): 0 points increase in error, 0 points decrease in error
(+.f64 z (Rewrite<= associate-*r/_binary64 (*.f64 (*.f64 t (neg.f64 x)) (/.f64 1 (neg.f64 y))))): 8 points increase in error, 10 points decrease in error
(Rewrite<= +-commutative_binary64 (+.f64 (*.f64 (*.f64 t (neg.f64 x)) (/.f64 1 (neg.f64 y))) z)): 0 points increase in error, 0 points decrease in error
(Rewrite<= fma-udef_binary64 (fma.f64 (*.f64 t (neg.f64 x)) (/.f64 1 (neg.f64 y)) z)): 0 points increase in error, 0 points decrease in error
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -5.0000000000000002e-57 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 9.9999999999999994e303
(/.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)))): 25 points increase in error, 20 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))))): 9 points increase in error, 7 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
if -4.0000049e-319 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 0.0
(/.f64 (+.f64 x (/.f64 y (/.f64 t z))) (+.f64 (+.f64 a 1) (/.f64 y (/.f64 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 (+.f64 a 1) (/.f64 y (/.f64 t b)))): 21 points increase in error, 21 points decrease in error
(/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y b) t)))): 9 points increase in error, 14 points decrease in error
(*.f64 (/.f64 t b) (/.f64 (fma.f64 y (/.f64 z t) x) y)): 0 points increase in error, 0 points decrease in error
(*.f64 (/.f64 t b) (/.f64 (Rewrite=> fma-udef_binary64 (+.f64 (*.f64 y (/.f64 z t)) x)) y)): 0 points increase in error, 0 points decrease in error
(*.f64 (/.f64 t b) (/.f64 (+.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 y z) t)) x) y)): 20 points increase in error, 3 points decrease in error
(Rewrite<= times-frac_binary64 (/.f64 (*.f64 t (+.f64 (/.f64 (*.f64 y z) t) x)) (*.f64 b y))): 35 points increase in error, 40 points decrease in error
(/.f64 (*.f64 t (+.f64 (/.f64 (*.f64 y z) t) x)) (Rewrite<= *-commutative_binary64 (*.f64 y b))): 0 points increase in error, 0 points decrease in error
(/.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)))): 25 points increase in error, 20 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))))): 9 points increase in error, 7 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
herbie shell --seed 2022325
(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))))