
(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 15 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 (+ t y))) (t_2 (/ y t_1))) (+ (/ a (/ (+ (+ t x) y) (+ t y))) (- (* z (+ (/ x t_1) t_2)) (* t_2 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t + y);
double t_2 = y / t_1;
return (a / (((t + x) + y) / (t + y))) + ((z * ((x / t_1) + t_2)) - (t_2 * 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
real(8) :: t_1
real(8) :: t_2
t_1 = x + (t + y)
t_2 = y / t_1
code = (a / (((t + x) + y) / (t + y))) + ((z * ((x / t_1) + t_2)) - (t_2 * b))
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 = y / t_1;
return (a / (((t + x) + y) / (t + y))) + ((z * ((x / t_1) + t_2)) - (t_2 * b));
}
def code(x, y, z, t, a, b): t_1 = x + (t + y) t_2 = y / t_1 return (a / (((t + x) + y) / (t + y))) + ((z * ((x / t_1) + t_2)) - (t_2 * b))
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t + y)) t_2 = Float64(y / t_1) return Float64(Float64(a / Float64(Float64(Float64(t + x) + y) / Float64(t + y))) + Float64(Float64(z * Float64(Float64(x / t_1) + t_2)) - Float64(t_2 * b))) end
function tmp = code(x, y, z, t, a, b) t_1 = x + (t + y); t_2 = y / t_1; tmp = (a / (((t + x) + y) / (t + y))) + ((z * ((x / t_1) + t_2)) - (t_2 * b)); end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / t$95$1), $MachinePrecision]}, N[(N[(a / N[(N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(x / t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] - N[(t$95$2 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(t + y\right)\\
t_2 := \frac{y}{t_1}\\
\frac{a}{\frac{\left(t + x\right) + y}{t + y}} + \left(z \cdot \left(\frac{x}{t_1} + t_2\right) - t_2 \cdot b\right)
\end{array}
\end{array}
Initial program 63.0%
Taylor expanded in z around inf 63.0%
associate--l+63.0%
associate-/l*73.1%
associate-+r+73.1%
div-sub73.1%
+-commutative73.1%
*-commutative73.1%
associate-+r+73.1%
Simplified73.1%
Taylor expanded in z around 0 86.9%
+-commutative86.9%
fma-def86.9%
+-commutative86.9%
+-commutative86.9%
associate-+r+86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
associate-+r+86.9%
+-commutative86.9%
mul-1-neg86.9%
*-commutative86.9%
+-commutative86.9%
+-commutative86.9%
associate-+r+86.9%
associate-/l*97.0%
Simplified97.0%
fma-udef97.0%
associate-+r+97.0%
associate-+r+97.0%
associate-/r/99.4%
associate-+r+99.4%
Applied egg-rr99.4%
Final simplification99.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ x y)))
(t_2 (+ (+ t x) y))
(t_3 (/ (- (+ (* a (+ t y)) t_1) (* y b)) t_2))
(t_4 (/ a (/ t_2 (+ t y)))))
(if (or (<= t_3 (- INFINITY)) (not (<= t_3 4e+186)))
(+ t_4 (- z (* (/ y (+ x (+ t y))) b)))
(+ t_4 (/ (- t_1 (* y b)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x + y);
double t_2 = (t + x) + y;
double t_3 = (((a * (t + y)) + t_1) - (y * b)) / t_2;
double t_4 = a / (t_2 / (t + y));
double tmp;
if ((t_3 <= -((double) INFINITY)) || !(t_3 <= 4e+186)) {
tmp = t_4 + (z - ((y / (x + (t + y))) * b));
} else {
tmp = t_4 + ((t_1 - (y * b)) / t_2);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x + y);
double t_2 = (t + x) + y;
double t_3 = (((a * (t + y)) + t_1) - (y * b)) / t_2;
double t_4 = a / (t_2 / (t + y));
double tmp;
if ((t_3 <= -Double.POSITIVE_INFINITY) || !(t_3 <= 4e+186)) {
tmp = t_4 + (z - ((y / (x + (t + y))) * b));
} else {
tmp = t_4 + ((t_1 - (y * b)) / t_2);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (x + y) t_2 = (t + x) + y t_3 = (((a * (t + y)) + t_1) - (y * b)) / t_2 t_4 = a / (t_2 / (t + y)) tmp = 0 if (t_3 <= -math.inf) or not (t_3 <= 4e+186): tmp = t_4 + (z - ((y / (x + (t + y))) * b)) else: tmp = t_4 + ((t_1 - (y * b)) / t_2) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(x + y)) t_2 = Float64(Float64(t + x) + y) t_3 = Float64(Float64(Float64(Float64(a * Float64(t + y)) + t_1) - Float64(y * b)) / t_2) t_4 = Float64(a / Float64(t_2 / Float64(t + y))) tmp = 0.0 if ((t_3 <= Float64(-Inf)) || !(t_3 <= 4e+186)) tmp = Float64(t_4 + Float64(z - Float64(Float64(y / Float64(x + Float64(t + y))) * b))); else tmp = Float64(t_4 + Float64(Float64(t_1 - Float64(y * b)) / t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (x + y); t_2 = (t + x) + y; t_3 = (((a * (t + y)) + t_1) - (y * b)) / t_2; t_4 = a / (t_2 / (t + y)); tmp = 0.0; if ((t_3 <= -Inf) || ~((t_3 <= 4e+186))) tmp = t_4 + (z - ((y / (x + (t + y))) * b)); else tmp = t_4 + ((t_1 - (y * b)) / t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(a * N[(t + y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(a / N[(t$95$2 / N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$3, (-Infinity)], N[Not[LessEqual[t$95$3, 4e+186]], $MachinePrecision]], N[(t$95$4 + N[(z - N[(N[(y / N[(x + N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$4 + N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x + y\right)\\
t_2 := \left(t + x\right) + y\\
t_3 := \frac{\left(a \cdot \left(t + y\right) + t_1\right) - y \cdot b}{t_2}\\
t_4 := \frac{a}{\frac{t_2}{t + y}}\\
\mathbf{if}\;t_3 \leq -\infty \lor \neg \left(t_3 \leq 4 \cdot 10^{+186}\right):\\
\;\;\;\;t_4 + \left(z - \frac{y}{x + \left(t + y\right)} \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_4 + \frac{t_1 - y \cdot b}{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 3.99999999999999992e186 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 15.1%
Taylor expanded in z around inf 15.1%
associate--l+15.1%
associate-/l*38.2%
associate-+r+38.2%
div-sub38.2%
+-commutative38.2%
*-commutative38.2%
associate-+r+38.2%
Simplified38.2%
Taylor expanded in z around 0 70.3%
+-commutative70.3%
fma-def70.3%
+-commutative70.3%
+-commutative70.3%
associate-+r+70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
associate-+r+70.3%
+-commutative70.3%
mul-1-neg70.3%
*-commutative70.3%
+-commutative70.3%
+-commutative70.3%
associate-+r+70.3%
associate-/l*98.2%
Simplified98.2%
fma-udef98.2%
associate-+r+98.2%
associate-+r+98.2%
associate-/r/99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 96.5%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 3.99999999999999992e186Initial program 99.6%
Taylor expanded in z around inf 99.7%
associate--l+99.7%
associate-/l*99.8%
associate-+r+99.8%
div-sub99.8%
+-commutative99.8%
*-commutative99.8%
associate-+r+99.8%
Simplified99.8%
Final simplification98.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (/ (- (+ (* a (+ t y)) (* z (+ x y))) (* y b)) t_1)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 4e+186)))
(+ (/ a (/ t_1 (+ t y))) (- z (* (/ y (+ x (+ t y))) b)))
(/ (+ (* a t) (+ (* x z) (* y (- (+ a z) b)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = (((a * (t + y)) + (z * (x + y))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 4e+186)) {
tmp = (a / (t_1 / (t + y))) + (z - ((y / (x + (t + y))) * b));
} else {
tmp = ((a * t) + ((x * z) + (y * ((a + z) - b)))) / t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = (((a * (t + y)) + (z * (x + y))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 4e+186)) {
tmp = (a / (t_1 / (t + y))) + (z - ((y / (x + (t + y))) * b));
} else {
tmp = ((a * t) + ((x * z) + (y * ((a + z) - b)))) / t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t + x) + y t_2 = (((a * (t + y)) + (z * (x + y))) - (y * b)) / t_1 tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 4e+186): tmp = (a / (t_1 / (t + y))) + (z - ((y / (x + (t + y))) * b)) else: tmp = ((a * t) + ((x * z) + (y * ((a + z) - b)))) / t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(Float64(Float64(a * Float64(t + y)) + Float64(z * Float64(x + y))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 4e+186)) tmp = Float64(Float64(a / Float64(t_1 / Float64(t + y))) + Float64(z - Float64(Float64(y / Float64(x + Float64(t + y))) * b))); else tmp = Float64(Float64(Float64(a * t) + Float64(Float64(x * z) + Float64(y * Float64(Float64(a + z) - b)))) / t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t + x) + y; t_2 = (((a * (t + y)) + (z * (x + y))) - (y * b)) / t_1; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 4e+186))) tmp = (a / (t_1 / (t + y))) + (z - ((y / (x + (t + y))) * b)); else tmp = ((a * t) + ((x * z) + (y * ((a + z) - b)))) / t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(a * N[(t + y), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 4e+186]], $MachinePrecision]], N[(N[(a / N[(t$95$1 / N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z - N[(N[(y / N[(x + N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] + N[(y * N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \frac{\left(a \cdot \left(t + y\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{t_1}\\
\mathbf{if}\;t_2 \leq -\infty \lor \neg \left(t_2 \leq 4 \cdot 10^{+186}\right):\\
\;\;\;\;\frac{a}{\frac{t_1}{t + y}} + \left(z - \frac{y}{x + \left(t + y\right)} \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{a \cdot t + \left(x \cdot z + y \cdot \left(\left(a + z\right) - b\right)\right)}{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 3.99999999999999992e186 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 15.1%
Taylor expanded in z around inf 15.1%
associate--l+15.1%
associate-/l*38.2%
associate-+r+38.2%
div-sub38.2%
+-commutative38.2%
*-commutative38.2%
associate-+r+38.2%
Simplified38.2%
Taylor expanded in z around 0 70.3%
+-commutative70.3%
fma-def70.3%
+-commutative70.3%
+-commutative70.3%
associate-+r+70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
associate-+r+70.3%
+-commutative70.3%
mul-1-neg70.3%
*-commutative70.3%
+-commutative70.3%
+-commutative70.3%
associate-+r+70.3%
associate-/l*98.2%
Simplified98.2%
fma-udef98.2%
associate-+r+98.2%
associate-+r+98.2%
associate-/r/99.9%
associate-+r+99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 96.5%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 3.99999999999999992e186Initial program 99.6%
Taylor expanded in y around 0 99.6%
Final simplification98.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (/ (- (+ (* a (+ t y)) (* z (+ x y))) (* y b)) t_1))
(t_3 (- (+ a z) b)))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 2e+272)
(/ (+ (* a t) (+ (* x z) (* y t_3))) t_1)
(+ (/ a (/ t_1 (+ t y))) z)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = (((a * (t + y)) + (z * (x + y))) - (y * b)) / t_1;
double t_3 = (a + z) - b;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= 2e+272) {
tmp = ((a * t) + ((x * z) + (y * t_3))) / t_1;
} else {
tmp = (a / (t_1 / (t + y))) + z;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = (((a * (t + y)) + (z * (x + y))) - (y * b)) / t_1;
double t_3 = (a + z) - b;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_3;
} else if (t_2 <= 2e+272) {
tmp = ((a * t) + ((x * z) + (y * t_3))) / t_1;
} else {
tmp = (a / (t_1 / (t + y))) + z;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t + x) + y t_2 = (((a * (t + y)) + (z * (x + y))) - (y * b)) / t_1 t_3 = (a + z) - b tmp = 0 if t_2 <= -math.inf: tmp = t_3 elif t_2 <= 2e+272: tmp = ((a * t) + ((x * z) + (y * t_3))) / t_1 else: tmp = (a / (t_1 / (t + y))) + z return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(Float64(Float64(a * Float64(t + y)) + Float64(z * Float64(x + y))) - Float64(y * b)) / t_1) t_3 = Float64(Float64(a + z) - b) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= 2e+272) tmp = Float64(Float64(Float64(a * t) + Float64(Float64(x * z) + Float64(y * t_3))) / t_1); else tmp = Float64(Float64(a / Float64(t_1 / Float64(t + y))) + z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t + x) + y; t_2 = (((a * (t + y)) + (z * (x + y))) - (y * b)) / t_1; t_3 = (a + z) - b; tmp = 0.0; if (t_2 <= -Inf) tmp = t_3; elseif (t_2 <= 2e+272) tmp = ((a * t) + ((x * z) + (y * t_3))) / t_1; else tmp = (a / (t_1 / (t + y))) + z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(a * N[(t + y), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, 2e+272], N[(N[(N[(a * t), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] + N[(y * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(a / N[(t$95$1 / N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \frac{\left(a \cdot \left(t + y\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{t_1}\\
t_3 := \left(a + z\right) - b\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+272}:\\
\;\;\;\;\frac{a \cdot t + \left(x \cdot z + y \cdot t_3\right)}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{t_1}{t + y}} + z\\
\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.6%
Taylor expanded in y around inf 75.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)) < 2.0000000000000001e272Initial program 99.6%
Taylor expanded in y around 0 99.6%
if 2.0000000000000001e272 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 9.6%
Taylor expanded in z around inf 9.6%
associate--l+9.6%
associate-/l*36.2%
associate-+r+36.2%
div-sub36.2%
+-commutative36.2%
*-commutative36.2%
associate-+r+36.2%
Simplified36.2%
Taylor expanded in x around inf 80.3%
Final simplification91.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y))
(t_2 (+ (/ a (/ t_1 (+ t y))) z))
(t_3 (* (/ y t_1) (+ a (- z b))))
(t_4 (- a (/ (- (* y b) (* z (+ x y))) t_1))))
(if (<= y -6.2)
t_3
(if (<= y 1e-212)
t_2
(if (<= y 2.9e-86)
t_4
(if (<= y 2.4e-48) t_2 (if (<= y 3.05e+26) t_4 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double t_2 = (a / (t_1 / (t + y))) + z;
double t_3 = (y / t_1) * (a + (z - b));
double t_4 = a - (((y * b) - (z * (x + y))) / t_1);
double tmp;
if (y <= -6.2) {
tmp = t_3;
} else if (y <= 1e-212) {
tmp = t_2;
} else if (y <= 2.9e-86) {
tmp = t_4;
} else if (y <= 2.4e-48) {
tmp = t_2;
} else if (y <= 3.05e+26) {
tmp = t_4;
} else {
tmp = t_3;
}
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 = (t + x) + y
t_2 = (a / (t_1 / (t + y))) + z
t_3 = (y / t_1) * (a + (z - b))
t_4 = a - (((y * b) - (z * (x + y))) / t_1)
if (y <= (-6.2d0)) then
tmp = t_3
else if (y <= 1d-212) then
tmp = t_2
else if (y <= 2.9d-86) then
tmp = t_4
else if (y <= 2.4d-48) then
tmp = t_2
else if (y <= 3.05d+26) then
tmp = t_4
else
tmp = t_3
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 = (t + x) + y;
double t_2 = (a / (t_1 / (t + y))) + z;
double t_3 = (y / t_1) * (a + (z - b));
double t_4 = a - (((y * b) - (z * (x + y))) / t_1);
double tmp;
if (y <= -6.2) {
tmp = t_3;
} else if (y <= 1e-212) {
tmp = t_2;
} else if (y <= 2.9e-86) {
tmp = t_4;
} else if (y <= 2.4e-48) {
tmp = t_2;
} else if (y <= 3.05e+26) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t + x) + y t_2 = (a / (t_1 / (t + y))) + z t_3 = (y / t_1) * (a + (z - b)) t_4 = a - (((y * b) - (z * (x + y))) / t_1) tmp = 0 if y <= -6.2: tmp = t_3 elif y <= 1e-212: tmp = t_2 elif y <= 2.9e-86: tmp = t_4 elif y <= 2.4e-48: tmp = t_2 elif y <= 3.05e+26: tmp = t_4 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) t_2 = Float64(Float64(a / Float64(t_1 / Float64(t + y))) + z) t_3 = Float64(Float64(y / t_1) * Float64(a + Float64(z - b))) t_4 = Float64(a - Float64(Float64(Float64(y * b) - Float64(z * Float64(x + y))) / t_1)) tmp = 0.0 if (y <= -6.2) tmp = t_3; elseif (y <= 1e-212) tmp = t_2; elseif (y <= 2.9e-86) tmp = t_4; elseif (y <= 2.4e-48) tmp = t_2; elseif (y <= 3.05e+26) tmp = t_4; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t + x) + y; t_2 = (a / (t_1 / (t + y))) + z; t_3 = (y / t_1) * (a + (z - b)); t_4 = a - (((y * b) - (z * (x + y))) / t_1); tmp = 0.0; if (y <= -6.2) tmp = t_3; elseif (y <= 1e-212) tmp = t_2; elseif (y <= 2.9e-86) tmp = t_4; elseif (y <= 2.4e-48) tmp = t_2; elseif (y <= 3.05e+26) tmp = t_4; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a / N[(t$95$1 / N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y / t$95$1), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(a - N[(N[(N[(y * b), $MachinePrecision] - N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2], t$95$3, If[LessEqual[y, 1e-212], t$95$2, If[LessEqual[y, 2.9e-86], t$95$4, If[LessEqual[y, 2.4e-48], t$95$2, If[LessEqual[y, 3.05e+26], t$95$4, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
t_2 := \frac{a}{\frac{t_1}{t + y}} + z\\
t_3 := \frac{y}{t_1} \cdot \left(a + \left(z - b\right)\right)\\
t_4 := a - \frac{y \cdot b - z \cdot \left(x + y\right)}{t_1}\\
\mathbf{if}\;y \leq -6.2:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 10^{-212}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-86}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-48}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 3.05 \cdot 10^{+26}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y < -6.20000000000000018 or 3.0500000000000001e26 < y Initial program 48.1%
Taylor expanded in y around inf 41.9%
expm1-log1p-u27.3%
expm1-udef13.6%
associate-/l*37.4%
+-commutative37.4%
associate--l+37.4%
Applied egg-rr37.4%
expm1-def47.5%
expm1-log1p81.9%
associate-/r/85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
if -6.20000000000000018 < y < 9.99999999999999954e-213 or 2.8999999999999999e-86 < y < 2.4e-48Initial program 76.0%
Taylor expanded in z around inf 76.0%
associate--l+76.0%
associate-/l*85.9%
associate-+r+85.9%
div-sub85.9%
+-commutative85.9%
*-commutative85.9%
associate-+r+85.9%
Simplified85.9%
Taylor expanded in x around inf 79.4%
if 9.99999999999999954e-213 < y < 2.8999999999999999e-86 or 2.4e-48 < y < 3.0500000000000001e26Initial program 76.8%
Taylor expanded in z around inf 76.9%
associate--l+76.9%
associate-/l*90.2%
associate-+r+90.2%
div-sub90.2%
+-commutative90.2%
*-commutative90.2%
associate-+r+90.2%
Simplified90.2%
Taylor expanded in t around inf 79.8%
Final simplification82.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ y (+ (+ t x) y)) (+ a (- z b)))))
(if (<= y -8.2e-11)
t_1
(if (<= y -1.66e-75)
(+ a (/ x (/ t z)))
(if (<= y -3.7e-97)
z
(if (<= y 7.4e-76) (/ (+ (* a t) (* x z)) (+ t x)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y / ((t + x) + y)) * (a + (z - b));
double tmp;
if (y <= -8.2e-11) {
tmp = t_1;
} else if (y <= -1.66e-75) {
tmp = a + (x / (t / z));
} else if (y <= -3.7e-97) {
tmp = z;
} else if (y <= 7.4e-76) {
tmp = ((a * t) + (x * z)) / (t + x);
} 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 = (y / ((t + x) + y)) * (a + (z - b))
if (y <= (-8.2d-11)) then
tmp = t_1
else if (y <= (-1.66d-75)) then
tmp = a + (x / (t / z))
else if (y <= (-3.7d-97)) then
tmp = z
else if (y <= 7.4d-76) then
tmp = ((a * t) + (x * z)) / (t + x)
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 = (y / ((t + x) + y)) * (a + (z - b));
double tmp;
if (y <= -8.2e-11) {
tmp = t_1;
} else if (y <= -1.66e-75) {
tmp = a + (x / (t / z));
} else if (y <= -3.7e-97) {
tmp = z;
} else if (y <= 7.4e-76) {
tmp = ((a * t) + (x * z)) / (t + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y / ((t + x) + y)) * (a + (z - b)) tmp = 0 if y <= -8.2e-11: tmp = t_1 elif y <= -1.66e-75: tmp = a + (x / (t / z)) elif y <= -3.7e-97: tmp = z elif y <= 7.4e-76: tmp = ((a * t) + (x * z)) / (t + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y / Float64(Float64(t + x) + y)) * Float64(a + Float64(z - b))) tmp = 0.0 if (y <= -8.2e-11) tmp = t_1; elseif (y <= -1.66e-75) tmp = Float64(a + Float64(x / Float64(t / z))); elseif (y <= -3.7e-97) tmp = z; elseif (y <= 7.4e-76) tmp = Float64(Float64(Float64(a * t) + Float64(x * z)) / Float64(t + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y / ((t + x) + y)) * (a + (z - b)); tmp = 0.0; if (y <= -8.2e-11) tmp = t_1; elseif (y <= -1.66e-75) tmp = a + (x / (t / z)); elseif (y <= -3.7e-97) tmp = z; elseif (y <= 7.4e-76) tmp = ((a * t) + (x * z)) / (t + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.2e-11], t$95$1, If[LessEqual[y, -1.66e-75], N[(a + N[(x / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.7e-97], z, If[LessEqual[y, 7.4e-76], N[(N[(N[(a * t), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{\left(t + x\right) + y} \cdot \left(a + \left(z - b\right)\right)\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.66 \cdot 10^{-75}:\\
\;\;\;\;a + \frac{x}{\frac{t}{z}}\\
\mathbf{elif}\;y \leq -3.7 \cdot 10^{-97}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-76}:\\
\;\;\;\;\frac{a \cdot t + x \cdot z}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -8.2000000000000001e-11 or 7.40000000000000023e-76 < y Initial program 53.7%
Taylor expanded in y around inf 44.6%
expm1-log1p-u29.1%
expm1-udef16.5%
associate-/l*36.2%
+-commutative36.2%
associate--l+36.2%
Applied egg-rr36.2%
expm1-def45.9%
expm1-log1p77.6%
associate-/r/80.6%
+-commutative80.6%
+-commutative80.6%
Simplified80.6%
if -8.2000000000000001e-11 < y < -1.66e-75Initial program 61.6%
Taylor expanded in t around -inf 52.5%
mul-1-neg52.5%
Simplified52.5%
Taylor expanded in z around inf 65.8%
mul-1-neg65.8%
associate-/l*73.7%
distribute-neg-frac73.7%
+-commutative73.7%
Simplified73.7%
Taylor expanded in y around 0 73.7%
mul-1-neg73.7%
associate-/l*81.7%
distribute-neg-frac81.7%
Simplified81.7%
if -1.66e-75 < y < -3.69999999999999976e-97Initial program 62.2%
Taylor expanded in x around inf 100.0%
if -3.69999999999999976e-97 < y < 7.40000000000000023e-76Initial program 77.7%
Taylor expanded in y around 0 62.5%
Final simplification74.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -9e-9)
(/ y (/ (+ t y) (+ a (- z b))))
(if (<= y -1.35e-75)
(+ a (/ x (/ t z)))
(if (<= y -3.7e-97)
z
(if (<= y 3.2e-131) (/ (+ (* a t) (* x z)) (+ t x)) (- (+ a z) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -9e-9) {
tmp = y / ((t + y) / (a + (z - b)));
} else if (y <= -1.35e-75) {
tmp = a + (x / (t / z));
} else if (y <= -3.7e-97) {
tmp = z;
} else if (y <= 3.2e-131) {
tmp = ((a * t) + (x * z)) / (t + x);
} else {
tmp = (a + z) - 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 (y <= (-9d-9)) then
tmp = y / ((t + y) / (a + (z - b)))
else if (y <= (-1.35d-75)) then
tmp = a + (x / (t / z))
else if (y <= (-3.7d-97)) then
tmp = z
else if (y <= 3.2d-131) then
tmp = ((a * t) + (x * z)) / (t + x)
else
tmp = (a + z) - 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 (y <= -9e-9) {
tmp = y / ((t + y) / (a + (z - b)));
} else if (y <= -1.35e-75) {
tmp = a + (x / (t / z));
} else if (y <= -3.7e-97) {
tmp = z;
} else if (y <= 3.2e-131) {
tmp = ((a * t) + (x * z)) / (t + x);
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -9e-9: tmp = y / ((t + y) / (a + (z - b))) elif y <= -1.35e-75: tmp = a + (x / (t / z)) elif y <= -3.7e-97: tmp = z elif y <= 3.2e-131: tmp = ((a * t) + (x * z)) / (t + x) else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -9e-9) tmp = Float64(y / Float64(Float64(t + y) / Float64(a + Float64(z - b)))); elseif (y <= -1.35e-75) tmp = Float64(a + Float64(x / Float64(t / z))); elseif (y <= -3.7e-97) tmp = z; elseif (y <= 3.2e-131) tmp = Float64(Float64(Float64(a * t) + Float64(x * z)) / Float64(t + x)); else tmp = Float64(Float64(a + z) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -9e-9) tmp = y / ((t + y) / (a + (z - b))); elseif (y <= -1.35e-75) tmp = a + (x / (t / z)); elseif (y <= -3.7e-97) tmp = z; elseif (y <= 3.2e-131) tmp = ((a * t) + (x * z)) / (t + x); else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -9e-9], N[(y / N[(N[(t + y), $MachinePrecision] / N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.35e-75], N[(a + N[(x / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.7e-97], z, If[LessEqual[y, 3.2e-131], N[(N[(N[(a * t), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-9}:\\
\;\;\;\;\frac{y}{\frac{t + y}{a + \left(z - b\right)}}\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-75}:\\
\;\;\;\;a + \frac{x}{\frac{t}{z}}\\
\mathbf{elif}\;y \leq -3.7 \cdot 10^{-97}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-131}:\\
\;\;\;\;\frac{a \cdot t + x \cdot z}{t + x}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if y < -8.99999999999999953e-9Initial program 47.0%
Taylor expanded in y around inf 39.9%
Taylor expanded in x around 0 39.1%
associate-+r-39.1%
associate-/l*75.9%
+-commutative75.9%
+-commutative75.9%
Simplified75.9%
if -8.99999999999999953e-9 < y < -1.3499999999999999e-75Initial program 61.6%
Taylor expanded in t around -inf 52.5%
mul-1-neg52.5%
Simplified52.5%
Taylor expanded in z around inf 65.8%
mul-1-neg65.8%
associate-/l*73.7%
distribute-neg-frac73.7%
+-commutative73.7%
Simplified73.7%
Taylor expanded in y around 0 73.7%
mul-1-neg73.7%
associate-/l*81.7%
distribute-neg-frac81.7%
Simplified81.7%
if -1.3499999999999999e-75 < y < -3.69999999999999976e-97Initial program 62.2%
Taylor expanded in x around inf 100.0%
if -3.69999999999999976e-97 < y < 3.2e-131Initial program 81.6%
Taylor expanded in y around 0 66.9%
if 3.2e-131 < y Initial program 57.4%
Taylor expanded in y around inf 65.9%
Final simplification69.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ t x) y)))
(if (or (<= y -0.0029) (not (<= y 1.2e+17)))
(* (/ y t_1) (+ a (- z b)))
(+ (/ a (/ t_1 (+ t y))) z))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + x) + y;
double tmp;
if ((y <= -0.0029) || !(y <= 1.2e+17)) {
tmp = (y / t_1) * (a + (z - b));
} else {
tmp = (a / (t_1 / (t + y))) + 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) :: t_1
real(8) :: tmp
t_1 = (t + x) + y
if ((y <= (-0.0029d0)) .or. (.not. (y <= 1.2d+17))) then
tmp = (y / t_1) * (a + (z - b))
else
tmp = (a / (t_1 / (t + y))) + z
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 = (t + x) + y;
double tmp;
if ((y <= -0.0029) || !(y <= 1.2e+17)) {
tmp = (y / t_1) * (a + (z - b));
} else {
tmp = (a / (t_1 / (t + y))) + z;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t + x) + y tmp = 0 if (y <= -0.0029) or not (y <= 1.2e+17): tmp = (y / t_1) * (a + (z - b)) else: tmp = (a / (t_1 / (t + y))) + z return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + x) + y) tmp = 0.0 if ((y <= -0.0029) || !(y <= 1.2e+17)) tmp = Float64(Float64(y / t_1) * Float64(a + Float64(z - b))); else tmp = Float64(Float64(a / Float64(t_1 / Float64(t + y))) + z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t + x) + y; tmp = 0.0; if ((y <= -0.0029) || ~((y <= 1.2e+17))) tmp = (y / t_1) * (a + (z - b)); else tmp = (a / (t_1 / (t + y))) + z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]}, If[Or[LessEqual[y, -0.0029], N[Not[LessEqual[y, 1.2e+17]], $MachinePrecision]], N[(N[(y / t$95$1), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a / N[(t$95$1 / N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + x\right) + y\\
\mathbf{if}\;y \leq -0.0029 \lor \neg \left(y \leq 1.2 \cdot 10^{+17}\right):\\
\;\;\;\;\frac{y}{t_1} \cdot \left(a + \left(z - b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{t_1}{t + y}} + z\\
\end{array}
\end{array}
if y < -0.0029 or 1.2e17 < y Initial program 48.5%
Taylor expanded in y around inf 42.4%
expm1-log1p-u27.8%
expm1-udef14.3%
associate-/l*37.8%
+-commutative37.8%
associate--l+37.8%
Applied egg-rr37.8%
expm1-def47.8%
expm1-log1p82.0%
associate-/r/85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
if -0.0029 < y < 1.2e17Initial program 76.1%
Taylor expanded in z around inf 76.2%
associate--l+76.2%
associate-/l*87.4%
associate-+r+87.4%
div-sub87.4%
+-commutative87.4%
*-commutative87.4%
associate-+r+87.4%
Simplified87.4%
Taylor expanded in x around inf 71.1%
Final simplification78.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -5e+128) (+ a (/ x (/ t (- z a)))) (if (<= t 1.3e+144) (- (+ a z) b) (+ a (/ y (/ t (- z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5e+128) {
tmp = a + (x / (t / (z - a)));
} else if (t <= 1.3e+144) {
tmp = (a + z) - b;
} else {
tmp = a + (y / (t / (z - 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 (t <= (-5d+128)) then
tmp = a + (x / (t / (z - a)))
else if (t <= 1.3d+144) then
tmp = (a + z) - b
else
tmp = a + (y / (t / (z - 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 (t <= -5e+128) {
tmp = a + (x / (t / (z - a)));
} else if (t <= 1.3e+144) {
tmp = (a + z) - b;
} else {
tmp = a + (y / (t / (z - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -5e+128: tmp = a + (x / (t / (z - a))) elif t <= 1.3e+144: tmp = (a + z) - b else: tmp = a + (y / (t / (z - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -5e+128) tmp = Float64(a + Float64(x / Float64(t / Float64(z - a)))); elseif (t <= 1.3e+144) tmp = Float64(Float64(a + z) - b); else tmp = Float64(a + Float64(y / Float64(t / Float64(z - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -5e+128) tmp = a + (x / (t / (z - a))); elseif (t <= 1.3e+144) tmp = (a + z) - b; else tmp = a + (y / (t / (z - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -5e+128], N[(a + N[(x / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e+144], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(a + N[(y / N[(t / N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+128}:\\
\;\;\;\;a + \frac{x}{\frac{t}{z - a}}\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{+144}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;a + \frac{y}{\frac{t}{z - b}}\\
\end{array}
\end{array}
if t < -5e128Initial program 69.1%
Taylor expanded in t around -inf 64.7%
mul-1-neg64.7%
Simplified64.7%
Taylor expanded in y around 0 57.4%
cancel-sign-sub-inv57.4%
*-commutative57.4%
distribute-rgt-in57.4%
sub-neg57.4%
mul-1-neg57.4%
associate-/l*72.7%
distribute-neg-frac72.7%
Simplified72.7%
if -5e128 < t < 1.2999999999999999e144Initial program 65.4%
Taylor expanded in y around inf 64.3%
if 1.2999999999999999e144 < t Initial program 46.0%
Taylor expanded in t around -inf 60.5%
mul-1-neg60.5%
Simplified60.5%
Taylor expanded in y around inf 61.6%
mul-1-neg61.6%
associate-/l*71.9%
distribute-neg-frac71.9%
Simplified71.9%
Final simplification66.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.2e+133) (not (<= t 6.2e+143))) (- a (/ b (/ t y))) (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.2e+133) || !(t <= 6.2e+143)) {
tmp = a - (b / (t / y));
} else {
tmp = (a + z) - 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 ((t <= (-1.2d+133)) .or. (.not. (t <= 6.2d+143))) then
tmp = a - (b / (t / y))
else
tmp = (a + z) - 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 ((t <= -1.2e+133) || !(t <= 6.2e+143)) {
tmp = a - (b / (t / y));
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.2e+133) or not (t <= 6.2e+143): tmp = a - (b / (t / y)) else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.2e+133) || !(t <= 6.2e+143)) tmp = Float64(a - Float64(b / Float64(t / y))); else tmp = Float64(Float64(a + z) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.2e+133) || ~((t <= 6.2e+143))) tmp = a - (b / (t / y)); else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.2e+133], N[Not[LessEqual[t, 6.2e+143]], $MachinePrecision]], N[(a - N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+133} \lor \neg \left(t \leq 6.2 \cdot 10^{+143}\right):\\
\;\;\;\;a - \frac{b}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if t < -1.1999999999999999e133 or 6.1999999999999998e143 < t Initial program 55.3%
Taylor expanded in t around -inf 62.2%
mul-1-neg62.2%
Simplified62.2%
Taylor expanded in b around inf 54.9%
Taylor expanded in a around 0 54.9%
mul-1-neg54.9%
associate-/l*64.9%
sub-neg64.9%
Simplified64.9%
if -1.1999999999999999e133 < t < 6.1999999999999998e143Initial program 65.4%
Taylor expanded in y around inf 64.3%
Final simplification64.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.1e+135) (+ a (/ x (/ t z))) (if (<= t 1.3e+145) (- (+ a z) b) (- a (/ b (/ t y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.1e+135) {
tmp = a + (x / (t / z));
} else if (t <= 1.3e+145) {
tmp = (a + z) - b;
} else {
tmp = a - (b / (t / y));
}
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 <= (-1.1d+135)) then
tmp = a + (x / (t / z))
else if (t <= 1.3d+145) then
tmp = (a + z) - b
else
tmp = a - (b / (t / y))
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 <= -1.1e+135) {
tmp = a + (x / (t / z));
} else if (t <= 1.3e+145) {
tmp = (a + z) - b;
} else {
tmp = a - (b / (t / y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.1e+135: tmp = a + (x / (t / z)) elif t <= 1.3e+145: tmp = (a + z) - b else: tmp = a - (b / (t / y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.1e+135) tmp = Float64(a + Float64(x / Float64(t / z))); elseif (t <= 1.3e+145) tmp = Float64(Float64(a + z) - b); else tmp = Float64(a - Float64(b / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.1e+135) tmp = a + (x / (t / z)); elseif (t <= 1.3e+145) tmp = (a + z) - b; else tmp = a - (b / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.1e+135], N[(a + N[(x / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e+145], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(a - N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+135}:\\
\;\;\;\;a + \frac{x}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{+145}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;a - \frac{b}{\frac{t}{y}}\\
\end{array}
\end{array}
if t < -1.1e135Initial program 69.1%
Taylor expanded in t around -inf 64.7%
mul-1-neg64.7%
Simplified64.7%
Taylor expanded in z around inf 67.6%
mul-1-neg67.6%
associate-/l*71.6%
distribute-neg-frac71.6%
+-commutative71.6%
Simplified71.6%
Taylor expanded in y around 0 67.6%
mul-1-neg67.6%
associate-/l*71.5%
distribute-neg-frac71.5%
Simplified71.5%
if -1.1e135 < t < 1.30000000000000001e145Initial program 65.4%
Taylor expanded in y around inf 64.3%
if 1.30000000000000001e145 < t Initial program 46.0%
Taylor expanded in t around -inf 60.5%
mul-1-neg60.5%
Simplified60.5%
Taylor expanded in b around inf 53.9%
Taylor expanded in a around 0 53.9%
mul-1-neg53.9%
associate-/l*64.1%
sub-neg64.1%
Simplified64.1%
Final simplification64.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.95e+130) (+ a (/ x (/ t (- z a)))) (if (<= t 2.9e+141) (- (+ a z) b) (- a (/ b (/ t y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.95e+130) {
tmp = a + (x / (t / (z - a)));
} else if (t <= 2.9e+141) {
tmp = (a + z) - b;
} else {
tmp = a - (b / (t / y));
}
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 <= (-1.95d+130)) then
tmp = a + (x / (t / (z - a)))
else if (t <= 2.9d+141) then
tmp = (a + z) - b
else
tmp = a - (b / (t / y))
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 <= -1.95e+130) {
tmp = a + (x / (t / (z - a)));
} else if (t <= 2.9e+141) {
tmp = (a + z) - b;
} else {
tmp = a - (b / (t / y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.95e+130: tmp = a + (x / (t / (z - a))) elif t <= 2.9e+141: tmp = (a + z) - b else: tmp = a - (b / (t / y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.95e+130) tmp = Float64(a + Float64(x / Float64(t / Float64(z - a)))); elseif (t <= 2.9e+141) tmp = Float64(Float64(a + z) - b); else tmp = Float64(a - Float64(b / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.95e+130) tmp = a + (x / (t / (z - a))); elseif (t <= 2.9e+141) tmp = (a + z) - b; else tmp = a - (b / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.95e+130], N[(a + N[(x / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e+141], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(a - N[(b / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{+130}:\\
\;\;\;\;a + \frac{x}{\frac{t}{z - a}}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+141}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;a - \frac{b}{\frac{t}{y}}\\
\end{array}
\end{array}
if t < -1.9500000000000001e130Initial program 69.1%
Taylor expanded in t around -inf 64.7%
mul-1-neg64.7%
Simplified64.7%
Taylor expanded in y around 0 57.4%
cancel-sign-sub-inv57.4%
*-commutative57.4%
distribute-rgt-in57.4%
sub-neg57.4%
mul-1-neg57.4%
associate-/l*72.7%
distribute-neg-frac72.7%
Simplified72.7%
if -1.9500000000000001e130 < t < 2.90000000000000007e141Initial program 65.4%
Taylor expanded in y around inf 64.3%
if 2.90000000000000007e141 < t Initial program 46.0%
Taylor expanded in t around -inf 60.5%
mul-1-neg60.5%
Simplified60.5%
Taylor expanded in b around inf 53.9%
Taylor expanded in a around 0 53.9%
mul-1-neg53.9%
associate-/l*64.1%
sub-neg64.1%
Simplified64.1%
Final simplification65.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.7e+130) a (if (<= t 1.6e+177) (- (+ a z) b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.7e+130) {
tmp = a;
} else if (t <= 1.6e+177) {
tmp = (a + z) - b;
} else {
tmp = 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.7d+130)) then
tmp = a
else if (t <= 1.6d+177) then
tmp = (a + z) - b
else
tmp = 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.7e+130) {
tmp = a;
} else if (t <= 1.6e+177) {
tmp = (a + z) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.7e+130: tmp = a elif t <= 1.6e+177: tmp = (a + z) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.7e+130) tmp = a; elseif (t <= 1.6e+177) tmp = Float64(Float64(a + z) - b); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.7e+130) tmp = a; elseif (t <= 1.6e+177) tmp = (a + z) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.7e+130], a, If[LessEqual[t, 1.6e+177], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{+130}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{+177}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -2.6999999999999998e130 or 1.6e177 < t Initial program 57.4%
Taylor expanded in t around inf 57.0%
if -2.6999999999999998e130 < t < 1.6e177Initial program 64.5%
Taylor expanded in y around inf 63.2%
Final simplification61.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -6e+19) a (if (<= t 4.5e+140) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6e+19) {
tmp = a;
} else if (t <= 4.5e+140) {
tmp = z;
} else {
tmp = 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 <= (-6d+19)) then
tmp = a
else if (t <= 4.5d+140) then
tmp = z
else
tmp = 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 <= -6e+19) {
tmp = a;
} else if (t <= 4.5e+140) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -6e+19: tmp = a elif t <= 4.5e+140: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -6e+19) tmp = a; elseif (t <= 4.5e+140) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -6e+19) tmp = a; elseif (t <= 4.5e+140) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -6e+19], a, If[LessEqual[t, 4.5e+140], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+19}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+140}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -6e19 or 4.5000000000000002e140 < t Initial program 57.7%
Taylor expanded in t around inf 52.2%
if -6e19 < t < 4.5000000000000002e140Initial program 65.3%
Taylor expanded in x around inf 46.0%
Final simplification47.9%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return 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 = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 63.0%
Taylor expanded in t around inf 31.8%
Final simplification31.8%
(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 2024010
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:herbie-target
(if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1.0 (/ (+ (+ 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)))