
(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 14 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 (* a (+ y t)))
(t_2 (+ x (+ y t)))
(t_3 (/ (- (+ (* (+ x y) z) t_1) (* y b)) (+ y (+ x t)))))
(if (<= t_3 (- INFINITY))
(fma y (/ (- z b) (+ y t)) a)
(if (<= t_3 2e+259)
(- (/ (fma (+ x y) z t_1) t_2) (/ (* y b) t_2))
(fma (+ y t) (/ a (+ (+ x y) t)) (- z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = x + (y + t);
double t_3 = ((((x + y) * z) + t_1) - (y * b)) / (y + (x + t));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = fma(y, ((z - b) / (y + t)), a);
} else if (t_3 <= 2e+259) {
tmp = (fma((x + y), z, t_1) / t_2) - ((y * b) / t_2);
} else {
tmp = fma((y + t), (a / ((x + y) + t)), (z - b));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(x + Float64(y + t)) t_3 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + t_1) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = fma(y, Float64(Float64(z - b) / Float64(y + t)), a); elseif (t_3 <= 2e+259) tmp = Float64(Float64(fma(Float64(x + y), z, t_1) / t_2) - Float64(Float64(y * b) / t_2)); else tmp = fma(Float64(y + t), Float64(a / Float64(Float64(x + y) + t)), Float64(z - b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(y * N[(N[(z - b), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$3, 2e+259], N[(N[(N[(N[(x + y), $MachinePrecision] * z + t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(y + t), $MachinePrecision] * N[(a / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := x + \left(y + t\right)\\
t_3 := \frac{\left(\left(x + y\right) \cdot z + t\_1\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+259}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x + y, z, t\_1\right)}{t\_2} - \frac{y \cdot b}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y + t, \frac{a}{\left(x + y\right) + t}, z - b\right)\\
\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.8%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Simplified56.2%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6488.2
Simplified88.2%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2e259Initial program 98.4%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
div-subN/A
lower--.f64N/A
Applied egg-rr98.4%
if 2e259 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.7%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Simplified31.2%
Taylor expanded in y around inf
lower--.f6480.6
Simplified80.6%
Final simplification92.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* a (+ y t))) (* y b)) (+ y (+ x t)))))
(if (<= t_1 (- INFINITY))
(fma y (/ (- z b) (+ y t)) a)
(if (<= t_1 2e+259) t_1 (fma (+ y t) (/ a (+ (+ x y) t)) (- z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma(y, ((z - b) / (y + t)), a);
} else if (t_1 <= 2e+259) {
tmp = t_1;
} else {
tmp = fma((y + t), (a / ((x + y) + t)), (z - b));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = fma(y, Float64(Float64(z - b) / Float64(y + t)), a); elseif (t_1 <= 2e+259) tmp = t_1; else tmp = fma(Float64(y + t), Float64(a / Float64(Float64(x + y) + t)), Float64(z - b)); 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[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(N[(z - b), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$1, 2e+259], t$95$1, N[(N[(y + t), $MachinePrecision] * N[(a / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+259}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y + t, \frac{a}{\left(x + y\right) + t}, z - b\right)\\
\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.8%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Simplified56.2%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6488.2
Simplified88.2%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2e259Initial program 98.4%
if 2e259 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.7%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Simplified31.2%
Taylor expanded in y around inf
lower--.f6480.6
Simplified80.6%
Final simplification92.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (/ y (+ y t)) (- b) a)))
(if (<= b -8.9e+52)
t_1
(if (<= b -3e-260)
(fma y (/ z (+ y t)) a)
(if (<= b 1.3e+58) (+ z a) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((y / (y + t)), -b, a);
double tmp;
if (b <= -8.9e+52) {
tmp = t_1;
} else if (b <= -3e-260) {
tmp = fma(y, (z / (y + t)), a);
} else if (b <= 1.3e+58) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(y / Float64(y + t)), Float64(-b), a) tmp = 0.0 if (b <= -8.9e+52) tmp = t_1; elseif (b <= -3e-260) tmp = fma(y, Float64(z / Float64(y + t)), a); elseif (b <= 1.3e+58) 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[(y / N[(y + t), $MachinePrecision]), $MachinePrecision] * (-b) + a), $MachinePrecision]}, If[LessEqual[b, -8.9e+52], t$95$1, If[LessEqual[b, -3e-260], N[(y * N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[b, 1.3e+58], N[(z + a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{y + t}, -b, a\right)\\
\mathbf{if}\;b \leq -8.9 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -3 \cdot 10^{-260}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{y + t}, a\right)\\
\mathbf{elif}\;b \leq 1.3 \cdot 10^{+58}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -8.89999999999999994e52 or 1.29999999999999994e58 < b Initial program 57.4%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Simplified63.2%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6462.5
Simplified62.5%
Taylor expanded in z around 0
mul-1-negN/A
+-commutativeN/A
*-commutativeN/A
associate-*l/N/A
distribute-lft-neg-outN/A
mul-1-negN/A
*-commutativeN/A
associate-*l*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6456.6
Simplified56.6%
if -8.89999999999999994e52 < b < -3.0000000000000001e-260Initial program 58.8%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Simplified76.5%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6482.2
Simplified82.2%
Taylor expanded in b around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6476.1
Simplified76.1%
if -3.0000000000000001e-260 < b < 1.29999999999999994e58Initial program 59.9%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6470.2
Simplified70.2%
Taylor expanded in b around 0
lower-+.f6473.7
Simplified73.7%
Final simplification67.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma y (- (/ b (+ y t))) a)))
(if (<= b -6.5e+27)
t_1
(if (<= b -3e-260)
(fma y (/ z (+ y t)) a)
(if (<= b 1.3e+58) (+ z a) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(y, -(b / (y + t)), a);
double tmp;
if (b <= -6.5e+27) {
tmp = t_1;
} else if (b <= -3e-260) {
tmp = fma(y, (z / (y + t)), a);
} else if (b <= 1.3e+58) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(y, Float64(-Float64(b / Float64(y + t))), a) tmp = 0.0 if (b <= -6.5e+27) tmp = t_1; elseif (b <= -3e-260) tmp = fma(y, Float64(z / Float64(y + t)), a); elseif (b <= 1.3e+58) tmp = Float64(z + a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * (-N[(b / N[(y + t), $MachinePrecision]), $MachinePrecision]) + a), $MachinePrecision]}, If[LessEqual[b, -6.5e+27], t$95$1, If[LessEqual[b, -3e-260], N[(y * N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[b, 1.3e+58], N[(z + a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, -\frac{b}{y + t}, a\right)\\
\mathbf{if}\;b \leq -6.5 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -3 \cdot 10^{-260}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{y + t}, a\right)\\
\mathbf{elif}\;b \leq 1.3 \cdot 10^{+58}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -6.5000000000000005e27 or 1.29999999999999994e58 < b Initial program 57.8%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Simplified64.3%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6462.6
Simplified62.6%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6455.7
Simplified55.7%
if -6.5000000000000005e27 < b < -3.0000000000000001e-260Initial program 58.4%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Simplified75.5%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6482.9
Simplified82.9%
Taylor expanded in b around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6476.5
Simplified76.5%
if -3.0000000000000001e-260 < b < 1.29999999999999994e58Initial program 59.9%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6470.2
Simplified70.2%
Taylor expanded in b around 0
lower-+.f6473.7
Simplified73.7%
Final simplification67.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma a (/ (+ y t) (+ y (+ x t))) z)))
(if (<= x -6.6e+61)
t_1
(if (<= x 2.1e+94) (fma y (/ (- z b) (+ y t)) a) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(a, ((y + t) / (y + (x + t))), z);
double tmp;
if (x <= -6.6e+61) {
tmp = t_1;
} else if (x <= 2.1e+94) {
tmp = fma(y, ((z - b) / (y + t)), a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(a, Float64(Float64(y + t) / Float64(y + Float64(x + t))), z) tmp = 0.0 if (x <= -6.6e+61) tmp = t_1; elseif (x <= 2.1e+94) tmp = fma(y, Float64(Float64(z - b) / Float64(y + t)), a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]}, If[LessEqual[x, -6.6e+61], t$95$1, If[LessEqual[x, 2.1e+94], N[(y * N[(N[(z - b), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, \frac{y + t}{y + \left(x + t\right)}, z\right)\\
\mathbf{if}\;x \leq -6.6 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.5999999999999995e61 or 2.09999999999999989e94 < x Initial program 53.5%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Simplified60.2%
Taylor expanded in y around inf
lower--.f6461.3
Simplified61.3%
Taylor expanded in b around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6480.9
Simplified80.9%
if -6.5999999999999995e61 < x < 2.09999999999999989e94Initial program 60.7%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Simplified75.2%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6483.3
Simplified83.3%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.02e+116) z (if (<= x 3.3e+192) (fma y (/ (- z b) (+ y t)) a) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.02e+116) {
tmp = z;
} else if (x <= 3.3e+192) {
tmp = fma(y, ((z - b) / (y + t)), a);
} else {
tmp = z;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.02e+116) tmp = z; elseif (x <= 3.3e+192) tmp = fma(y, Float64(Float64(z - b) / Float64(y + t)), a); else tmp = z; end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.02e+116], z, If[LessEqual[x, 3.3e+192], N[(y * N[(N[(z - b), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{+116}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+192}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.0199999999999999e116 or 3.3000000000000001e192 < x Initial program 50.0%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Simplified73.1%
Taylor expanded in x around inf
Simplified62.1%
if -1.0199999999999999e116 < x < 3.3000000000000001e192Initial program 60.4%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Simplified75.1%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6479.0
Simplified79.0%
Final simplification76.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (- (+ z a) b))) (if (<= y -8.3e-128) t_1 (if (<= y 8e-238) (fma z (/ x t) a) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -8.3e-128) {
tmp = t_1;
} else if (y <= 8e-238) {
tmp = fma(z, (x / t), a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -8.3e-128) tmp = t_1; elseif (y <= 8e-238) tmp = fma(z, Float64(x / t), a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -8.3e-128], t$95$1, If[LessEqual[y, 8e-238], N[(z * N[(x / t), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -8.3 \cdot 10^{-128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-238}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{x}{t}, a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.30000000000000015e-128 or 7.9999999999999999e-238 < y Initial program 55.9%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6463.4
Simplified63.4%
if -8.30000000000000015e-128 < y < 7.9999999999999999e-238Initial program 69.2%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Simplified58.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6461.3
Simplified61.3%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
lower-fma.f64N/A
lower-/.f6459.7
Simplified59.7%
Final simplification62.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t 6.3e+53) (- (+ z a) b) (fma y (/ z (+ y t)) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 6.3e+53) {
tmp = (z + a) - b;
} else {
tmp = fma(y, (z / (y + t)), a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 6.3e+53) tmp = Float64(Float64(z + a) - b); else tmp = fma(y, Float64(z / Float64(y + t)), a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 6.3e+53], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(y * N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6.3 \cdot 10^{+53}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{y + t}, a\right)\\
\end{array}
\end{array}
if t < 6.29999999999999974e53Initial program 62.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6457.8
Simplified57.8%
if 6.29999999999999974e53 < t Initial program 47.7%
Taylor expanded in b around 0
mul-1-negN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-/l*N/A
sub-negN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
Simplified60.4%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f6486.1
Simplified86.1%
Taylor expanded in b around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6478.5
Simplified78.5%
Final simplification63.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t 7e+77) (- (+ z a) b) (fma y (/ z t) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 7e+77) {
tmp = (z + a) - b;
} else {
tmp = fma(y, (z / t), a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 7e+77) tmp = Float64(Float64(z + a) - b); else tmp = fma(y, Float64(z / t), a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 7e+77], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7 \cdot 10^{+77}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{t}, a\right)\\
\end{array}
\end{array}
if t < 7.0000000000000003e77Initial program 63.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6458.1
Simplified58.1%
if 7.0000000000000003e77 < t Initial program 45.9%
Taylor expanded in t around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Simplified51.9%
Taylor expanded in x around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6471.7
Simplified71.7%
Taylor expanded in b around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6466.7
Simplified66.7%
Final simplification60.3%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.6e+59) (+ z a) (if (<= x 1.1e+173) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.6e+59) {
tmp = z + a;
} else if (x <= 1.1e+173) {
tmp = (z + a) - b;
} else {
tmp = 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 (x <= (-2.6d+59)) then
tmp = z + a
else if (x <= 1.1d+173) then
tmp = (z + a) - b
else
tmp = 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 (x <= -2.6e+59) {
tmp = z + a;
} else if (x <= 1.1e+173) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.6e+59: tmp = z + a elif x <= 1.1e+173: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.6e+59) tmp = Float64(z + a); elseif (x <= 1.1e+173) tmp = Float64(Float64(z + a) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.6e+59) tmp = z + a; elseif (x <= 1.1e+173) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.6e+59], N[(z + a), $MachinePrecision], If[LessEqual[x, 1.1e+173], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+59}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+173}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -2.59999999999999999e59Initial program 54.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6439.0
Simplified39.0%
Taylor expanded in b around 0
lower-+.f6454.8
Simplified54.8%
if -2.59999999999999999e59 < x < 1.1e173Initial program 59.9%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6462.6
Simplified62.6%
if 1.1e173 < x Initial program 54.0%
Taylor expanded in z around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Simplified68.7%
Taylor expanded in x around inf
Simplified69.7%
Final simplification61.8%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.1e-140) (+ z a) (if (<= z 5.2e-38) (- a b) (+ z a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.1e-140) {
tmp = z + a;
} else if (z <= 5.2e-38) {
tmp = a - 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 (z <= (-2.1d-140)) then
tmp = z + a
else if (z <= 5.2d-38) then
tmp = a - 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 (z <= -2.1e-140) {
tmp = z + a;
} else if (z <= 5.2e-38) {
tmp = a - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.1e-140: tmp = z + a elif z <= 5.2e-38: tmp = a - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.1e-140) tmp = Float64(z + a); elseif (z <= 5.2e-38) tmp = Float64(a - b); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.1e-140) tmp = z + a; elseif (z <= 5.2e-38) tmp = a - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.1e-140], N[(z + a), $MachinePrecision], If[LessEqual[z, 5.2e-38], N[(a - b), $MachinePrecision], N[(z + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-140}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-38}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if z < -2.10000000000000017e-140 or 5.20000000000000022e-38 < z Initial program 57.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.7
Simplified55.7%
Taylor expanded in b around 0
lower-+.f6458.2
Simplified58.2%
if -2.10000000000000017e-140 < z < 5.20000000000000022e-38Initial program 60.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6460.4
Simplified60.4%
Taylor expanded in z around 0
lower--.f6460.0
Simplified60.0%
Final simplification58.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.6e+59) (+ z a) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.6e+59) {
tmp = z + a;
} else {
tmp = (z + 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 <= (-2.6d+59)) then
tmp = z + a
else
tmp = (z + 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 <= -2.6e+59) {
tmp = z + a;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.6e+59: tmp = z + a else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.6e+59) tmp = Float64(z + a); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.6e+59) tmp = z + a; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.6e+59], N[(z + a), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+59}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -2.59999999999999999e59Initial program 54.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6439.0
Simplified39.0%
Taylor expanded in b around 0
lower-+.f6454.8
Simplified54.8%
if -2.59999999999999999e59 < x Initial program 59.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6460.9
Simplified60.9%
Final simplification59.9%
(FPCore (x y z t a b) :precision binary64 (+ z a))
double code(double x, double y, double z, double t, double a, double b) {
return z + 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 = z + a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z + a;
}
def code(x, y, z, t, a, b): return z + a
function code(x, y, z, t, a, b) return Float64(z + a) end
function tmp = code(x, y, z, t, a, b) tmp = z + a; end
code[x_, y_, z_, t_, a_, b_] := N[(z + a), $MachinePrecision]
\begin{array}{l}
\\
z + a
\end{array}
Initial program 58.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6457.3
Simplified57.3%
Taylor expanded in b around 0
lower-+.f6452.9
Simplified52.9%
Final simplification52.9%
(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 58.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6457.3
Simplified57.3%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6412.3
Simplified12.3%
(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 2024208
(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)))