
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* (+ x y) z) (* a (+ y t))) (* y b)) t_1))
(t_3 (- (+ z a) b)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 5e+283)))
t_3
(/ (+ (* t a) (+ (* x z) (* y t_3))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 5e+283)) {
tmp = t_3;
} else {
tmp = ((t * a) + ((x * z) + (y * t_3))) / t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 5e+283)) {
tmp = t_3;
} else {
tmp = ((t * a) + ((x * z) + (y * t_3))) / t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1 t_3 = (z + a) - b tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 5e+283): tmp = t_3 else: tmp = ((t * a) + ((x * z) + (y * t_3))) / t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 5e+283)) tmp = t_3; else tmp = Float64(Float64(Float64(t * a) + Float64(Float64(x * z) + Float64(y * t_3))) / t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1; t_3 = (z + a) - b; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 5e+283))) tmp = t_3; else tmp = ((t * a) + ((x * z) + (y * t_3))) / t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 5e+283]], $MachinePrecision]], t$95$3, N[(N[(N[(t * a), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] + N[(y * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_1}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 5 \cdot 10^{+283}\right):\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + \left(x \cdot z + y \cdot t\_3\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 5.0000000000000004e283 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.2%
Taylor expanded in y around inf 74.3%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000004e283Initial program 99.1%
Taylor expanded in y around 0 99.1%
Final simplification88.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (+ y t))) (t_2 (* y (* (+ a (- z b)) (/ 1.0 t_1)))))
(if (<= y -6e+93)
t_2
(if (<= y -2.4e-125)
(/ (- (* a (+ y t)) (* y b)) (+ y (+ x t)))
(if (<= y 8.2e-238)
(* z (+ (/ x (+ x t)) (/ (* t a) (* z (+ x t)))))
(if (<= y 6.5e-29) (* z (+ (/ x t_1) (/ a z))) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double t_2 = y * ((a + (z - b)) * (1.0 / t_1));
double tmp;
if (y <= -6e+93) {
tmp = t_2;
} else if (y <= -2.4e-125) {
tmp = ((a * (y + t)) - (y * b)) / (y + (x + t));
} else if (y <= 8.2e-238) {
tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t))));
} else if (y <= 6.5e-29) {
tmp = z * ((x / t_1) + (a / z));
} else {
tmp = t_2;
}
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) :: tmp
t_1 = x + (y + t)
t_2 = y * ((a + (z - b)) * (1.0d0 / t_1))
if (y <= (-6d+93)) then
tmp = t_2
else if (y <= (-2.4d-125)) then
tmp = ((a * (y + t)) - (y * b)) / (y + (x + t))
else if (y <= 8.2d-238) then
tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t))))
else if (y <= 6.5d-29) then
tmp = z * ((x / t_1) + (a / z))
else
tmp = t_2
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 + (y + t);
double t_2 = y * ((a + (z - b)) * (1.0 / t_1));
double tmp;
if (y <= -6e+93) {
tmp = t_2;
} else if (y <= -2.4e-125) {
tmp = ((a * (y + t)) - (y * b)) / (y + (x + t));
} else if (y <= 8.2e-238) {
tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t))));
} else if (y <= 6.5e-29) {
tmp = z * ((x / t_1) + (a / z));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y + t) t_2 = y * ((a + (z - b)) * (1.0 / t_1)) tmp = 0 if y <= -6e+93: tmp = t_2 elif y <= -2.4e-125: tmp = ((a * (y + t)) - (y * b)) / (y + (x + t)) elif y <= 8.2e-238: tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t)))) elif y <= 6.5e-29: tmp = z * ((x / t_1) + (a / z)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y + t)) t_2 = Float64(y * Float64(Float64(a + Float64(z - b)) * Float64(1.0 / t_1))) tmp = 0.0 if (y <= -6e+93) tmp = t_2; elseif (y <= -2.4e-125) tmp = Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * b)) / Float64(y + Float64(x + t))); elseif (y <= 8.2e-238) tmp = Float64(z * Float64(Float64(x / Float64(x + t)) + Float64(Float64(t * a) / Float64(z * Float64(x + t))))); elseif (y <= 6.5e-29) tmp = Float64(z * Float64(Float64(x / t_1) + Float64(a / z))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y + t); t_2 = y * ((a + (z - b)) * (1.0 / t_1)); tmp = 0.0; if (y <= -6e+93) tmp = t_2; elseif (y <= -2.4e-125) tmp = ((a * (y + t)) - (y * b)) / (y + (x + t)); elseif (y <= 8.2e-238) tmp = z * ((x / (x + t)) + ((t * a) / (z * (x + t)))); elseif (y <= 6.5e-29) tmp = z * ((x / t_1) + (a / z)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6e+93], t$95$2, If[LessEqual[y, -2.4e-125], N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e-238], N[(z * N[(N[(x / N[(x + t), $MachinePrecision]), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] / N[(z * N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e-29], N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y + t\right)\\
t_2 := y \cdot \left(\left(a + \left(z - b\right)\right) \cdot \frac{1}{t\_1}\right)\\
\mathbf{if}\;y \leq -6 \cdot 10^{+93}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-125}:\\
\;\;\;\;\frac{a \cdot \left(y + t\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-238}:\\
\;\;\;\;z \cdot \left(\frac{x}{x + t} + \frac{t \cdot a}{z \cdot \left(x + t\right)}\right)\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-29}:\\
\;\;\;\;z \cdot \left(\frac{x}{t\_1} + \frac{a}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -5.99999999999999957e93 or 6.5e-29 < y Initial program 35.3%
Taylor expanded in y around inf 30.4%
div-inv30.3%
+-commutative30.3%
associate-+r+30.3%
associate--l+30.3%
associate-+r+30.3%
+-commutative30.3%
associate-+l+30.3%
+-commutative30.3%
Applied egg-rr30.3%
associate-*l*82.4%
Simplified82.4%
if -5.99999999999999957e93 < y < -2.4000000000000001e-125Initial program 77.0%
Taylor expanded in z around 0 70.2%
+-commutative70.2%
*-commutative70.2%
Simplified70.2%
if -2.4000000000000001e-125 < y < 8.2000000000000002e-238Initial program 79.7%
Taylor expanded in z around inf 90.1%
associate--l+90.1%
+-commutative90.1%
associate-+r+90.1%
+-commutative90.1%
associate-+r+90.1%
times-frac92.9%
+-commutative92.9%
+-commutative92.9%
associate-+r+92.9%
associate-/r*94.8%
Simplified94.8%
Taylor expanded in y around 0 79.3%
if 8.2000000000000002e-238 < y < 6.5e-29Initial program 70.2%
Taylor expanded in z around inf 61.1%
associate--l+61.1%
+-commutative61.1%
associate-+r+61.1%
+-commutative61.1%
associate-+r+61.1%
times-frac87.9%
+-commutative87.9%
+-commutative87.9%
associate-+r+87.9%
associate-/r*83.8%
Simplified83.8%
Taylor expanded in t around inf 68.0%
Final simplification76.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (+ y t))) (t_2 (* y (* (+ a (- z b)) (/ 1.0 t_1)))))
(if (<= y -6e+93)
t_2
(if (<= y -7.9e-112)
(/ (- (* a (+ y t)) (* y b)) (+ y (+ x t)))
(if (<= y 1.8e-29) (* z (+ (/ x t_1) (/ a z))) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double t_2 = y * ((a + (z - b)) * (1.0 / t_1));
double tmp;
if (y <= -6e+93) {
tmp = t_2;
} else if (y <= -7.9e-112) {
tmp = ((a * (y + t)) - (y * b)) / (y + (x + t));
} else if (y <= 1.8e-29) {
tmp = z * ((x / t_1) + (a / z));
} else {
tmp = t_2;
}
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) :: tmp
t_1 = x + (y + t)
t_2 = y * ((a + (z - b)) * (1.0d0 / t_1))
if (y <= (-6d+93)) then
tmp = t_2
else if (y <= (-7.9d-112)) then
tmp = ((a * (y + t)) - (y * b)) / (y + (x + t))
else if (y <= 1.8d-29) then
tmp = z * ((x / t_1) + (a / z))
else
tmp = t_2
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 + (y + t);
double t_2 = y * ((a + (z - b)) * (1.0 / t_1));
double tmp;
if (y <= -6e+93) {
tmp = t_2;
} else if (y <= -7.9e-112) {
tmp = ((a * (y + t)) - (y * b)) / (y + (x + t));
} else if (y <= 1.8e-29) {
tmp = z * ((x / t_1) + (a / z));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y + t) t_2 = y * ((a + (z - b)) * (1.0 / t_1)) tmp = 0 if y <= -6e+93: tmp = t_2 elif y <= -7.9e-112: tmp = ((a * (y + t)) - (y * b)) / (y + (x + t)) elif y <= 1.8e-29: tmp = z * ((x / t_1) + (a / z)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y + t)) t_2 = Float64(y * Float64(Float64(a + Float64(z - b)) * Float64(1.0 / t_1))) tmp = 0.0 if (y <= -6e+93) tmp = t_2; elseif (y <= -7.9e-112) tmp = Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * b)) / Float64(y + Float64(x + t))); elseif (y <= 1.8e-29) tmp = Float64(z * Float64(Float64(x / t_1) + Float64(a / z))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y + t); t_2 = y * ((a + (z - b)) * (1.0 / t_1)); tmp = 0.0; if (y <= -6e+93) tmp = t_2; elseif (y <= -7.9e-112) tmp = ((a * (y + t)) - (y * b)) / (y + (x + t)); elseif (y <= 1.8e-29) tmp = z * ((x / t_1) + (a / z)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6e+93], t$95$2, If[LessEqual[y, -7.9e-112], N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e-29], N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y + t\right)\\
t_2 := y \cdot \left(\left(a + \left(z - b\right)\right) \cdot \frac{1}{t\_1}\right)\\
\mathbf{if}\;y \leq -6 \cdot 10^{+93}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -7.9 \cdot 10^{-112}:\\
\;\;\;\;\frac{a \cdot \left(y + t\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-29}:\\
\;\;\;\;z \cdot \left(\frac{x}{t\_1} + \frac{a}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -5.99999999999999957e93 or 1.79999999999999987e-29 < y Initial program 35.3%
Taylor expanded in y around inf 30.4%
div-inv30.3%
+-commutative30.3%
associate-+r+30.3%
associate--l+30.3%
associate-+r+30.3%
+-commutative30.3%
associate-+l+30.3%
+-commutative30.3%
Applied egg-rr30.3%
associate-*l*82.4%
Simplified82.4%
if -5.99999999999999957e93 < y < -7.8999999999999999e-112Initial program 77.0%
Taylor expanded in z around 0 70.2%
+-commutative70.2%
*-commutative70.2%
Simplified70.2%
if -7.8999999999999999e-112 < y < 1.79999999999999987e-29Initial program 75.1%
Taylor expanded in z around inf 76.1%
associate--l+76.1%
+-commutative76.1%
associate-+r+76.1%
+-commutative76.1%
associate-+r+76.1%
times-frac90.5%
+-commutative90.5%
+-commutative90.5%
associate-+r+90.5%
associate-/r*89.5%
Simplified89.5%
Taylor expanded in t around inf 66.9%
Final simplification74.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -4.2e-37)
t_1
(if (<= y 5e-29)
(* z (+ (/ x (+ x (+ y t))) (/ a z)))
(if (<= y 6e+22) (/ (* y t_1) (+ y (+ x t))) 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 <= -4.2e-37) {
tmp = t_1;
} else if (y <= 5e-29) {
tmp = z * ((x / (x + (y + t))) + (a / z));
} else if (y <= 6e+22) {
tmp = (y * t_1) / (y + (x + t));
} 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 = (z + a) - b
if (y <= (-4.2d-37)) then
tmp = t_1
else if (y <= 5d-29) then
tmp = z * ((x / (x + (y + t))) + (a / z))
else if (y <= 6d+22) then
tmp = (y * t_1) / (y + (x + t))
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 = (z + a) - b;
double tmp;
if (y <= -4.2e-37) {
tmp = t_1;
} else if (y <= 5e-29) {
tmp = z * ((x / (x + (y + t))) + (a / z));
} else if (y <= 6e+22) {
tmp = (y * t_1) / (y + (x + t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -4.2e-37: tmp = t_1 elif y <= 5e-29: tmp = z * ((x / (x + (y + t))) + (a / z)) elif y <= 6e+22: tmp = (y * t_1) / (y + (x + t)) 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 <= -4.2e-37) tmp = t_1; elseif (y <= 5e-29) tmp = Float64(z * Float64(Float64(x / Float64(x + Float64(y + t))) + Float64(a / z))); elseif (y <= 6e+22) tmp = Float64(Float64(y * t_1) / Float64(y + Float64(x + t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -4.2e-37) tmp = t_1; elseif (y <= 5e-29) tmp = z * ((x / (x + (y + t))) + (a / z)); elseif (y <= 6e+22) tmp = (y * t_1) / (y + (x + t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -4.2e-37], t$95$1, If[LessEqual[y, 5e-29], N[(z * N[(N[(x / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e+22], N[(N[(y * t$95$1), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-29}:\\
\;\;\;\;z \cdot \left(\frac{x}{x + \left(y + t\right)} + \frac{a}{z}\right)\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+22}:\\
\;\;\;\;\frac{y \cdot t\_1}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.2000000000000002e-37 or 6e22 < y Initial program 38.6%
Taylor expanded in y around inf 73.1%
if -4.2000000000000002e-37 < y < 4.99999999999999986e-29Initial program 76.5%
Taylor expanded in z around inf 75.6%
associate--l+75.6%
+-commutative75.6%
associate-+r+75.6%
+-commutative75.6%
associate-+r+75.6%
times-frac87.8%
+-commutative87.8%
+-commutative87.8%
associate-+r+87.8%
associate-/r*87.8%
Simplified87.8%
Taylor expanded in t around inf 63.8%
if 4.99999999999999986e-29 < y < 6e22Initial program 83.5%
Taylor expanded in y around inf 75.4%
Final simplification68.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (+ y t))))
(if (or (<= y -4200000000000.0) (not (<= y 2.9e-29)))
(* y (* (+ a (- z b)) (/ 1.0 t_1)))
(* z (+ (/ x t_1) (/ a z))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double tmp;
if ((y <= -4200000000000.0) || !(y <= 2.9e-29)) {
tmp = y * ((a + (z - b)) * (1.0 / t_1));
} else {
tmp = z * ((x / t_1) + (a / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y + t)
if ((y <= (-4200000000000.0d0)) .or. (.not. (y <= 2.9d-29))) then
tmp = y * ((a + (z - b)) * (1.0d0 / t_1))
else
tmp = z * ((x / t_1) + (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double tmp;
if ((y <= -4200000000000.0) || !(y <= 2.9e-29)) {
tmp = y * ((a + (z - b)) * (1.0 / t_1));
} else {
tmp = z * ((x / t_1) + (a / z));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y + t) tmp = 0 if (y <= -4200000000000.0) or not (y <= 2.9e-29): tmp = y * ((a + (z - b)) * (1.0 / t_1)) else: tmp = z * ((x / t_1) + (a / z)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y + t)) tmp = 0.0 if ((y <= -4200000000000.0) || !(y <= 2.9e-29)) tmp = Float64(y * Float64(Float64(a + Float64(z - b)) * Float64(1.0 / t_1))); else tmp = Float64(z * Float64(Float64(x / t_1) + Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y + t); tmp = 0.0; if ((y <= -4200000000000.0) || ~((y <= 2.9e-29))) tmp = y * ((a + (z - b)) * (1.0 / t_1)); else tmp = z * ((x / t_1) + (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y, -4200000000000.0], N[Not[LessEqual[y, 2.9e-29]], $MachinePrecision]], N[(y * N[(N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y + t\right)\\
\mathbf{if}\;y \leq -4200000000000 \lor \neg \left(y \leq 2.9 \cdot 10^{-29}\right):\\
\;\;\;\;y \cdot \left(\left(a + \left(z - b\right)\right) \cdot \frac{1}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{x}{t\_1} + \frac{a}{z}\right)\\
\end{array}
\end{array}
if y < -4.2e12 or 2.90000000000000024e-29 < y Initial program 40.7%
Taylor expanded in y around inf 32.1%
div-inv32.0%
+-commutative32.0%
associate-+r+32.0%
associate--l+32.0%
associate-+r+32.0%
+-commutative32.0%
associate-+l+32.0%
+-commutative32.0%
Applied egg-rr32.0%
associate-*l*78.3%
Simplified78.3%
if -4.2e12 < y < 2.90000000000000024e-29Initial program 75.9%
Taylor expanded in z around inf 75.1%
associate--l+75.1%
+-commutative75.1%
associate-+r+75.1%
+-commutative75.1%
associate-+r+75.1%
times-frac87.2%
+-commutative87.2%
+-commutative87.2%
associate-+r+87.2%
associate-/r*86.4%
Simplified86.4%
Taylor expanded in t around inf 63.0%
Final simplification70.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ a (* z (/ (+ x y) t)))))
(if (<= t -2.1e+94)
t_1
(if (<= t -2.35e-87)
(* a (+ (/ z a) (/ y (+ x y))))
(if (<= t 3.8e+127) (- (+ z a) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (z * ((x + y) / t));
double tmp;
if (t <= -2.1e+94) {
tmp = t_1;
} else if (t <= -2.35e-87) {
tmp = a * ((z / a) + (y / (x + y)));
} else if (t <= 3.8e+127) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a + (z * ((x + y) / t))
if (t <= (-2.1d+94)) then
tmp = t_1
else if (t <= (-2.35d-87)) then
tmp = a * ((z / a) + (y / (x + y)))
else if (t <= 3.8d+127) then
tmp = (z + a) - b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (z * ((x + y) / t));
double tmp;
if (t <= -2.1e+94) {
tmp = t_1;
} else if (t <= -2.35e-87) {
tmp = a * ((z / a) + (y / (x + y)));
} else if (t <= 3.8e+127) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a + (z * ((x + y) / t)) tmp = 0 if t <= -2.1e+94: tmp = t_1 elif t <= -2.35e-87: tmp = a * ((z / a) + (y / (x + y))) elif t <= 3.8e+127: tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a + Float64(z * Float64(Float64(x + y) / t))) tmp = 0.0 if (t <= -2.1e+94) tmp = t_1; elseif (t <= -2.35e-87) tmp = Float64(a * Float64(Float64(z / a) + Float64(y / Float64(x + y)))); elseif (t <= 3.8e+127) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a + (z * ((x + y) / t)); tmp = 0.0; if (t <= -2.1e+94) tmp = t_1; elseif (t <= -2.35e-87) tmp = a * ((z / a) + (y / (x + y))); elseif (t <= 3.8e+127) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(z * N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.1e+94], t$95$1, If[LessEqual[t, -2.35e-87], N[(a * N[(N[(z / a), $MachinePrecision] + N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e+127], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + z \cdot \frac{x + y}{t}\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.35 \cdot 10^{-87}:\\
\;\;\;\;a \cdot \left(\frac{z}{a} + \frac{y}{x + y}\right)\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+127}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.09999999999999989e94 or 3.7999999999999998e127 < t Initial program 55.1%
Taylor expanded in a around -inf 80.1%
mul-1-neg80.1%
distribute-rgt-neg-in80.1%
mul-1-neg80.1%
unsub-neg80.1%
Simplified80.1%
Taylor expanded in t around inf 60.6%
Taylor expanded in z around -inf 64.2%
associate-/l*73.0%
Simplified73.0%
if -2.09999999999999989e94 < t < -2.35e-87Initial program 63.3%
Taylor expanded in a around -inf 70.5%
mul-1-neg70.5%
distribute-rgt-neg-in70.5%
mul-1-neg70.5%
unsub-neg70.5%
Simplified70.5%
Taylor expanded in b around 0 55.3%
times-frac68.0%
mul-1-neg68.0%
Simplified68.0%
Taylor expanded in t around 0 59.5%
+-commutative59.5%
Simplified59.5%
if -2.35e-87 < t < 3.7999999999999998e127Initial program 58.4%
Taylor expanded in y around inf 68.3%
Final simplification68.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -8.6e+94) (not (<= t 7.5e+127))) (+ a (* z (/ (+ x y) t))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -8.6e+94) || !(t <= 7.5e+127)) {
tmp = a + (z * ((x + y) / t));
} 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 ((t <= (-8.6d+94)) .or. (.not. (t <= 7.5d+127))) then
tmp = a + (z * ((x + y) / t))
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 ((t <= -8.6e+94) || !(t <= 7.5e+127)) {
tmp = a + (z * ((x + y) / t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -8.6e+94) or not (t <= 7.5e+127): tmp = a + (z * ((x + y) / t)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -8.6e+94) || !(t <= 7.5e+127)) tmp = Float64(a + Float64(z * Float64(Float64(x + y) / t))); 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 ((t <= -8.6e+94) || ~((t <= 7.5e+127))) tmp = a + (z * ((x + y) / t)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -8.6e+94], N[Not[LessEqual[t, 7.5e+127]], $MachinePrecision]], N[(a + N[(z * N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.6 \cdot 10^{+94} \lor \neg \left(t \leq 7.5 \cdot 10^{+127}\right):\\
\;\;\;\;a + z \cdot \frac{x + y}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -8.6e94 or 7.4999999999999996e127 < t Initial program 55.1%
Taylor expanded in a around -inf 80.1%
mul-1-neg80.1%
distribute-rgt-neg-in80.1%
mul-1-neg80.1%
unsub-neg80.1%
Simplified80.1%
Taylor expanded in t around inf 60.6%
Taylor expanded in z around -inf 64.2%
associate-/l*73.0%
Simplified73.0%
if -8.6e94 < t < 7.4999999999999996e127Initial program 59.5%
Taylor expanded in y around inf 63.9%
Final simplification67.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -8.5e+94) (not (<= t 1.15e+128))) (- a (/ (* y b) t)) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -8.5e+94) || !(t <= 1.15e+128)) {
tmp = a - ((y * b) / t);
} 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 ((t <= (-8.5d+94)) .or. (.not. (t <= 1.15d+128))) then
tmp = a - ((y * b) / t)
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 ((t <= -8.5e+94) || !(t <= 1.15e+128)) {
tmp = a - ((y * b) / t);
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -8.5e+94) or not (t <= 1.15e+128): tmp = a - ((y * b) / t) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -8.5e+94) || !(t <= 1.15e+128)) tmp = Float64(a - Float64(Float64(y * b) / t)); 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 ((t <= -8.5e+94) || ~((t <= 1.15e+128))) tmp = a - ((y * b) / t); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -8.5e+94], N[Not[LessEqual[t, 1.15e+128]], $MachinePrecision]], N[(a - N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{+94} \lor \neg \left(t \leq 1.15 \cdot 10^{+128}\right):\\
\;\;\;\;a - \frac{y \cdot b}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -8.50000000000000054e94 or 1.14999999999999999e128 < t Initial program 55.1%
Taylor expanded in a around -inf 80.1%
mul-1-neg80.1%
distribute-rgt-neg-in80.1%
mul-1-neg80.1%
unsub-neg80.1%
Simplified80.1%
Taylor expanded in t around inf 60.6%
Taylor expanded in b around inf 62.8%
associate-*r/62.8%
associate-*r*62.8%
neg-mul-162.8%
Simplified62.8%
if -8.50000000000000054e94 < t < 1.14999999999999999e128Initial program 59.5%
Taylor expanded in y around inf 63.9%
Final simplification63.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.1e+95) a (if (<= t 1.1e+171) (- (+ z a) b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.1e+95) {
tmp = a;
} else if (t <= 1.1e+171) {
tmp = (z + a) - 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 <= (-3.1d+95)) then
tmp = a
else if (t <= 1.1d+171) then
tmp = (z + a) - 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 <= -3.1e+95) {
tmp = a;
} else if (t <= 1.1e+171) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.1e+95: tmp = a elif t <= 1.1e+171: tmp = (z + a) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.1e+95) tmp = a; elseif (t <= 1.1e+171) tmp = Float64(Float64(z + a) - b); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.1e+95) tmp = a; elseif (t <= 1.1e+171) tmp = (z + a) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.1e+95], a, If[LessEqual[t, 1.1e+171], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{+95}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+171}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -3.1000000000000003e95 or 1.1e171 < t Initial program 57.8%
Taylor expanded in t around inf 55.7%
if -3.1000000000000003e95 < t < 1.1e171Initial program 58.1%
Taylor expanded in y around inf 63.2%
Final simplification60.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.05e+115) z (if (<= x 4.5e+183) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.05e+115) {
tmp = z;
} else if (x <= 4.5e+183) {
tmp = a;
} 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 <= (-1.05d+115)) then
tmp = z
else if (x <= 4.5d+183) then
tmp = a
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 <= -1.05e+115) {
tmp = z;
} else if (x <= 4.5e+183) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.05e+115: tmp = z elif x <= 4.5e+183: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.05e+115) tmp = z; elseif (x <= 4.5e+183) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.05e+115) tmp = z; elseif (x <= 4.5e+183) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.05e+115], z, If[LessEqual[x, 4.5e+183], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+115}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+183}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.05000000000000002e115 or 4.50000000000000017e183 < x Initial program 47.1%
Taylor expanded in x around inf 58.8%
if -1.05000000000000002e115 < x < 4.50000000000000017e183Initial program 61.4%
Taylor expanded in t around inf 45.6%
(FPCore (x y z t a b) :precision binary64 (if (<= b 5e+153) (+ z a) (- a b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 5e+153) {
tmp = z + a;
} else {
tmp = a - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 5d+153) then
tmp = z + a
else
tmp = a - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 5e+153) {
tmp = z + a;
} else {
tmp = a - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 5e+153: tmp = z + a else: tmp = a - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 5e+153) tmp = Float64(z + a); else tmp = Float64(a - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 5e+153) tmp = z + a; else tmp = a - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 5e+153], N[(z + a), $MachinePrecision], N[(a - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5 \cdot 10^{+153}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;a - b\\
\end{array}
\end{array}
if b < 5.00000000000000018e153Initial program 59.5%
Taylor expanded in b around 0 49.9%
Taylor expanded in y around inf 54.8%
if 5.00000000000000018e153 < b Initial program 48.7%
Taylor expanded in y around inf 59.9%
Taylor expanded in z around 0 54.6%
Final simplification54.8%
(FPCore (x y z t a b) :precision binary64 (if (<= b 1.15e+162) (+ z a) (- b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 1.15e+162) {
tmp = z + a;
} else {
tmp = -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 (b <= 1.15d+162) then
tmp = z + a
else
tmp = -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 (b <= 1.15e+162) {
tmp = z + a;
} else {
tmp = -b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 1.15e+162: tmp = z + a else: tmp = -b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 1.15e+162) tmp = Float64(z + a); else tmp = Float64(-b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 1.15e+162) tmp = z + a; else tmp = -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 1.15e+162], N[(z + a), $MachinePrecision], (-b)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.15 \cdot 10^{+162}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;-b\\
\end{array}
\end{array}
if b < 1.14999999999999997e162Initial program 59.0%
Taylor expanded in b around 0 49.5%
Taylor expanded in y around inf 54.8%
if 1.14999999999999997e162 < b Initial program 51.1%
Taylor expanded in y around inf 56.5%
Taylor expanded in b around inf 48.1%
neg-mul-148.1%
Simplified48.1%
Final simplification54.0%
(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 58.0%
Taylor expanded in t around inf 36.4%
(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 2024143
(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)))