
(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 (+ (+ x y) t))
(t_2 (/ y t_1))
(t_3
(*
(- (* (/ (+ t y) t_1) (/ a z)) (fma (/ b z) t_2 (/ (- (+ x y)) t_1)))
z)))
(if (<= z -3e-72)
t_3
(if (<= z 3.2e-81)
(*
(- (/ (/ (* (+ x y) z) a) t_1) (fma (/ b a) t_2 (/ (- (+ t y)) t_1)))
a)
t_3))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) + t;
double t_2 = y / t_1;
double t_3 = ((((t + y) / t_1) * (a / z)) - fma((b / z), t_2, (-(x + y) / t_1))) * z;
double tmp;
if (z <= -3e-72) {
tmp = t_3;
} else if (z <= 3.2e-81) {
tmp = (((((x + y) * z) / a) / t_1) - fma((b / a), t_2, (-(t + y) / t_1))) * a;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) + t) t_2 = Float64(y / t_1) t_3 = Float64(Float64(Float64(Float64(Float64(t + y) / t_1) * Float64(a / z)) - fma(Float64(b / z), t_2, Float64(Float64(-Float64(x + y)) / t_1))) * z) tmp = 0.0 if (z <= -3e-72) tmp = t_3; elseif (z <= 3.2e-81) tmp = Float64(Float64(Float64(Float64(Float64(Float64(x + y) * z) / a) / t_1) - fma(Float64(b / a), t_2, Float64(Float64(-Float64(t + y)) / t_1))) * a); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(y / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(a / z), $MachinePrecision]), $MachinePrecision] - N[(N[(b / z), $MachinePrecision] * t$95$2 + N[((-N[(x + y), $MachinePrecision]) / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -3e-72], t$95$3, If[LessEqual[z, 3.2e-81], N[(N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] / a), $MachinePrecision] / t$95$1), $MachinePrecision] - N[(N[(b / a), $MachinePrecision] * t$95$2 + N[((-N[(t + y), $MachinePrecision]) / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + t\\
t_2 := \frac{y}{t\_1}\\
t_3 := \left(\frac{t + y}{t\_1} \cdot \frac{a}{z} - \mathsf{fma}\left(\frac{b}{z}, t\_2, \frac{-\left(x + y\right)}{t\_1}\right)\right) \cdot z\\
\mathbf{if}\;z \leq -3 \cdot 10^{-72}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-81}:\\
\;\;\;\;\left(\frac{\frac{\left(x + y\right) \cdot z}{a}}{t\_1} - \mathsf{fma}\left(\frac{b}{a}, t\_2, \frac{-\left(t + y\right)}{t\_1}\right)\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -3e-72 or 3.2e-81 < z Initial program 52.2%
lift-/.f64N/A
frac-2negN/A
div-invN/A
lower-*.f64N/A
Applied rewrites52.5%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites98.2%
if -3e-72 < z < 3.2e-81Initial program 75.7%
lift-/.f64N/A
frac-2negN/A
div-invN/A
lower-*.f64N/A
Applied rewrites75.5%
Taylor expanded in a around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites82.0%
Final simplification92.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ t y) a) (* (+ x y) z)) (* y b)) (+ (+ x t) y)))
(t_2 (+ (+ x y) t)))
(if (<= t_1 (- INFINITY))
(*
(-
(* (/ (+ t y) t_2) (/ a z))
(fma y (/ b (* t_2 z)) (/ (- (+ x y)) t_2)))
z)
(if (<= t_1 5e+235) t_1 (- (+ a z) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((t + y) * a) + ((x + y) * z)) - (y * b)) / ((x + t) + y);
double t_2 = (x + y) + t;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = ((((t + y) / t_2) * (a / z)) - fma(y, (b / (t_2 * z)), (-(x + y) / t_2))) * z;
} else if (t_1 <= 5e+235) {
tmp = t_1;
} else {
tmp = (a + z) - b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(Float64(x + y) * z)) - Float64(y * b)) / Float64(Float64(x + t) + y)) t_2 = Float64(Float64(x + y) + t) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(Float64(Float64(t + y) / t_2) * Float64(a / z)) - fma(y, Float64(b / Float64(t_2 * z)), Float64(Float64(-Float64(x + y)) / t_2))) * z); elseif (t_1 <= 5e+235) tmp = t_1; else tmp = Float64(Float64(a + z) - b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(N[(N[(t + y), $MachinePrecision] / t$95$2), $MachinePrecision] * N[(a / z), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b / N[(t$95$2 * z), $MachinePrecision]), $MachinePrecision] + N[((-N[(x + y), $MachinePrecision]) / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t$95$1, 5e+235], t$95$1, N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(t + y\right) \cdot a + \left(x + y\right) \cdot z\right) - y \cdot b}{\left(x + t\right) + y}\\
t_2 := \left(x + y\right) + t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left(\frac{t + y}{t\_2} \cdot \frac{a}{z} - \mathsf{fma}\left(y, \frac{b}{t\_2 \cdot z}, \frac{-\left(x + y\right)}{t\_2}\right)\right) \cdot z\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+235}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\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.0Initial program 6.7%
lift-/.f64N/A
frac-2negN/A
div-invN/A
lower-*.f64N/A
Applied rewrites6.7%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites84.3%
Applied rewrites84.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)) < 5.00000000000000027e235Initial program 99.5%
if 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 8.8%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6475.1
Applied rewrites75.1%
Final simplification90.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ t y) a) (* (+ x y) z)) (* y b)) (+ (+ x t) y)))
(t_2 (- (+ a z) b)))
(if (<= t_1 (- INFINITY)) t_2 (if (<= t_1 5e+235) t_1 t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((t + y) * a) + ((x + y) * z)) - (y * b)) / ((x + t) + y);
double t_2 = (a + z) - b;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= 5e+235) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((t + y) * a) + ((x + y) * z)) - (y * b)) / ((x + t) + y);
double t_2 = (a + z) - b;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= 5e+235) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((t + y) * a) + ((x + y) * z)) - (y * b)) / ((x + t) + y) t_2 = (a + z) - b tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= 5e+235: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(t + y) * a) + Float64(Float64(x + y) * z)) - Float64(y * b)) / Float64(Float64(x + t) + y)) t_2 = Float64(Float64(a + z) - b) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= 5e+235) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((t + y) * a) + ((x + y) * z)) - (y * b)) / ((x + t) + y); t_2 = (a + z) - b; tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= 5e+235) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] + N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 5e+235], t$95$1, t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(t + y\right) \cdot a + \left(x + y\right) \cdot z\right) - y \cdot b}{\left(x + t\right) + y}\\
t_2 := \left(a + z\right) - b\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+235}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\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 8.1%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6475.6
Applied rewrites75.6%
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.5%
Final simplification89.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ a z) b))
(t_3 (* (+ t y) a))
(t_4 (/ (- (+ t_3 (* (+ x y) z)) (* y b)) t_1)))
(if (<= t_4 (- INFINITY))
t_2
(if (<= t_4 4e+139) (/ (fma (+ x y) z t_3) t_1) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (a + z) - b;
double t_3 = (t + y) * a;
double t_4 = ((t_3 + ((x + y) * z)) - (y * b)) / t_1;
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_4 <= 4e+139) {
tmp = fma((x + y), z, t_3) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(a + z) - b) t_3 = Float64(Float64(t + y) * a) t_4 = Float64(Float64(Float64(t_3 + Float64(Float64(x + y) * z)) - Float64(y * b)) / t_1) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_2; elseif (t_4 <= 4e+139) tmp = Float64(fma(Float64(x + y), z, t_3) / t_1); else tmp = t_2; end return 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[(a + z), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$2, If[LessEqual[t$95$4, 4e+139], N[(N[(N[(x + y), $MachinePrecision] * z + t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(a + z\right) - b\\
t_3 := \left(t + y\right) \cdot a\\
t_4 := \frac{\left(t\_3 + \left(x + y\right) \cdot z\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 4 \cdot 10^{+139}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x + y, z, t\_3\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\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 4.00000000000000013e139 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 13.6%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6474.7
Applied rewrites74.7%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000013e139Initial program 99.5%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6481.4
Applied rewrites81.4%
Final simplification78.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x y) t))
(t_2
(*
(-
(* (/ (+ t y) t_1) (/ a z))
(fma y (/ b (* t_1 z)) (/ (- (+ x y)) t_1)))
z)))
(if (<= z -4.8e-211)
t_2
(if (<= z 1.45e-83)
(*
(-
(/ (/ (* (+ x y) z) a) t_1)
(fma (/ b a) (/ y t_1) (/ (- (+ t y)) t_1)))
a)
t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) + t;
double t_2 = ((((t + y) / t_1) * (a / z)) - fma(y, (b / (t_1 * z)), (-(x + y) / t_1))) * z;
double tmp;
if (z <= -4.8e-211) {
tmp = t_2;
} else if (z <= 1.45e-83) {
tmp = (((((x + y) * z) / a) / t_1) - fma((b / a), (y / t_1), (-(t + y) / t_1))) * a;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) + t) t_2 = Float64(Float64(Float64(Float64(Float64(t + y) / t_1) * Float64(a / z)) - fma(y, Float64(b / Float64(t_1 * z)), Float64(Float64(-Float64(x + y)) / t_1))) * z) tmp = 0.0 if (z <= -4.8e-211) tmp = t_2; elseif (z <= 1.45e-83) tmp = Float64(Float64(Float64(Float64(Float64(Float64(x + y) * z) / a) / t_1) - fma(Float64(b / a), Float64(y / t_1), Float64(Float64(-Float64(t + y)) / t_1))) * a); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(a / z), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b / N[(t$95$1 * z), $MachinePrecision]), $MachinePrecision] + N[((-N[(x + y), $MachinePrecision]) / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -4.8e-211], t$95$2, If[LessEqual[z, 1.45e-83], N[(N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] / a), $MachinePrecision] / t$95$1), $MachinePrecision] - N[(N[(b / a), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision] + N[((-N[(t + y), $MachinePrecision]) / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + t\\
t_2 := \left(\frac{t + y}{t\_1} \cdot \frac{a}{z} - \mathsf{fma}\left(y, \frac{b}{t\_1 \cdot z}, \frac{-\left(x + y\right)}{t\_1}\right)\right) \cdot z\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{-211}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-83}:\\
\;\;\;\;\left(\frac{\frac{\left(x + y\right) \cdot z}{a}}{t\_1} - \mathsf{fma}\left(\frac{b}{a}, \frac{y}{t\_1}, \frac{-\left(t + y\right)}{t\_1}\right)\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.8000000000000004e-211 or 1.45e-83 < z Initial program 54.6%
lift-/.f64N/A
frac-2negN/A
div-invN/A
lower-*.f64N/A
Applied rewrites54.8%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites94.8%
Applied rewrites93.8%
if -4.8000000000000004e-211 < z < 1.45e-83Initial program 75.2%
lift-/.f64N/A
frac-2negN/A
div-invN/A
lower-*.f64N/A
Applied rewrites74.9%
Taylor expanded in a around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites83.2%
Final simplification90.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.02e+129)
(fma t (/ (- a z) x) z)
(if (<= x 4.4e+140)
(fma y (/ (- z b) (+ t y)) a)
(* (/ (+ x y) (+ (+ x y) t)) z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.02e+129) {
tmp = fma(t, ((a - z) / x), z);
} else if (x <= 4.4e+140) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else {
tmp = ((x + y) / ((x + y) + t)) * z;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.02e+129) tmp = fma(t, Float64(Float64(a - z) / x), z); elseif (x <= 4.4e+140) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); else tmp = Float64(Float64(Float64(x + y) / Float64(Float64(x + y) + t)) * z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.02e+129], N[(t * N[(N[(a - z), $MachinePrecision] / x), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[x, 4.4e+140], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(N[(N[(x + y), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{+129}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{a - z}{x}, z\right)\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y}{\left(x + y\right) + t} \cdot z\\
\end{array}
\end{array}
if x < -1.01999999999999996e129Initial program 43.7%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites83.2%
Taylor expanded in y around 0
Applied rewrites69.0%
if -1.01999999999999996e129 < x < 4.3999999999999997e140Initial program 64.6%
Taylor expanded in x around 0
lower-/.f64N/A
associate--l+N/A
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
distribute-lft-out--N/A
distribute-lft-inN/A
associate--l+N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6445.9
Applied rewrites45.9%
Taylor expanded in a around 0
Applied rewrites76.1%
if 4.3999999999999997e140 < x Initial program 62.4%
Taylor expanded in z around inf
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6444.3
Applied rewrites44.3%
Applied rewrites66.5%
Final simplification73.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma t (/ (- a z) x) z)))
(if (<= x -1.02e+129)
t_1
(if (<= x 1.34e+132) (fma y (/ (- z b) (+ t y)) a) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, ((a - z) / x), z);
double tmp;
if (x <= -1.02e+129) {
tmp = t_1;
} else if (x <= 1.34e+132) {
tmp = fma(y, ((z - b) / (t + y)), a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(t, Float64(Float64(a - z) / x), z) tmp = 0.0 if (x <= -1.02e+129) tmp = t_1; elseif (x <= 1.34e+132) tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(N[(a - z), $MachinePrecision] / x), $MachinePrecision] + z), $MachinePrecision]}, If[LessEqual[x, -1.02e+129], t$95$1, If[LessEqual[x, 1.34e+132], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, \frac{a - z}{x}, z\right)\\
\mathbf{if}\;x \leq -1.02 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.34 \cdot 10^{+132}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.01999999999999996e129 or 1.34000000000000002e132 < x Initial program 51.7%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites85.4%
Taylor expanded in y around 0
Applied rewrites63.3%
if -1.01999999999999996e129 < x < 1.34000000000000002e132Initial program 64.9%
Taylor expanded in x around 0
lower-/.f64N/A
associate--l+N/A
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
distribute-lft-out--N/A
distribute-lft-inN/A
associate--l+N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6446.2
Applied rewrites46.2%
Taylor expanded in a around 0
Applied rewrites76.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma t (/ (- a z) x) z))) (if (<= x -1.02e+129) t_1 (if (<= x 9.2e+135) (- (+ a z) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(t, ((a - z) / x), z);
double tmp;
if (x <= -1.02e+129) {
tmp = t_1;
} else if (x <= 9.2e+135) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(t, Float64(Float64(a - z) / x), z) tmp = 0.0 if (x <= -1.02e+129) tmp = t_1; elseif (x <= 9.2e+135) tmp = Float64(Float64(a + z) - b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(N[(a - z), $MachinePrecision] / x), $MachinePrecision] + z), $MachinePrecision]}, If[LessEqual[x, -1.02e+129], t$95$1, If[LessEqual[x, 9.2e+135], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t, \frac{a - z}{x}, z\right)\\
\mathbf{if}\;x \leq -1.02 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{+135}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.01999999999999996e129 or 9.2000000000000005e135 < x Initial program 51.7%
Taylor expanded in t around 0
sub-negN/A
+-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
Applied rewrites85.4%
Taylor expanded in y around 0
Applied rewrites63.3%
if -1.01999999999999996e129 < x < 9.2000000000000005e135Initial program 64.9%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6470.2
Applied rewrites70.2%
Final simplification67.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* -1.0 (- z)))) (if (<= x -8.5e+227) t_1 (if (<= x 1.06e+142) (- (+ a z) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -1.0 * -z;
double tmp;
if (x <= -8.5e+227) {
tmp = t_1;
} else if (x <= 1.06e+142) {
tmp = (a + 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) * -z
if (x <= (-8.5d+227)) then
tmp = t_1
else if (x <= 1.06d+142) then
tmp = (a + 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 * -z;
double tmp;
if (x <= -8.5e+227) {
tmp = t_1;
} else if (x <= 1.06e+142) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -1.0 * -z tmp = 0 if x <= -8.5e+227: tmp = t_1 elif x <= 1.06e+142: tmp = (a + z) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(-1.0 * Float64(-z)) tmp = 0.0 if (x <= -8.5e+227) tmp = t_1; elseif (x <= 1.06e+142) tmp = Float64(Float64(a + z) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -1.0 * -z; tmp = 0.0; if (x <= -8.5e+227) tmp = t_1; elseif (x <= 1.06e+142) tmp = (a + 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 * (-z)), $MachinePrecision]}, If[LessEqual[x, -8.5e+227], t$95$1, If[LessEqual[x, 1.06e+142], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -1 \cdot \left(-z\right)\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{+227}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.06 \cdot 10^{+142}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -8.4999999999999995e227 or 1.06e142 < x Initial program 54.3%
lift-/.f64N/A
frac-2negN/A
div-invN/A
lower-*.f64N/A
Applied rewrites54.5%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
Applied rewrites79.3%
Taylor expanded in x around inf
Applied rewrites61.4%
if -8.4999999999999995e227 < x < 1.06e142Initial program 62.3%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6466.8
Applied rewrites66.8%
Final simplification65.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (- (+ a z) b))) (if (<= y -1e-38) t_1 (if (<= y 4e-34) (+ a z) 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-38) {
tmp = t_1;
} else if (y <= 4e-34) {
tmp = a + z;
} 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 = (a + z) - b
if (y <= (-1d-38)) then
tmp = t_1
else if (y <= 4d-34) then
tmp = a + z
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 = (a + z) - b;
double tmp;
if (y <= -1e-38) {
tmp = t_1;
} else if (y <= 4e-34) {
tmp = a + z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + z) - b tmp = 0 if y <= -1e-38: tmp = t_1 elif y <= 4e-34: tmp = a + z 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-38) tmp = t_1; elseif (y <= 4e-34) tmp = Float64(a + z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + z) - b; tmp = 0.0; if (y <= -1e-38) tmp = t_1; elseif (y <= 4e-34) tmp = a + z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1e-38], t$95$1, If[LessEqual[y, 4e-34], N[(a + z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -1 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-34}:\\
\;\;\;\;a + z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.9999999999999996e-39 or 3.99999999999999971e-34 < y Initial program 52.2%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6469.3
Applied rewrites69.3%
if -9.9999999999999996e-39 < y < 3.99999999999999971e-34Initial program 71.8%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6439.6
Applied rewrites39.6%
Taylor expanded in b around 0
Applied rewrites48.5%
Final simplification60.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.3e-19) (+ a z) (if (<= z 1.02e-66) (- a b) (+ a z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.3e-19) {
tmp = a + z;
} else if (z <= 1.02e-66) {
tmp = a - b;
} else {
tmp = a + z;
}
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 <= (-2.3d-19)) then
tmp = a + z
else if (z <= 1.02d-66) then
tmp = a - b
else
tmp = a + z
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 <= -2.3e-19) {
tmp = a + z;
} else if (z <= 1.02e-66) {
tmp = a - b;
} else {
tmp = a + z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.3e-19: tmp = a + z elif z <= 1.02e-66: tmp = a - b else: tmp = a + z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.3e-19) tmp = Float64(a + z); elseif (z <= 1.02e-66) tmp = Float64(a - b); else tmp = Float64(a + z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.3e-19) tmp = a + z; elseif (z <= 1.02e-66) tmp = a - b; else tmp = a + z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.3e-19], N[(a + z), $MachinePrecision], If[LessEqual[z, 1.02e-66], N[(a - b), $MachinePrecision], N[(a + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-19}:\\
\;\;\;\;a + z\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-66}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;a + z\\
\end{array}
\end{array}
if z < -2.2999999999999998e-19 or 1.01999999999999996e-66 < z Initial program 50.0%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6462.4
Applied rewrites62.4%
Taylor expanded in b around 0
Applied rewrites62.2%
if -2.2999999999999998e-19 < z < 1.01999999999999996e-66Initial program 75.2%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6449.5
Applied rewrites49.5%
Taylor expanded in z around 0
Applied rewrites48.6%
Final simplification56.6%
(FPCore (x y z t a b) :precision binary64 (+ a z))
double code(double x, double y, double z, double t, double a, double b) {
return a + z;
}
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 + z
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a + z;
}
def code(x, y, z, t, a, b): return a + z
function code(x, y, z, t, a, b) return Float64(a + z) end
function tmp = code(x, y, z, t, a, b) tmp = a + z; end
code[x_, y_, z_, t_, a_, b_] := N[(a + z), $MachinePrecision]
\begin{array}{l}
\\
a + z
\end{array}
Initial program 60.2%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6457.1
Applied rewrites57.1%
Taylor expanded in b around 0
Applied rewrites53.0%
Final simplification53.0%
(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 60.2%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f6457.1
Applied rewrites57.1%
Taylor expanded in b around inf
Applied rewrites12.5%
(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 2024273
(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)))