(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 (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_2 (- INFINITY))
(* z (/ y (+ t (+ (* y b) (* t a)))))
(if (<= t_2 5e+292) (/ t_1 (+ (+ a 1.0) (* b (/ y t)))) (/ 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 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = z * (y / (t + ((y * b) + (t * a))));
} else if (t_2 <= 5e+292) {
tmp = t_1 / ((a + 1.0) + (b * (y / t)));
} 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);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = z * (y / (t + ((y * b) + (t * a))));
} else if (t_2 <= 5e+292) {
tmp = t_1 / ((a + 1.0) + (b * (y / t)));
} 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 / ((a + 1.0) + ((y * b) / t))
tmp = 0
if t_2 <= -math.inf:
tmp = z * (y / (t + ((y * b) + (t * a))))
elif t_2 <= 5e+292:
tmp = t_1 / ((a + 1.0) + (b * (y / t)))
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
↓
function code(x, y, z, t, a, b)
t_1 = Float64(x + Float64(Float64(y * z) / t))
t_2 = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)))
tmp = 0.0
if (t_2 <= Float64(-Inf))
tmp = Float64(z * Float64(y / Float64(t + Float64(Float64(y * b) + Float64(t * a)))));
elseif (t_2 <= 5e+292)
tmp = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t))));
else
tmp = Float64(z / b);
end
return tmp
end
function tmp = code(x, y, z, t, a, b)
tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
end
↓
function tmp_2 = code(x, y, z, t, a, b)
t_1 = x + ((y * z) / t);
t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
tmp = 0.0;
if (t_2 <= -Inf)
tmp = z * (y / (t + ((y * b) + (t * a))));
elseif (t_2 <= 5e+292)
tmp = t_1 / ((a + 1.0) + (b * (y / t)));
else
tmp = z / b;
end
tmp_2 = tmp;
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): 4 points increase in error, 14 points decrease in error
(*.f64 (/.f64 y (Rewrite<= distribute-lft-in_binary64 (*.f64 t (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))))) z): 0 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))): 38 points increase in error, 26 points decrease in error
(Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y z) (*.f64 t (+.f64 1 (+.f64 (/.f64 (*.f64 y b) t) a))))): 53 points increase in error, 36 points decrease in error
Taylor expanded in t around 0 12.7
\[\leadsto \frac{y}{t + \color{blue}{\left(y \cdot b + a \cdot t\right)}} \cdot z
\]
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.9999999999999996e292
(/.f64 (fma.f64 z (/.f64 y t) x) (+.f64 a (fma.f64 y (/.f64 b t) 1))): 0 points increase in error, 0 points decrease in error
(/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (/.f64 y t)) x)) (+.f64 a (fma.f64 y (/.f64 b t) 1))): 1 points increase in error, 1 points decrease in error
(/.f64 (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 y t) z)) x) (+.f64 a (fma.f64 y (/.f64 b t) 1))): 0 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 y (/.f64 b t) 1))): 18 points increase in error, 18 points decrease in error
(/.f64 (Rewrite<= +-commutative_binary64 (+.f64 x (/.f64 (*.f64 y z) t))) (+.f64 a (fma.f64 y (/.f64 b t) 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 y (/.f64 b t)) 1)))): 0 points increase in error, 0 points decrease in error
(/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 a (+.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 y b) t)) 1))): 24 points increase in error, 12 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)))): 1 points increase in error, 0 points decrease in error
herbie shell --seed 2022290
(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))))