(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))) (t_2 (/ t_1 (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_2 -4e-319)
(/ (+ x (/ -1.0 (/ (/ (- t) y) z))) (+ 1.0 (+ a (/ b (/ t y)))))
(if (<= t_2 0.0)
(+ (/ z b) (* (/ t y) (/ x b)))
(if (<= t_2 1e+304)
(/ t_1 (+ (* (* y b) (/ 1.0 t)) (+ a 1.0)))
(/ 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);
double t_2 = t_1 / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_2 <= -4e-319) {
tmp = (x + (-1.0 / ((-t / y) / z))) / (1.0 + (a + (b / (t / y))));
} else if (t_2 <= 0.0) {
tmp = (z / b) + ((t / y) * (x / b));
} else if (t_2 <= 1e+304) {
tmp = t_1 / (((y * b) * (1.0 / t)) + (a + 1.0));
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + ((y * z) / t)) / ((a + 1.0d0) + ((y * b) / t))
end function
↓
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + ((y * z) / t)
t_2 = t_1 / (((y * b) / t) + (a + 1.0d0))
if (t_2 <= (-4d-319)) then
tmp = (x + ((-1.0d0) / ((-t / y) / z))) / (1.0d0 + (a + (b / (t / y))))
else if (t_2 <= 0.0d0) then
tmp = (z / b) + ((t / y) * (x / b))
else if (t_2 <= 1d+304) then
tmp = t_1 / (((y * b) * (1.0d0 / t)) + (a + 1.0d0))
else
tmp = z / b
end if
code = tmp
end function
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);
double t_2 = t_1 / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_2 <= -4e-319) {
tmp = (x + (-1.0 / ((-t / y) / z))) / (1.0 + (a + (b / (t / y))));
} else if (t_2 <= 0.0) {
tmp = (z / b) + ((t / y) * (x / b));
} else if (t_2 <= 1e+304) {
tmp = t_1 / (((y * b) * (1.0 / t)) + (a + 1.0));
} 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)
t_2 = t_1 / (((y * b) / t) + (a + 1.0))
tmp = 0
if t_2 <= -4e-319:
tmp = (x + (-1.0 / ((-t / y) / z))) / (1.0 + (a + (b / (t / y))))
elif t_2 <= 0.0:
tmp = (z / b) + ((t / y) * (x / b))
elif t_2 <= 1e+304:
tmp = t_1 / (((y * b) * (1.0 / t)) + (a + 1.0))
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 (/.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
(/.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 z b) (*.f64 t (-.f64 (/.f64 (/.f64 x y) b) (*.f64 (/.f64 (+.f64 1 a) y) (/.f64 z (*.f64 b b)))))): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 z b) (*.f64 t (-.f64 (Rewrite<= associate-/r*_binary64 (/.f64 x (*.f64 y b))) (*.f64 (/.f64 (+.f64 1 a) y) (/.f64 z (*.f64 b b)))))): 4 points increase in error, 13 points decrease in error
(+.f64 (/.f64 z b) (*.f64 t (-.f64 (/.f64 x (*.f64 y b)) (*.f64 (/.f64 (+.f64 1 a) y) (/.f64 z (Rewrite<= unpow2_binary64 (pow.f64 b 2))))))): 0 points increase in error, 0 points decrease in error
(+.f64 (/.f64 z b) (*.f64 t (-.f64 (/.f64 x (*.f64 y b)) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 (+.f64 1 a) z) (*.f64 y (pow.f64 b 2))))))): 10 points increase in error, 11 points decrease in error
(+.f64 (/.f64 z b) (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 (/.f64 x (*.f64 y b)) (/.f64 (*.f64 (+.f64 1 a) z) (*.f64 y (pow.f64 b 2)))) t))): 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))))