(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 (+ (/ (* y b) t) (+ a 1.0))) (t_2 (/ (+ x (/ (* y z) t)) t_1)))
(if (<= t_2 (- INFINITY))
(* z (/ y (+ t (* t (+ a (/ y (/ t b)))))))
(if (<= t_2 -2e-321)
(/ (+ x (* (* y z) (/ 1.0 t))) t_1)
(if (<= t_2 0.0)
(* (/ t y) (/ (+ x (/ z (/ t y))) b))
(if (<= t_2 2e+293) t_2 (/ 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 = ((y * b) / t) + (a + 1.0);
double t_2 = (x + ((y * z) / t)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = z * (y / (t + (t * (a + (y / (t / b))))));
} else if (t_2 <= -2e-321) {
tmp = (x + ((y * z) * (1.0 / t))) / t_1;
} else if (t_2 <= 0.0) {
tmp = (t / y) * ((x + (z / (t / y))) / b);
} else if (t_2 <= 2e+293) {
tmp = t_2;
} 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 = ((y * b) / t) + (a + 1.0);
double t_2 = (x + ((y * z) / t)) / t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = z * (y / (t + (t * (a + (y / (t / b))))));
} else if (t_2 <= -2e-321) {
tmp = (x + ((y * z) * (1.0 / t))) / t_1;
} else if (t_2 <= 0.0) {
tmp = (t / y) * ((x + (z / (t / y))) / b);
} else if (t_2 <= 2e+293) {
tmp = t_2;
} 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 = ((y * b) / t) + (a + 1.0)
t_2 = (x + ((y * z) / t)) / t_1
tmp = 0
if t_2 <= -math.inf:
tmp = z * (y / (t + (t * (a + (y / (t / b))))))
elif t_2 <= -2e-321:
tmp = (x + ((y * z) * (1.0 / t))) / t_1
elif t_2 <= 0.0:
tmp = (t / y) * ((x + (z / (t / y))) / b)
elif t_2 <= 2e+293:
tmp = t_2
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 y (+.f64 t (*.f64 t (+.f64 (/.f64 y (/.f64 t b)) a)))) z): 0 points increase in error, 0 points decrease in error
(*.f64 (/.f64 y (+.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 t 1)) (*.f64 t (+.f64 (/.f64 y (/.f64 t b)) a)))) z): 0 points increase in error, 0 points decrease in error
(*.f64 (/.f64 y (+.f64 (*.f64 t 1) (*.f64 t (+.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y b) t)) a)))) z): 7 points increase in error, 9 points decrease in error
(*.f64 (/.f64 y (Rewrite<= distribute-lft-in_binary64 (*.f64 t (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))))) z): 2 points increase in error, 0 points decrease in error
(Rewrite<= associate-/r/_binary64 (/.f64 y (/.f64 (*.f64 t (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))) z))): 31 points increase in error, 29 points decrease in error
(Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y z) (*.f64 t (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))))): 48 points increase in error, 33 points decrease in error
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2.00097e-321
(*.f64 (/.f64 t y) (/.f64 (+.f64 x (/.f64 z (/.f64 t y))) b)): 0 points increase in error, 0 points decrease in error
(*.f64 (/.f64 t y) (/.f64 (+.f64 x (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 z y) t))) b)): 8 points increase in error, 7 points decrease in error
(*.f64 (/.f64 t y) (/.f64 (+.f64 x (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 y z)) t)) b)): 0 points increase in error, 0 points decrease in error
(*.f64 (/.f64 t y) (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 y z) t) x)) b)): 0 points increase in error, 0 points decrease in error
(Rewrite<= times-frac_binary64 (/.f64 (*.f64 t (+.f64 (/.f64 (*.f64 y z) t) x)) (*.f64 y b))): 53 points increase in error, 37 points decrease in error
if -0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 1.9999999999999998e293
herbie shell --seed 2022291
(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))))