
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
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 + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
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 + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y x) t)) (t_2 (+ (+ x t) y)) (t_3 (/ y t_2)))
(if (or (<= z -2.45e-45) (not (<= z 8e-37)))
(*
(+ (fma (/ (- b) z) t_3 (/ x t_2)) (fma a (/ (+ t_3 (/ t t_2)) z) t_3))
z)
(fma (+ (/ t t_1) (/ y t_1)) a (/ (fma z x (* y (- z b))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) + t;
double t_2 = (x + t) + y;
double t_3 = y / t_2;
double tmp;
if ((z <= -2.45e-45) || !(z <= 8e-37)) {
tmp = (fma((-b / z), t_3, (x / t_2)) + fma(a, ((t_3 + (t / t_2)) / z), t_3)) * z;
} else {
tmp = fma(((t / t_1) + (y / t_1)), a, (fma(z, x, (y * (z - b))) / t_1));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) + t) t_2 = Float64(Float64(x + t) + y) t_3 = Float64(y / t_2) tmp = 0.0 if ((z <= -2.45e-45) || !(z <= 8e-37)) tmp = Float64(Float64(fma(Float64(Float64(-b) / z), t_3, Float64(x / t_2)) + fma(a, Float64(Float64(t_3 + Float64(t / t_2)) / z), t_3)) * z); else tmp = fma(Float64(Float64(t / t_1) + Float64(y / t_1)), a, Float64(fma(z, x, Float64(y * Float64(z - b))) / t_1)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$3 = N[(y / t$95$2), $MachinePrecision]}, If[Or[LessEqual[z, -2.45e-45], N[Not[LessEqual[z, 8e-37]], $MachinePrecision]], N[(N[(N[(N[((-b) / z), $MachinePrecision] * t$95$3 + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(t$95$3 + N[(t / t$95$2), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[(N[(t / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision] * a + N[(N[(z * x + N[(y * N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
t_2 := \left(x + t\right) + y\\
t_3 := \frac{y}{t\_2}\\
\mathbf{if}\;z \leq -2.45 \cdot 10^{-45} \lor \neg \left(z \leq 8 \cdot 10^{-37}\right):\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{-b}{z}, t\_3, \frac{x}{t\_2}\right) + \mathsf{fma}\left(a, \frac{t\_3 + \frac{t}{t\_2}}{z}, t\_3\right)\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{t\_1} + \frac{y}{t\_1}, a, \frac{\mathsf{fma}\left(z, x, y \cdot \left(z - b\right)\right)}{t\_1}\right)\\
\end{array}
\end{array}
if z < -2.4499999999999999e-45 or 8.00000000000000053e-37 < z Initial program 47.5%
Taylor expanded in a around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites56.6%
Taylor expanded in z around inf
Applied rewrites99.8%
if -2.4499999999999999e-45 < z < 8.00000000000000053e-37Initial program 70.0%
Taylor expanded in a around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites87.4%
Final simplification94.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ t y) a))
(t_2 (+ (+ x t) y))
(t_3 (/ (- (+ (* (+ x y) z) t_1) (* y b)) t_2))
(t_4 (- (+ z a) (* y (/ b (+ (+ t x) y))))))
(if (<= t_3 (- INFINITY))
t_4
(if (<= t_3 -1e+163)
(/ (- t_1 (* y b)) t_2)
(if (<= t_3 5e+45) (/ (fma (+ y x) z t_1) (+ (+ y x) t)) t_4)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) * a;
double t_2 = (x + t) + y;
double t_3 = ((((x + y) * z) + t_1) - (y * b)) / t_2;
double t_4 = (z + a) - (y * (b / ((t + x) + y)));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_3 <= -1e+163) {
tmp = (t_1 - (y * b)) / t_2;
} else if (t_3 <= 5e+45) {
tmp = fma((y + x), z, t_1) / ((y + x) + t);
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) * a) t_2 = Float64(Float64(x + t) + y) t_3 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + t_1) - Float64(y * b)) / t_2) t_4 = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_4; elseif (t_3 <= -1e+163) tmp = Float64(Float64(t_1 - Float64(y * b)) / t_2); elseif (t_3 <= 5e+45) tmp = Float64(fma(Float64(y + x), z, t_1) / Float64(Float64(y + x) + t)); else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$4, If[LessEqual[t$95$3, -1e+163], N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 5e+45], N[(N[(N[(y + x), $MachinePrecision] * z + t$95$1), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) \cdot a\\
t_2 := \left(x + t\right) + y\\
t_3 := \frac{\left(\left(x + y\right) \cdot z + t\_1\right) - y \cdot b}{t\_2}\\
t_4 := \left(z + a\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq -1 \cdot 10^{+163}:\\
\;\;\;\;\frac{t\_1 - y \cdot b}{t\_2}\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+45}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + x, z, t\_1\right)}{\left(y + x\right) + t}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 5e45 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 23.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites28.9%
Taylor expanded in y around inf
+-commutativeN/A
lower-+.f6480.3
Applied rewrites80.3%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.9999999999999994e162Initial program 99.8%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f64N/A
lower-+.f6492.2
Applied rewrites92.2%
if -9.9999999999999994e162 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5e45Initial program 99.7%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6479.4
Applied rewrites79.4%
Final simplification80.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+235)))
(- (+ z a) (* y (/ b (+ (+ t x) y))))
t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+235)) {
tmp = (z + a) - (y * (b / ((t + x) + y)));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+235)) {
tmp = (z + a) - (y * (b / ((t + x) + y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+235): tmp = (z + a) - (y * (b / ((t + x) + y))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+235)) tmp = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e+235))) tmp = (z + a) - (y * (b / ((t + x) + y))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+235]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+235}\right):\\
\;\;\;\;\left(z + a\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 5.00000000000000027e235 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.1%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites13.9%
Taylor expanded in y around inf
+-commutativeN/A
lower-+.f6479.9
Applied rewrites79.9%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000027e235Initial program 99.7%
Final simplification90.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y))))
(if (or (<= t_1 -2e-132) (not (<= t_1 5e+45)))
(- (+ z a) (* y (/ b (+ (+ t x) y))))
(/ (fma a t (* z x)) (+ t x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
double tmp;
if ((t_1 <= -2e-132) || !(t_1 <= 5e+45)) {
tmp = (z + a) - (y * (b / ((t + x) + y)));
} else {
tmp = fma(a, t, (z * x)) / (t + x);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) tmp = 0.0 if ((t_1 <= -2e-132) || !(t_1 <= 5e+45)) tmp = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))); else tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e-132], N[Not[LessEqual[t$95$1, 5e+45]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-132} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+45}\right):\\
\;\;\;\;\left(z + a\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2e-132 or 5e45 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 49.2%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites51.3%
Taylor expanded in y around inf
+-commutativeN/A
lower-+.f6477.2
Applied rewrites77.2%
if -2e-132 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5e45Initial program 99.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6475.8
Applied rewrites75.8%
Final simplification77.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1e-33) (not (<= y 690.0))) (- (+ z a) (* y (/ b (+ (+ t x) y)))) (fma a (/ t (+ x t)) (* x (/ z (+ x t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1e-33) || !(y <= 690.0)) {
tmp = (z + a) - (y * (b / ((t + x) + y)));
} else {
tmp = fma(a, (t / (x + t)), (x * (z / (x + t))));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1e-33) || !(y <= 690.0)) tmp = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(Float64(t + x) + y)))); else tmp = fma(a, Float64(t / Float64(x + t)), Float64(x * Float64(z / Float64(x + t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1e-33], N[Not[LessEqual[y, 690.0]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision] + N[(x * N[(z / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-33} \lor \neg \left(y \leq 690\right):\\
\;\;\;\;\left(z + a\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{t}{x + t}, x \cdot \frac{z}{x + t}\right)\\
\end{array}
\end{array}
if y < -1.0000000000000001e-33 or 690 < y Initial program 43.3%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lift-*.f64N/A
associate-/l*N/A
cancel-sign-sub-invN/A
lower-+.f64N/A
Applied rewrites50.2%
Taylor expanded in y around inf
+-commutativeN/A
lower-+.f6486.2
Applied rewrites86.2%
if -1.0000000000000001e-33 < y < 690Initial program 70.7%
Taylor expanded in a around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites86.2%
Taylor expanded in y around 0
Applied rewrites82.9%
Final simplification84.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -1e-33)
t_1
(if (<= y -4e-211)
(* a (/ t (+ t x)))
(if (<= y 1.7e-208)
(/ (fma a t (* z x)) (+ t x))
(if (<= y 23000000.0) (+ z a) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double tmp;
if (y <= -1e-33) {
tmp = t_1;
} else if (y <= -4e-211) {
tmp = a * (t / (t + x));
} else if (y <= 1.7e-208) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (y <= 23000000.0) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -1e-33) tmp = t_1; elseif (y <= -4e-211) tmp = Float64(a * Float64(t / Float64(t + x))); elseif (y <= 1.7e-208) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (y <= 23000000.0) tmp = Float64(z + a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1e-33], t$95$1, If[LessEqual[y, -4e-211], N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-208], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 23000000.0], N[(z + a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -1 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -4 \cdot 10^{-211}:\\
\;\;\;\;a \cdot \frac{t}{t + x}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-208}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;y \leq 23000000:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.0000000000000001e-33 or 2.3e7 < y Initial program 43.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6476.2
Applied rewrites76.2%
if -1.0000000000000001e-33 < y < -4.00000000000000034e-211Initial program 63.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6450.8
Applied rewrites50.8%
Taylor expanded in z around 0
Applied rewrites62.3%
if -4.00000000000000034e-211 < y < 1.7e-208Initial program 86.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6475.5
Applied rewrites75.5%
if 1.7e-208 < y < 2.3e7Initial program 60.7%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6445.1
Applied rewrites45.1%
Taylor expanded in y around inf
Applied rewrites55.8%
Final simplification70.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1e-33) (not (<= y 8.6e-15))) (- (+ a z) b) (* a (/ t (+ t x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1e-33) || !(y <= 8.6e-15)) {
tmp = (a + z) - b;
} else {
tmp = a * (t / (t + x));
}
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 <= (-1d-33)) .or. (.not. (y <= 8.6d-15))) then
tmp = (a + z) - b
else
tmp = a * (t / (t + x))
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 <= -1e-33) || !(y <= 8.6e-15)) {
tmp = (a + z) - b;
} else {
tmp = a * (t / (t + x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1e-33) or not (y <= 8.6e-15): tmp = (a + z) - b else: tmp = a * (t / (t + x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1e-33) || !(y <= 8.6e-15)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(a * Float64(t / Float64(t + x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1e-33) || ~((y <= 8.6e-15))) tmp = (a + z) - b; else tmp = a * (t / (t + x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1e-33], N[Not[LessEqual[y, 8.6e-15]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-33} \lor \neg \left(y \leq 8.6 \cdot 10^{-15}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t}{t + x}\\
\end{array}
\end{array}
if y < -1.0000000000000001e-33 or 8.5999999999999993e-15 < y Initial program 44.2%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6475.3
Applied rewrites75.3%
if -1.0000000000000001e-33 < y < 8.5999999999999993e-15Initial program 70.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6457.3
Applied rewrites57.3%
Taylor expanded in z around 0
Applied rewrites53.4%
Final simplification64.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.3e-13) (not (<= y 23000000.0))) (- (+ a z) b) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.3e-13) || !(y <= 23000000.0)) {
tmp = (a + z) - b;
} else {
tmp = z + 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.3d-13)) .or. (.not. (y <= 23000000.0d0))) then
tmp = (a + z) - b
else
tmp = z + 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.3e-13) || !(y <= 23000000.0)) {
tmp = (a + z) - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.3e-13) or not (y <= 23000000.0): tmp = (a + z) - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.3e-13) || !(y <= 23000000.0)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.3e-13) || ~((y <= 23000000.0))) tmp = (a + z) - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.3e-13], N[Not[LessEqual[y, 23000000.0]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-13} \lor \neg \left(y \leq 23000000\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if y < -1.3e-13 or 2.3e7 < y Initial program 42.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6476.8
Applied rewrites76.8%
if -1.3e-13 < y < 2.3e7Initial program 70.6%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6457.2
Applied rewrites57.2%
Taylor expanded in y around inf
Applied rewrites52.8%
Final simplification64.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.9e+194) (not (<= t 9.8e+204))) (* a 1.0) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.9e+194) || !(t <= 9.8e+204)) {
tmp = a * 1.0;
} else {
tmp = z + 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 ((t <= (-2.9d+194)) .or. (.not. (t <= 9.8d+204))) then
tmp = a * 1.0d0
else
tmp = z + 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 ((t <= -2.9e+194) || !(t <= 9.8e+204)) {
tmp = a * 1.0;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.9e+194) or not (t <= 9.8e+204): tmp = a * 1.0 else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.9e+194) || !(t <= 9.8e+204)) tmp = Float64(a * 1.0); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.9e+194) || ~((t <= 9.8e+204))) tmp = a * 1.0; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.9e+194], N[Not[LessEqual[t, 9.8e+204]], $MachinePrecision]], N[(a * 1.0), $MachinePrecision], N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+194} \lor \neg \left(t \leq 9.8 \cdot 10^{+204}\right):\\
\;\;\;\;a \cdot 1\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if t < -2.9000000000000001e194 or 9.7999999999999995e204 < t Initial program 37.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6431.9
Applied rewrites31.9%
Taylor expanded in z around 0
Applied rewrites67.7%
Taylor expanded in x around 0
Applied rewrites65.8%
if -2.9000000000000001e194 < t < 9.7999999999999995e204Initial program 61.5%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6445.3
Applied rewrites45.3%
Taylor expanded in y around inf
Applied rewrites57.3%
Final simplification58.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -1.7e-152) (not (<= x -6.6e-295))) (+ z a) (- a b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.7e-152) || !(x <= -6.6e-295)) {
tmp = z + a;
} else {
tmp = a - 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
real(8) :: tmp
if ((x <= (-1.7d-152)) .or. (.not. (x <= (-6.6d-295)))) then
tmp = z + a
else
tmp = a - b
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 ((x <= -1.7e-152) || !(x <= -6.6e-295)) {
tmp = z + a;
} else {
tmp = a - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -1.7e-152) or not (x <= -6.6e-295): tmp = z + a else: tmp = a - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -1.7e-152) || !(x <= -6.6e-295)) tmp = Float64(z + a); else tmp = Float64(a - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -1.7e-152) || ~((x <= -6.6e-295))) tmp = z + a; else tmp = a - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -1.7e-152], N[Not[LessEqual[x, -6.6e-295]], $MachinePrecision]], N[(z + a), $MachinePrecision], N[(a - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-152} \lor \neg \left(x \leq -6.6 \cdot 10^{-295}\right):\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;a - b\\
\end{array}
\end{array}
if x < -1.69999999999999992e-152 or -6.5999999999999997e-295 < x Initial program 55.9%
Taylor expanded in b around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6443.5
Applied rewrites43.5%
Taylor expanded in y around inf
Applied rewrites56.9%
if -1.69999999999999992e-152 < x < -6.5999999999999997e-295Initial program 63.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6462.7
Applied rewrites62.7%
Taylor expanded in z around 0
Applied rewrites68.2%
Final simplification58.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.12e+57) (not (<= z 3.8e+85))) (- z b) (- a b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.12e+57) || !(z <= 3.8e+85)) {
tmp = z - b;
} else {
tmp = a - 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
real(8) :: tmp
if ((z <= (-1.12d+57)) .or. (.not. (z <= 3.8d+85))) then
tmp = z - b
else
tmp = a - b
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 ((z <= -1.12e+57) || !(z <= 3.8e+85)) {
tmp = z - b;
} else {
tmp = a - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.12e+57) or not (z <= 3.8e+85): tmp = z - b else: tmp = a - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.12e+57) || !(z <= 3.8e+85)) tmp = Float64(z - b); else tmp = Float64(a - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.12e+57) || ~((z <= 3.8e+85))) tmp = z - b; else tmp = a - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.12e+57], N[Not[LessEqual[z, 3.8e+85]], $MachinePrecision]], N[(z - b), $MachinePrecision], N[(a - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{+57} \lor \neg \left(z \leq 3.8 \cdot 10^{+85}\right):\\
\;\;\;\;z - b\\
\mathbf{else}:\\
\;\;\;\;a - b\\
\end{array}
\end{array}
if z < -1.12000000000000003e57 or 3.79999999999999992e85 < z Initial program 33.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.7
Applied rewrites56.7%
Taylor expanded in b around inf
Applied rewrites10.6%
Taylor expanded in a around 0
Applied rewrites57.7%
if -1.12000000000000003e57 < z < 3.79999999999999992e85Initial program 70.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6453.5
Applied rewrites53.5%
Taylor expanded in z around 0
Applied rewrites49.5%
Final simplification52.5%
(FPCore (x y z t a b) :precision binary64 (- a b))
double code(double x, double y, double z, double t, double a, double b) {
return a - b;
}
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 = a - b
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a - b;
}
def code(x, y, z, t, a, b): return a - b
function code(x, y, z, t, a, b) return Float64(a - b) end
function tmp = code(x, y, z, t, a, b) tmp = a - b; end
code[x_, y_, z_, t_, a_, b_] := N[(a - b), $MachinePrecision]
\begin{array}{l}
\\
a - b
\end{array}
Initial program 56.9%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6454.7
Applied rewrites54.7%
Taylor expanded in z around 0
Applied rewrites39.5%
Final simplification39.5%
(FPCore (x y z t a b) :precision binary64 (- b))
double code(double x, double y, double z, double t, double a, double b) {
return -b;
}
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 = -b
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return -b;
}
def code(x, y, z, t, a, b): return -b
function code(x, y, z, t, a, b) return Float64(-b) end
function tmp = code(x, y, z, t, a, b) tmp = -b; end
code[x_, y_, z_, t_, a_, b_] := (-b)
\begin{array}{l}
\\
-b
\end{array}
Initial program 56.9%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6454.7
Applied rewrites54.7%
Taylor expanded in b around inf
Applied rewrites13.0%
Final simplification13.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
(t_3 (/ t_2 t_1))
(t_4 (- (+ z a) b)))
(if (< t_3 -3.5813117084150564e+153)
t_4
(if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + t) + y
t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
t_3 = t_2 / t_1
t_4 = (z + a) - b
if (t_3 < (-3.5813117084150564d+153)) then
tmp = t_4
else if (t_3 < 1.2285964308315609d+82) then
tmp = 1.0d0 / (t_1 / t_2)
else
tmp = t_4
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 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + t) + y t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b) t_3 = t_2 / t_1 t_4 = (z + a) - b tmp = 0 if t_3 < -3.5813117084150564e+153: tmp = t_4 elif t_3 < 1.2285964308315609e+82: tmp = 1.0 / (t_1 / t_2) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) t_3 = Float64(t_2 / t_1) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = Float64(1.0 / Float64(t_1 / t_2)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + t) + y; t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b); t_3 = t_2 / t_1; t_4 = (z + a) - b; tmp = 0.0; if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = 1.0 / (t_1 / t_2); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t\_2}{t\_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
herbie shell --seed 2024298
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3581311708415056400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 12285964308315609000000000000000000000000000000000000000000000000000000000000000000) (/ 1 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b))))
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))