
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
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));
}
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
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));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
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 tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
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));
}
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
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));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
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 tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_2 (fma (/ b t) y (+ 1.0 a))))
(if (<= t_1 -2e-7)
(fma (/ z t) (/ y t_2) (/ x t_2))
(if (<= t_1 1e+303)
(/ (fma (/ y t) z x) (fma (/ y t) b (+ 1.0 a)))
(/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_2 = fma((b / t), y, (1.0 + a));
double tmp;
if (t_1 <= -2e-7) {
tmp = fma((z / t), (y / t_2), (x / t_2));
} else if (t_1 <= 1e+303) {
tmp = fma((y / t), z, x) / fma((y / t), b, (1.0 + a));
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_2 = fma(Float64(b / t), y, Float64(1.0 + a)) tmp = 0.0 if (t_1 <= -2e-7) tmp = fma(Float64(z / t), Float64(y / t_2), Float64(x / t_2)); elseif (t_1 <= 1e+303) tmp = Float64(fma(Float64(y / t), z, x) / fma(Float64(y / t), b, Float64(1.0 + a))); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b / t), $MachinePrecision] * y + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-7], N[(N[(z / t), $MachinePrecision] * N[(y / t$95$2), $MachinePrecision] + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+303], N[(N[(N[(y / t), $MachinePrecision] * z + x), $MachinePrecision] / N[(N[(y / t), $MachinePrecision] * b + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_2 := \mathsf{fma}\left(\frac{b}{t}, y, 1 + a\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, \frac{y}{t\_2}, \frac{x}{t\_2}\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+303}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{\mathsf{fma}\left(\frac{y}{t}, b, 1 + a\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1.9999999999999999e-7Initial program 85.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-/.f64N/A
associate-/l/N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites96.0%
if -1.9999999999999999e-7 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 1e303Initial program 86.5%
Taylor expanded in x around 0
associate-/r*N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f6490.0
Applied rewrites90.0%
if 1e303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 13.3%
Taylor expanded in y around inf
lower-/.f6483.0
Applied rewrites83.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b))
(t_2 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
(t_3 (fma (/ y t) z x)))
(if (<= t_2 (- INFINITY))
(/ z b)
(if (<= t_2 -1e+135)
(/ t_3 1.0)
(if (<= t_2 -1.6)
t_1
(if (<= t_2 -1e-302)
(/ (fma (/ z t) y x) a)
(if (<= t_2 2e-298)
t_1
(if (<= t_2 2e-121)
(/ t_3 a)
(if (<= t_2 1e+303) (/ x (+ 1.0 a)) (/ z b))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double t_2 = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
double t_3 = fma((y / t), z, x);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = z / b;
} else if (t_2 <= -1e+135) {
tmp = t_3 / 1.0;
} else if (t_2 <= -1.6) {
tmp = t_1;
} else if (t_2 <= -1e-302) {
tmp = fma((z / t), y, x) / a;
} else if (t_2 <= 2e-298) {
tmp = t_1;
} else if (t_2 <= 2e-121) {
tmp = t_3 / a;
} else if (t_2 <= 1e+303) {
tmp = x / (1.0 + a);
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) t_2 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) t_3 = fma(Float64(y / t), z, x) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(z / b); elseif (t_2 <= -1e+135) tmp = Float64(t_3 / 1.0); elseif (t_2 <= -1.6) tmp = t_1; elseif (t_2 <= -1e-302) tmp = Float64(fma(Float64(z / t), y, x) / a); elseif (t_2 <= 2e-298) tmp = t_1; elseif (t_2 <= 2e-121) tmp = Float64(t_3 / a); elseif (t_2 <= 1e+303) tmp = Float64(x / Float64(1.0 + a)); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y / t), $MachinePrecision] * z + x), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(z / b), $MachinePrecision], If[LessEqual[t$95$2, -1e+135], N[(t$95$3 / 1.0), $MachinePrecision], If[LessEqual[t$95$2, -1.6], t$95$1, If[LessEqual[t$95$2, -1e-302], N[(N[(N[(z / t), $MachinePrecision] * y + x), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$2, 2e-298], t$95$1, If[LessEqual[t$95$2, 2e-121], N[(t$95$3 / a), $MachinePrecision], If[LessEqual[t$95$2, 1e+303], N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
t_3 := \mathsf{fma}\left(\frac{y}{t}, z, x\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+135}:\\
\;\;\;\;\frac{t\_3}{1}\\
\mathbf{elif}\;t\_2 \leq -1.6:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-302}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{z}{t}, y, x\right)}{a}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-298}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-121}:\\
\;\;\;\;\frac{t\_3}{a}\\
\mathbf{elif}\;t\_2 \leq 10^{+303}:\\
\;\;\;\;\frac{x}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -inf.0 or 1e303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 17.5%
Taylor expanded in y around inf
lower-/.f6480.0
Applied rewrites80.0%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -9.99999999999999962e134Initial program 99.7%
Taylor expanded in a around 0
lower-/.f64N/A
+-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6481.4
Applied rewrites81.4%
Taylor expanded in y around 0
Applied rewrites74.8%
if -9.99999999999999962e134 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1.6000000000000001 or -9.9999999999999996e-303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 1.99999999999999982e-298Initial program 68.2%
Taylor expanded in y around 0
lower-+.f6434.3
Applied rewrites34.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6436.2
Applied rewrites36.2%
Taylor expanded in b around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6462.7
Applied rewrites62.7%
if -1.6000000000000001 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -9.9999999999999996e-303Initial program 99.8%
Taylor expanded in x around 0
associate-/r*N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f6492.4
Applied rewrites92.4%
Taylor expanded in a around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f6461.9
Applied rewrites61.9%
if 1.99999999999999982e-298 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2e-121Initial program 99.8%
Taylor expanded in a around inf
lower-/.f64N/A
+-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f6478.8
Applied rewrites78.8%
if 2e-121 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 1e303Initial program 99.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6461.7
Applied rewrites61.7%
Final simplification67.4%
(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 -1.6)
(/ (fma (/ y t) z x) (fma (/ y t) b 1.0))
(if (<= t_2 -1e-302)
(/ t_1 (+ 1.0 a))
(if (<= t_2 5e-305)
(/ (fma t (/ x y) z) b)
(if (<= t_2 INFINITY)
(fma z (/ y (* (+ 1.0 a) t)) (/ x (+ 1.0 a)))
(/ z b)))))))
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 <= -1.6) {
tmp = fma((y / t), z, x) / fma((y / t), b, 1.0);
} else if (t_2 <= -1e-302) {
tmp = t_1 / (1.0 + a);
} else if (t_2 <= 5e-305) {
tmp = fma(t, (x / y), z) / b;
} else if (t_2 <= ((double) INFINITY)) {
tmp = fma(z, (y / ((1.0 + a) * t)), (x / (1.0 + a)));
} else {
tmp = z / b;
}
return tmp;
}
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 <= -1.6) tmp = Float64(fma(Float64(y / t), z, x) / fma(Float64(y / t), b, 1.0)); elseif (t_2 <= -1e-302) tmp = Float64(t_1 / Float64(1.0 + a)); elseif (t_2 <= 5e-305) tmp = Float64(fma(t, Float64(x / y), z) / b); elseif (t_2 <= Inf) tmp = fma(z, Float64(y / Float64(Float64(1.0 + a) * t)), Float64(x / Float64(1.0 + a))); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1.6], N[(N[(N[(y / t), $MachinePrecision] * z + x), $MachinePrecision] / N[(N[(y / t), $MachinePrecision] * b + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1e-302], N[(t$95$1 / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-305], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(z * N[(y / N[(N[(1.0 + a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t\_1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_2 \leq -1.6:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{\mathsf{fma}\left(\frac{y}{t}, b, 1\right)}\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-302}:\\
\;\;\;\;\frac{t\_1}{1 + a}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-305}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y}{\left(1 + a\right) \cdot t}, \frac{x}{1 + a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1.6000000000000001Initial program 84.5%
Taylor expanded in a around 0
lower-/.f64N/A
+-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6467.6
Applied rewrites67.6%
if -1.6000000000000001 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -9.9999999999999996e-303Initial program 99.8%
Taylor expanded in y around 0
lower-+.f6484.7
Applied rewrites84.7%
if -9.9999999999999996e-303 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.99999999999999985e-305Initial program 53.2%
Taylor expanded in y around 0
lower-+.f6429.1
Applied rewrites29.1%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6431.0
Applied rewrites31.0%
Taylor expanded in b around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6471.1
Applied rewrites71.1%
if 4.99999999999999985e-305 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 92.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6484.7
Applied rewrites84.7%
Taylor expanded in y around 0
lower-+.f6467.2
Applied rewrites67.2%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
associate-*r/N/A
lift-/.f64N/A
frac-timesN/A
associate-/l*N/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites75.3%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 0.0%
Taylor expanded in y around inf
lower-/.f6496.3
Applied rewrites96.3%
Final simplification76.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.3e+203) (not (<= y 1.6e+155))) (/ (fma t (/ x y) z) b) (/ (fma (/ y t) z x) (fma (/ y t) b (+ 1.0 a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5.3e+203) || !(y <= 1.6e+155)) {
tmp = fma(t, (x / y), z) / b;
} else {
tmp = fma((y / t), z, x) / fma((y / t), b, (1.0 + a));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5.3e+203) || !(y <= 1.6e+155)) tmp = Float64(fma(t, Float64(x / y), z) / b); else tmp = Float64(fma(Float64(y / t), z, x) / fma(Float64(y / t), b, Float64(1.0 + a))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5.3e+203], N[Not[LessEqual[y, 1.6e+155]], $MachinePrecision]], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], N[(N[(N[(y / t), $MachinePrecision] * z + x), $MachinePrecision] / N[(N[(y / t), $MachinePrecision] * b + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{+203} \lor \neg \left(y \leq 1.6 \cdot 10^{+155}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{\mathsf{fma}\left(\frac{y}{t}, b, 1 + a\right)}\\
\end{array}
\end{array}
if y < -5.29999999999999987e203 or 1.60000000000000006e155 < y Initial program 39.5%
Taylor expanded in y around 0
lower-+.f6419.9
Applied rewrites19.9%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6424.9
Applied rewrites24.9%
Taylor expanded in b around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6481.8
Applied rewrites81.8%
if -5.29999999999999987e203 < y < 1.60000000000000006e155Initial program 86.9%
Taylor expanded in x around 0
associate-/r*N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f6492.0
Applied rewrites92.0%
Final simplification89.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (fma t (/ x y) z) b)))
(if (<= y -1.55e+78)
t_1
(if (<= y -5.5e-61)
(/ x (fma (/ y t) b (+ 1.0 a)))
(if (<= y 9.5e+154) (/ (fma (/ y t) z x) (+ 1.0 a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, (x / y), z) / b;
double tmp;
if (y <= -1.55e+78) {
tmp = t_1;
} else if (y <= -5.5e-61) {
tmp = x / fma((y / t), b, (1.0 + a));
} else if (y <= 9.5e+154) {
tmp = fma((y / t), z, x) / (1.0 + a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(fma(t, Float64(x / y), z) / b) tmp = 0.0 if (y <= -1.55e+78) tmp = t_1; elseif (y <= -5.5e-61) tmp = Float64(x / fma(Float64(y / t), b, Float64(1.0 + a))); elseif (y <= 9.5e+154) tmp = Float64(fma(Float64(y / t), z, x) / Float64(1.0 + a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -1.55e+78], t$95$1, If[LessEqual[y, -5.5e-61], N[(x / N[(N[(y / t), $MachinePrecision] * b + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e+154], N[(N[(N[(y / t), $MachinePrecision] * z + x), $MachinePrecision] / N[(1.0 + a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{if}\;y \leq -1.55 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{-61}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(\frac{y}{t}, b, 1 + a\right)}\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+154}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y}{t}, z, x\right)}{1 + a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.55e78 or 9.5000000000000001e154 < y Initial program 44.0%
Taylor expanded in y around 0
lower-+.f6424.3
Applied rewrites24.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6429.3
Applied rewrites29.3%
Taylor expanded in b around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6477.3
Applied rewrites77.3%
if -1.55e78 < y < -5.4999999999999997e-61Initial program 89.6%
Taylor expanded in x around inf
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f6468.9
Applied rewrites68.9%
if -5.4999999999999997e-61 < y < 9.5000000000000001e154Initial program 90.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
associate-*l/N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f6475.1
Applied rewrites75.1%
Final simplification74.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.55e+78) (not (<= y 1.6e+155))) (/ (fma t (/ x y) z) b) (/ x (fma (/ y t) b (+ 1.0 a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.55e+78) || !(y <= 1.6e+155)) {
tmp = fma(t, (x / y), z) / b;
} else {
tmp = x / fma((y / t), b, (1.0 + a));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.55e+78) || !(y <= 1.6e+155)) tmp = Float64(fma(t, Float64(x / y), z) / b); else tmp = Float64(x / fma(Float64(y / t), b, Float64(1.0 + a))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.55e+78], N[Not[LessEqual[y, 1.6e+155]], $MachinePrecision]], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], N[(x / N[(N[(y / t), $MachinePrecision] * b + N[(1.0 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+78} \lor \neg \left(y \leq 1.6 \cdot 10^{+155}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(\frac{y}{t}, b, 1 + a\right)}\\
\end{array}
\end{array}
if y < -1.55e78 or 1.60000000000000006e155 < y Initial program 44.0%
Taylor expanded in y around 0
lower-+.f6424.3
Applied rewrites24.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6429.3
Applied rewrites29.3%
Taylor expanded in b around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6477.3
Applied rewrites77.3%
if -1.55e78 < y < 1.60000000000000006e155Initial program 90.3%
Taylor expanded in x around inf
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f6464.2
Applied rewrites64.2%
Final simplification68.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -9e-44) (not (<= y 8.8e+64))) (/ (fma t (/ x y) z) b) (/ x (+ 1.0 a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9e-44) || !(y <= 8.8e+64)) {
tmp = fma(t, (x / y), z) / b;
} else {
tmp = x / (1.0 + a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -9e-44) || !(y <= 8.8e+64)) tmp = Float64(fma(t, Float64(x / y), z) / b); else tmp = Float64(x / Float64(1.0 + a)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -9e-44], N[Not[LessEqual[y, 8.8e+64]], $MachinePrecision]], N[(N[(t * N[(x / y), $MachinePrecision] + z), $MachinePrecision] / b), $MachinePrecision], N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-44} \lor \neg \left(y \leq 8.8 \cdot 10^{+64}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(t, \frac{x}{y}, z\right)}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + a}\\
\end{array}
\end{array}
if y < -8.9999999999999997e-44 or 8.80000000000000007e64 < y Initial program 56.6%
Taylor expanded in y around 0
lower-+.f6435.3
Applied rewrites35.3%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6439.4
Applied rewrites39.4%
Taylor expanded in b around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6463.4
Applied rewrites63.4%
if -8.9999999999999997e-44 < y < 8.80000000000000007e64Initial program 94.2%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6456.0
Applied rewrites56.0%
Final simplification59.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (+ a 1.0) -20000000.0) (not (<= (+ a 1.0) 20.0))) (/ x a) (fma (- x) a x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a + 1.0) <= -20000000.0) || !((a + 1.0) <= 20.0)) {
tmp = x / a;
} else {
tmp = fma(-x, a, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a + 1.0) <= -20000000.0) || !(Float64(a + 1.0) <= 20.0)) tmp = Float64(x / a); else tmp = fma(Float64(-x), a, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a + 1.0), $MachinePrecision], -20000000.0], N[Not[LessEqual[N[(a + 1.0), $MachinePrecision], 20.0]], $MachinePrecision]], N[(x / a), $MachinePrecision], N[((-x) * a + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a + 1 \leq -20000000 \lor \neg \left(a + 1 \leq 20\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, a, x\right)\\
\end{array}
\end{array}
if (+.f64 a #s(literal 1 binary64)) < -2e7 or 20 < (+.f64 a #s(literal 1 binary64)) Initial program 76.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6447.1
Applied rewrites47.1%
Taylor expanded in a around inf
Applied rewrites46.5%
if -2e7 < (+.f64 a #s(literal 1 binary64)) < 20Initial program 77.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6431.5
Applied rewrites31.5%
Taylor expanded in a around 0
Applied rewrites31.0%
Final simplification39.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.55e+78) (not (<= y 9.5e+154))) (/ z b) (/ x (+ 1.0 a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.55e+78) || !(y <= 9.5e+154)) {
tmp = z / b;
} else {
tmp = x / (1.0 + a);
}
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
real(8) :: tmp
if ((y <= (-1.55d+78)) .or. (.not. (y <= 9.5d+154))) then
tmp = z / b
else
tmp = x / (1.0d0 + a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.55e+78) || !(y <= 9.5e+154)) {
tmp = z / b;
} else {
tmp = x / (1.0 + a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.55e+78) or not (y <= 9.5e+154): tmp = z / b else: tmp = x / (1.0 + a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.55e+78) || !(y <= 9.5e+154)) tmp = Float64(z / b); else tmp = Float64(x / Float64(1.0 + a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.55e+78) || ~((y <= 9.5e+154))) tmp = z / b; else tmp = x / (1.0 + a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.55e+78], N[Not[LessEqual[y, 9.5e+154]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / N[(1.0 + a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+78} \lor \neg \left(y \leq 9.5 \cdot 10^{+154}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + a}\\
\end{array}
\end{array}
if y < -1.55e78 or 9.5000000000000001e154 < y Initial program 44.0%
Taylor expanded in y around inf
lower-/.f6468.0
Applied rewrites68.0%
if -1.55e78 < y < 9.5000000000000001e154Initial program 90.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6451.7
Applied rewrites51.7%
Final simplification56.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.2e-167) (not (<= y 7.1e-38))) (/ z b) (/ x a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.2e-167) || !(y <= 7.1e-38)) {
tmp = z / b;
} else {
tmp = x / a;
}
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
real(8) :: tmp
if ((y <= (-7.2d-167)) .or. (.not. (y <= 7.1d-38))) then
tmp = z / b
else
tmp = x / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.2e-167) || !(y <= 7.1e-38)) {
tmp = z / b;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7.2e-167) or not (y <= 7.1e-38): tmp = z / b else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7.2e-167) || !(y <= 7.1e-38)) tmp = Float64(z / b); else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -7.2e-167) || ~((y <= 7.1e-38))) tmp = z / b; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7.2e-167], N[Not[LessEqual[y, 7.1e-38]], $MachinePrecision]], N[(z / b), $MachinePrecision], N[(x / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-167} \lor \neg \left(y \leq 7.1 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if y < -7.2000000000000002e-167 or 7.1000000000000002e-38 < y Initial program 65.4%
Taylor expanded in y around inf
lower-/.f6446.3
Applied rewrites46.3%
if -7.2000000000000002e-167 < y < 7.1000000000000002e-38Initial program 95.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6464.4
Applied rewrites64.4%
Taylor expanded in a around inf
Applied rewrites41.8%
Final simplification44.6%
(FPCore (x y z t a b) :precision binary64 (fma (- x) a x))
double code(double x, double y, double z, double t, double a, double b) {
return fma(-x, a, x);
}
function code(x, y, z, t, a, b) return fma(Float64(-x), a, x) end
code[x_, y_, z_, t_, a_, b_] := N[((-x) * a + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-x, a, x\right)
\end{array}
Initial program 76.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6439.6
Applied rewrites39.6%
Taylor expanded in a around 0
Applied rewrites16.1%
(FPCore (x y z t a b) :precision binary64 (* (- x) a))
double code(double x, double y, double z, double t, double a, double b) {
return -x * a;
}
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 * a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return -x * a;
}
def code(x, y, z, t, a, b): return -x * a
function code(x, y, z, t, a, b) return Float64(Float64(-x) * a) end
function tmp = code(x, y, z, t, a, b) tmp = -x * a; end
code[x_, y_, z_, t_, a_, b_] := N[((-x) * a), $MachinePrecision]
\begin{array}{l}
\\
\left(-x\right) \cdot a
\end{array}
Initial program 76.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6439.6
Applied rewrites39.6%
Taylor expanded in a around 0
Applied rewrites16.1%
Taylor expanded in a around inf
Applied rewrites4.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(if (< t -1.3659085366310088e-271)
t_1
(if (< t 3.036967103737246e-130) (/ z b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 * ((x + ((y / t) * z)) * (1.0d0 / ((a + 1.0d0) + ((y / t) * b))))
if (t < (-1.3659085366310088d-271)) then
tmp = t_1
else if (t < 3.036967103737246d-130) then
tmp = z / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))) tmp = 0 if t < -1.3659085366310088e-271: tmp = t_1 elif t < 3.036967103737246e-130: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 * Float64(Float64(x + Float64(Float64(y / t) * z)) * Float64(1.0 / Float64(Float64(a + 1.0) + Float64(Float64(y / t) * b))))) tmp = 0.0 if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))); tmp = 0.0; if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 * N[(N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y / t), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.3659085366310088e-271], t$95$1, If[Less[t, 3.036967103737246e-130], N[(z / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 \cdot \left(\left(x + \frac{y}{t} \cdot z\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\right)\\
\mathbf{if}\;t < -1.3659085366310088 \cdot 10^{-271}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.036967103737246 \cdot 10^{-130}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024332
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:alt
(! :herbie-platform default (if (< t -1707385670788761/12500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))) (if (< t 1518483551868623/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ z b) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))