
(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 (+ y (+ x t)))) (- (fma z (/ (+ y x) t_1) (* a (/ (+ y t) t_1))) (* y (/ b t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
return fma(z, ((y + x) / t_1), (a * ((y + t) / t_1))) - (y * (b / t_1));
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) return Float64(fma(z, Float64(Float64(y + x) / t_1), Float64(a * Float64(Float64(y + t) / t_1))) - Float64(y * Float64(b / t_1))) end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, N[(N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathsf{fma}\left(z, \frac{y + x}{t\_1}, a \cdot \frac{y + t}{t\_1}\right) - y \cdot \frac{b}{t\_1}
\end{array}
\end{array}
Initial program 61.9%
Taylor expanded in b around 0 61.9%
mul-1-neg61.9%
+-commutative61.9%
unsub-neg61.9%
+-commutative61.9%
associate-/l*74.0%
fma-define74.0%
+-commutative74.0%
associate-+r+74.0%
associate-/l*86.6%
associate-+r+86.6%
Simplified97.1%
Final simplification97.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t)))
(t_2 (+ y (+ x t)))
(t_3 (/ (- (+ (* z (+ y x)) t_1) (* y b)) t_2))
(t_4 (* y (/ b t_2))))
(if (<= t_3 (- INFINITY))
(- (+ a (* y (/ z (+ y t)))) t_4)
(if (<= t_3 1e+299)
(/ (- (fma (+ y x) z t_1) (* y b)) (+ x (+ y t)))
(- (+ z (* a (/ y (+ y x)))) t_4)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = (((z * (y + x)) + t_1) - (y * b)) / t_2;
double t_4 = y * (b / t_2);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = (a + (y * (z / (y + t)))) - t_4;
} else if (t_3 <= 1e+299) {
tmp = (fma((y + x), z, t_1) - (y * b)) / (x + (y + t));
} else {
tmp = (z + (a * (y / (y + x)))) - t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(Float64(Float64(z * Float64(y + x)) + t_1) - Float64(y * b)) / t_2) t_4 = Float64(y * Float64(b / t_2)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(Float64(a + Float64(y * Float64(z / Float64(y + t)))) - t_4); elseif (t_3 <= 1e+299) tmp = Float64(Float64(fma(Float64(y + x), z, t_1) - Float64(y * b)) / Float64(x + Float64(y + t))); else tmp = Float64(Float64(z + Float64(a * Float64(y / Float64(y + x)))) - t_4); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(y * N[(b / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(a + N[(y * N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$4), $MachinePrecision], If[LessEqual[t$95$3, 1e+299], N[(N[(N[(N[(y + x), $MachinePrecision] * z + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(a * N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$4), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{\left(z \cdot \left(y + x\right) + t\_1\right) - y \cdot b}{t\_2}\\
t_4 := y \cdot \frac{b}{t\_2}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\left(a + y \cdot \frac{z}{y + t}\right) - t\_4\\
\mathbf{elif}\;t\_3 \leq 10^{+299}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + x, z, t\_1\right) - y \cdot b}{x + \left(y + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a \cdot \frac{y}{y + x}\right) - t\_4\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0Initial program 6.3%
Taylor expanded in b around 0 6.3%
mul-1-neg6.3%
+-commutative6.3%
unsub-neg6.3%
+-commutative6.3%
associate-/l*45.0%
fma-define45.0%
+-commutative45.0%
associate-+r+45.0%
associate-/l*70.5%
associate-+r+70.5%
Simplified99.9%
Taylor expanded in x around 0 46.4%
associate-/l*83.3%
+-commutative83.3%
Simplified83.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)) < 1.0000000000000001e299Initial program 99.8%
fma-define99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Simplified99.8%
if 1.0000000000000001e299 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.0%
Taylor expanded in b around 0 5.0%
mul-1-neg5.0%
+-commutative5.0%
unsub-neg5.0%
+-commutative5.0%
associate-/l*26.6%
fma-define26.6%
+-commutative26.6%
associate-+r+26.6%
associate-/l*63.2%
associate-+r+63.2%
Simplified99.9%
Taylor expanded in t around 0 50.2%
+-commutative50.2%
associate-/l*78.2%
+-commutative78.2%
Simplified78.2%
Final simplification92.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* z (+ y x)) (* a (+ y t))) (* y b)) t_1))
(t_3 (* y (/ b t_1))))
(if (<= t_2 (- INFINITY))
(- (+ a (* y (/ z (+ y t)))) t_3)
(if (<= t_2 1e+299) t_2 (- (+ z (* a (/ y (+ y x)))) t_3)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = y * (b / t_1);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (a + (y * (z / (y + t)))) - t_3;
} else if (t_2 <= 1e+299) {
tmp = t_2;
} else {
tmp = (z + (a * (y / (y + x)))) - t_3;
}
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 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = y * (b / t_1);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (a + (y * (z / (y + t)))) - t_3;
} else if (t_2 <= 1e+299) {
tmp = t_2;
} else {
tmp = (z + (a * (y / (y + x)))) - t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / t_1 t_3 = y * (b / t_1) tmp = 0 if t_2 <= -math.inf: tmp = (a + (y * (z / (y + t)))) - t_3 elif t_2 <= 1e+299: tmp = t_2 else: tmp = (z + (a * (y / (y + x)))) - t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(z * Float64(y + x)) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) t_3 = Float64(y * Float64(b / t_1)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(a + Float64(y * Float64(z / Float64(y + t)))) - t_3); elseif (t_2 <= 1e+299) tmp = t_2; else tmp = Float64(Float64(z + Float64(a * Float64(y / Float64(y + x)))) - t_3); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / t_1; t_3 = y * (b / t_1); tmp = 0.0; if (t_2 <= -Inf) tmp = (a + (y * (z / (y + t)))) - t_3; elseif (t_2 <= 1e+299) tmp = t_2; else tmp = (z + (a * (y / (y + x)))) - t_3; 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[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(y * N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(a + N[(y * N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision], If[LessEqual[t$95$2, 1e+299], t$95$2, N[(N[(z + N[(a * N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(z \cdot \left(y + x\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_1}\\
t_3 := y \cdot \frac{b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\left(a + y \cdot \frac{z}{y + t}\right) - t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{+299}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(z + a \cdot \frac{y}{y + x}\right) - t\_3\\
\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.3%
Taylor expanded in b around 0 6.3%
mul-1-neg6.3%
+-commutative6.3%
unsub-neg6.3%
+-commutative6.3%
associate-/l*45.0%
fma-define45.0%
+-commutative45.0%
associate-+r+45.0%
associate-/l*70.5%
associate-+r+70.5%
Simplified99.9%
Taylor expanded in x around 0 46.4%
associate-/l*83.3%
+-commutative83.3%
Simplified83.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)) < 1.0000000000000001e299Initial program 99.8%
if 1.0000000000000001e299 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.0%
Taylor expanded in b around 0 5.0%
mul-1-neg5.0%
+-commutative5.0%
unsub-neg5.0%
+-commutative5.0%
associate-/l*26.6%
fma-define26.6%
+-commutative26.6%
associate-+r+26.6%
associate-/l*63.2%
associate-+r+63.2%
Simplified99.9%
Taylor expanded in t around 0 50.2%
+-commutative50.2%
associate-/l*78.2%
+-commutative78.2%
Simplified78.2%
Final simplification92.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))))
(if (<= x -8.2e+173)
(* z (/ (+ y x) t_1))
(if (or (<= x -1.1e+76) (and (not (<= x -6.5e+38)) (<= x 1.5e+65)))
(- (+ a (* y (/ z (+ y t)))) (* b (/ y (+ y t))))
(- z (* y (/ b t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if (x <= -8.2e+173) {
tmp = z * ((y + x) / t_1);
} else if ((x <= -1.1e+76) || (!(x <= -6.5e+38) && (x <= 1.5e+65))) {
tmp = (a + (y * (z / (y + t)))) - (b * (y / (y + t)));
} else {
tmp = z - (y * (b / 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 + (x + t)
if (x <= (-8.2d+173)) then
tmp = z * ((y + x) / t_1)
else if ((x <= (-1.1d+76)) .or. (.not. (x <= (-6.5d+38))) .and. (x <= 1.5d+65)) then
tmp = (a + (y * (z / (y + t)))) - (b * (y / (y + t)))
else
tmp = z - (y * (b / 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 + (x + t);
double tmp;
if (x <= -8.2e+173) {
tmp = z * ((y + x) / t_1);
} else if ((x <= -1.1e+76) || (!(x <= -6.5e+38) && (x <= 1.5e+65))) {
tmp = (a + (y * (z / (y + t)))) - (b * (y / (y + t)));
} else {
tmp = z - (y * (b / t_1));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) tmp = 0 if x <= -8.2e+173: tmp = z * ((y + x) / t_1) elif (x <= -1.1e+76) or (not (x <= -6.5e+38) and (x <= 1.5e+65)): tmp = (a + (y * (z / (y + t)))) - (b * (y / (y + t))) else: tmp = z - (y * (b / t_1)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) tmp = 0.0 if (x <= -8.2e+173) tmp = Float64(z * Float64(Float64(y + x) / t_1)); elseif ((x <= -1.1e+76) || (!(x <= -6.5e+38) && (x <= 1.5e+65))) tmp = Float64(Float64(a + Float64(y * Float64(z / Float64(y + t)))) - Float64(b * Float64(y / Float64(y + t)))); else tmp = Float64(z - Float64(y * Float64(b / t_1))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); tmp = 0.0; if (x <= -8.2e+173) tmp = z * ((y + x) / t_1); elseif ((x <= -1.1e+76) || (~((x <= -6.5e+38)) && (x <= 1.5e+65))) tmp = (a + (y * (z / (y + t)))) - (b * (y / (y + t))); else tmp = z - (y * (b / 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]}, If[LessEqual[x, -8.2e+173], N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.1e+76], And[N[Not[LessEqual[x, -6.5e+38]], $MachinePrecision], LessEqual[x, 1.5e+65]]], N[(N[(a + N[(y * N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z - N[(y * N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;x \leq -8.2 \cdot 10^{+173}:\\
\;\;\;\;z \cdot \frac{y + x}{t\_1}\\
\mathbf{elif}\;x \leq -1.1 \cdot 10^{+76} \lor \neg \left(x \leq -6.5 \cdot 10^{+38}\right) \land x \leq 1.5 \cdot 10^{+65}:\\
\;\;\;\;\left(a + y \cdot \frac{z}{y + t}\right) - b \cdot \frac{y}{y + t}\\
\mathbf{else}:\\
\;\;\;\;z - y \cdot \frac{b}{t\_1}\\
\end{array}
\end{array}
if x < -8.19999999999999951e173Initial program 50.6%
Taylor expanded in z around inf 29.6%
associate-/l*70.6%
+-commutative70.6%
associate-+r+70.6%
Simplified70.6%
if -8.19999999999999951e173 < x < -1.1e76 or -6.5e38 < x < 1.5000000000000001e65Initial program 67.8%
Taylor expanded in b around 0 67.8%
mul-1-neg67.8%
+-commutative67.8%
unsub-neg67.8%
+-commutative67.8%
associate-/l*74.7%
fma-define74.7%
+-commutative74.7%
associate-+r+74.7%
associate-/l*86.1%
associate-+r+86.1%
Simplified96.5%
Taylor expanded in x around 0 74.2%
associate-/l*86.1%
+-commutative86.1%
Simplified86.1%
Taylor expanded in x around 0 73.9%
associate-/l*87.8%
+-commutative87.8%
Simplified87.8%
if -1.1e76 < x < -6.5e38 or 1.5000000000000001e65 < x Initial program 51.3%
Taylor expanded in b around 0 51.3%
mul-1-neg51.3%
+-commutative51.3%
unsub-neg51.3%
+-commutative51.3%
associate-/l*69.2%
fma-define69.2%
+-commutative69.2%
associate-+r+69.2%
associate-/l*85.9%
associate-+r+85.9%
Simplified98.4%
Taylor expanded in x around inf 65.6%
Final simplification80.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a (* y (/ z (+ y t)))) (* b (/ y (+ y t)))))
(t_2 (+ y (+ x t))))
(if (<= x -4e+173)
(* z (/ (+ y x) t_2))
(if (<= x -2.25e+74)
t_1
(if (<= x -6.5e+38)
(/ (- (+ (* z (+ y x)) (* y a)) (* y b)) (+ y x))
(if (<= x 1.35e+65) t_1 (- z (* y (/ b t_2)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + (y * (z / (y + t)))) - (b * (y / (y + t)));
double t_2 = y + (x + t);
double tmp;
if (x <= -4e+173) {
tmp = z * ((y + x) / t_2);
} else if (x <= -2.25e+74) {
tmp = t_1;
} else if (x <= -6.5e+38) {
tmp = (((z * (y + x)) + (y * a)) - (y * b)) / (y + x);
} else if (x <= 1.35e+65) {
tmp = t_1;
} else {
tmp = z - (y * (b / 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 = (a + (y * (z / (y + t)))) - (b * (y / (y + t)))
t_2 = y + (x + t)
if (x <= (-4d+173)) then
tmp = z * ((y + x) / t_2)
else if (x <= (-2.25d+74)) then
tmp = t_1
else if (x <= (-6.5d+38)) then
tmp = (((z * (y + x)) + (y * a)) - (y * b)) / (y + x)
else if (x <= 1.35d+65) then
tmp = t_1
else
tmp = z - (y * (b / 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 = (a + (y * (z / (y + t)))) - (b * (y / (y + t)));
double t_2 = y + (x + t);
double tmp;
if (x <= -4e+173) {
tmp = z * ((y + x) / t_2);
} else if (x <= -2.25e+74) {
tmp = t_1;
} else if (x <= -6.5e+38) {
tmp = (((z * (y + x)) + (y * a)) - (y * b)) / (y + x);
} else if (x <= 1.35e+65) {
tmp = t_1;
} else {
tmp = z - (y * (b / t_2));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + (y * (z / (y + t)))) - (b * (y / (y + t))) t_2 = y + (x + t) tmp = 0 if x <= -4e+173: tmp = z * ((y + x) / t_2) elif x <= -2.25e+74: tmp = t_1 elif x <= -6.5e+38: tmp = (((z * (y + x)) + (y * a)) - (y * b)) / (y + x) elif x <= 1.35e+65: tmp = t_1 else: tmp = z - (y * (b / t_2)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + Float64(y * Float64(z / Float64(y + t)))) - Float64(b * Float64(y / Float64(y + t)))) t_2 = Float64(y + Float64(x + t)) tmp = 0.0 if (x <= -4e+173) tmp = Float64(z * Float64(Float64(y + x) / t_2)); elseif (x <= -2.25e+74) tmp = t_1; elseif (x <= -6.5e+38) tmp = Float64(Float64(Float64(Float64(z * Float64(y + x)) + Float64(y * a)) - Float64(y * b)) / Float64(y + x)); elseif (x <= 1.35e+65) tmp = t_1; else tmp = Float64(z - Float64(y * Float64(b / t_2))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + (y * (z / (y + t)))) - (b * (y / (y + t))); t_2 = y + (x + t); tmp = 0.0; if (x <= -4e+173) tmp = z * ((y + x) / t_2); elseif (x <= -2.25e+74) tmp = t_1; elseif (x <= -6.5e+38) tmp = (((z * (y + x)) + (y * a)) - (y * b)) / (y + x); elseif (x <= 1.35e+65) tmp = t_1; else tmp = z - (y * (b / t_2)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + N[(y * N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4e+173], N[(z * N[(N[(y + x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.25e+74], t$95$1, If[LessEqual[x, -6.5e+38], N[(N[(N[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + N[(y * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+65], t$95$1, N[(z - N[(y * N[(b / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + y \cdot \frac{z}{y + t}\right) - b \cdot \frac{y}{y + t}\\
t_2 := y + \left(x + t\right)\\
\mathbf{if}\;x \leq -4 \cdot 10^{+173}:\\
\;\;\;\;z \cdot \frac{y + x}{t\_2}\\
\mathbf{elif}\;x \leq -2.25 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{+38}:\\
\;\;\;\;\frac{\left(z \cdot \left(y + x\right) + y \cdot a\right) - y \cdot b}{y + x}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z - y \cdot \frac{b}{t\_2}\\
\end{array}
\end{array}
if x < -4.0000000000000001e173Initial program 50.6%
Taylor expanded in z around inf 29.6%
associate-/l*70.6%
+-commutative70.6%
associate-+r+70.6%
Simplified70.6%
if -4.0000000000000001e173 < x < -2.25e74 or -6.5e38 < x < 1.35000000000000009e65Initial program 67.8%
Taylor expanded in b around 0 67.8%
mul-1-neg67.8%
+-commutative67.8%
unsub-neg67.8%
+-commutative67.8%
associate-/l*74.7%
fma-define74.7%
+-commutative74.7%
associate-+r+74.7%
associate-/l*86.1%
associate-+r+86.1%
Simplified96.5%
Taylor expanded in x around 0 74.2%
associate-/l*86.1%
+-commutative86.1%
Simplified86.1%
Taylor expanded in x around 0 73.9%
associate-/l*87.8%
+-commutative87.8%
Simplified87.8%
if -2.25e74 < x < -6.5e38Initial program 92.6%
Taylor expanded in t around 0 86.7%
if 1.35000000000000009e65 < x Initial program 41.6%
Taylor expanded in b around 0 41.6%
mul-1-neg41.6%
+-commutative41.6%
unsub-neg41.6%
+-commutative41.6%
associate-/l*62.0%
fma-define62.0%
+-commutative62.0%
associate-+r+62.0%
associate-/l*82.6%
associate-+r+82.6%
Simplified98.1%
Taylor expanded in x around inf 64.5%
Final simplification81.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (* a (/ (+ y t) t_1)))
(t_3 (- (+ z a) b))
(t_4 (* z (/ (+ y x) t_1))))
(if (<= y -1.15e-42)
t_3
(if (<= y 1.4e-236)
t_2
(if (<= y 1.15e-126)
t_4
(if (<= y 9.4e+21) t_2 (if (<= y 4.6e+70) t_4 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = a * ((y + t) / t_1);
double t_3 = (z + a) - b;
double t_4 = z * ((y + x) / t_1);
double tmp;
if (y <= -1.15e-42) {
tmp = t_3;
} else if (y <= 1.4e-236) {
tmp = t_2;
} else if (y <= 1.15e-126) {
tmp = t_4;
} else if (y <= 9.4e+21) {
tmp = t_2;
} else if (y <= 4.6e+70) {
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 = y + (x + t)
t_2 = a * ((y + t) / t_1)
t_3 = (z + a) - b
t_4 = z * ((y + x) / t_1)
if (y <= (-1.15d-42)) then
tmp = t_3
else if (y <= 1.4d-236) then
tmp = t_2
else if (y <= 1.15d-126) then
tmp = t_4
else if (y <= 9.4d+21) then
tmp = t_2
else if (y <= 4.6d+70) 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 = y + (x + t);
double t_2 = a * ((y + t) / t_1);
double t_3 = (z + a) - b;
double t_4 = z * ((y + x) / t_1);
double tmp;
if (y <= -1.15e-42) {
tmp = t_3;
} else if (y <= 1.4e-236) {
tmp = t_2;
} else if (y <= 1.15e-126) {
tmp = t_4;
} else if (y <= 9.4e+21) {
tmp = t_2;
} else if (y <= 4.6e+70) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = a * ((y + t) / t_1) t_3 = (z + a) - b t_4 = z * ((y + x) / t_1) tmp = 0 if y <= -1.15e-42: tmp = t_3 elif y <= 1.4e-236: tmp = t_2 elif y <= 1.15e-126: tmp = t_4 elif y <= 9.4e+21: tmp = t_2 elif y <= 4.6e+70: tmp = t_4 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(a * Float64(Float64(y + t) / t_1)) t_3 = Float64(Float64(z + a) - b) t_4 = Float64(z * Float64(Float64(y + x) / t_1)) tmp = 0.0 if (y <= -1.15e-42) tmp = t_3; elseif (y <= 1.4e-236) tmp = t_2; elseif (y <= 1.15e-126) tmp = t_4; elseif (y <= 9.4e+21) tmp = t_2; elseif (y <= 4.6e+70) tmp = t_4; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = a * ((y + t) / t_1); t_3 = (z + a) - b; t_4 = z * ((y + x) / t_1); tmp = 0.0; if (y <= -1.15e-42) tmp = t_3; elseif (y <= 1.4e-236) tmp = t_2; elseif (y <= 1.15e-126) tmp = t_4; elseif (y <= 9.4e+21) tmp = t_2; elseif (y <= 4.6e+70) tmp = t_4; else tmp = t_3; 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[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.15e-42], t$95$3, If[LessEqual[y, 1.4e-236], t$95$2, If[LessEqual[y, 1.15e-126], t$95$4, If[LessEqual[y, 9.4e+21], t$95$2, If[LessEqual[y, 4.6e+70], t$95$4, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := a \cdot \frac{y + t}{t\_1}\\
t_3 := \left(z + a\right) - b\\
t_4 := z \cdot \frac{y + x}{t\_1}\\
\mathbf{if}\;y \leq -1.15 \cdot 10^{-42}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-236}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-126}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;y \leq 9.4 \cdot 10^{+21}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+70}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y < -1.15000000000000002e-42 or 4.59999999999999987e70 < y Initial program 45.9%
Taylor expanded in y around inf 72.6%
if -1.15000000000000002e-42 < y < 1.39999999999999993e-236 or 1.15000000000000005e-126 < y < 9.4e21Initial program 79.4%
Taylor expanded in a around inf 45.4%
associate-/l*57.6%
associate-+r+57.6%
Simplified57.6%
if 1.39999999999999993e-236 < y < 1.15000000000000005e-126 or 9.4e21 < y < 4.59999999999999987e70Initial program 78.7%
Taylor expanded in z around inf 49.1%
associate-/l*70.1%
+-commutative70.1%
associate-+r+70.1%
Simplified70.1%
Final simplification66.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -3.1e-41)
t_1
(if (<= y 2.5e-115)
(/ (+ (* t a) (* z x)) (+ x t))
(if (or (<= y 8.2e-55) (not (<= y 1.9e-6)))
t_1
(/ (- (* t a) (* y b)) (+ y (+ x t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -3.1e-41) {
tmp = t_1;
} else if (y <= 2.5e-115) {
tmp = ((t * a) + (z * x)) / (x + t);
} else if ((y <= 8.2e-55) || !(y <= 1.9e-6)) {
tmp = t_1;
} else {
tmp = ((t * a) - (y * b)) / (y + (x + t));
}
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 <= (-3.1d-41)) then
tmp = t_1
else if (y <= 2.5d-115) then
tmp = ((t * a) + (z * x)) / (x + t)
else if ((y <= 8.2d-55) .or. (.not. (y <= 1.9d-6))) then
tmp = t_1
else
tmp = ((t * a) - (y * b)) / (y + (x + t))
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 <= -3.1e-41) {
tmp = t_1;
} else if (y <= 2.5e-115) {
tmp = ((t * a) + (z * x)) / (x + t);
} else if ((y <= 8.2e-55) || !(y <= 1.9e-6)) {
tmp = t_1;
} else {
tmp = ((t * a) - (y * b)) / (y + (x + t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -3.1e-41: tmp = t_1 elif y <= 2.5e-115: tmp = ((t * a) + (z * x)) / (x + t) elif (y <= 8.2e-55) or not (y <= 1.9e-6): tmp = t_1 else: tmp = ((t * a) - (y * b)) / (y + (x + t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -3.1e-41) tmp = t_1; elseif (y <= 2.5e-115) tmp = Float64(Float64(Float64(t * a) + Float64(z * x)) / Float64(x + t)); elseif ((y <= 8.2e-55) || !(y <= 1.9e-6)) tmp = t_1; else tmp = Float64(Float64(Float64(t * a) - Float64(y * b)) / Float64(y + Float64(x + t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -3.1e-41) tmp = t_1; elseif (y <= 2.5e-115) tmp = ((t * a) + (z * x)) / (x + t); elseif ((y <= 8.2e-55) || ~((y <= 1.9e-6))) tmp = t_1; else tmp = ((t * a) - (y * b)) / (y + (x + t)); 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, -3.1e-41], t$95$1, If[LessEqual[y, 2.5e-115], N[(N[(N[(t * a), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 8.2e-55], N[Not[LessEqual[y, 1.9e-6]], $MachinePrecision]], t$95$1, N[(N[(N[(t * a), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{-41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-115}:\\
\;\;\;\;\frac{t \cdot a + z \cdot x}{x + t}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-55} \lor \neg \left(y \leq 1.9 \cdot 10^{-6}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a - y \cdot b}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if y < -3.10000000000000001e-41 or 2.5000000000000001e-115 < y < 8.1999999999999996e-55 or 1.9e-6 < y Initial program 47.1%
Taylor expanded in y around inf 70.9%
if -3.10000000000000001e-41 < y < 2.5000000000000001e-115Initial program 85.6%
Taylor expanded in y around 0 71.0%
if 8.1999999999999996e-55 < y < 1.9e-6Initial program 99.7%
Taylor expanded in t around inf 81.0%
Final simplification71.3%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= y -8e-42)
(not (or (<= y 2.5e-119) (and (not (<= y 2.7e-65)) (<= y 1900.0)))))
(- (+ z a) b)
(/ (+ (* t a) (* z x)) (+ x t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8e-42) || !((y <= 2.5e-119) || (!(y <= 2.7e-65) && (y <= 1900.0)))) {
tmp = (z + a) - b;
} else {
tmp = ((t * a) + (z * x)) / (x + t);
}
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 <= (-8d-42)) .or. (.not. (y <= 2.5d-119) .or. (.not. (y <= 2.7d-65)) .and. (y <= 1900.0d0))) then
tmp = (z + a) - b
else
tmp = ((t * a) + (z * x)) / (x + t)
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 <= -8e-42) || !((y <= 2.5e-119) || (!(y <= 2.7e-65) && (y <= 1900.0)))) {
tmp = (z + a) - b;
} else {
tmp = ((t * a) + (z * x)) / (x + t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -8e-42) or not ((y <= 2.5e-119) or (not (y <= 2.7e-65) and (y <= 1900.0))): tmp = (z + a) - b else: tmp = ((t * a) + (z * x)) / (x + t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -8e-42) || !((y <= 2.5e-119) || (!(y <= 2.7e-65) && (y <= 1900.0)))) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(Float64(t * a) + Float64(z * x)) / Float64(x + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -8e-42) || ~(((y <= 2.5e-119) || (~((y <= 2.7e-65)) && (y <= 1900.0))))) tmp = (z + a) - b; else tmp = ((t * a) + (z * x)) / (x + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8e-42], N[Not[Or[LessEqual[y, 2.5e-119], And[N[Not[LessEqual[y, 2.7e-65]], $MachinePrecision], LessEqual[y, 1900.0]]]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(t * a), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{-42} \lor \neg \left(y \leq 2.5 \cdot 10^{-119} \lor \neg \left(y \leq 2.7 \cdot 10^{-65}\right) \land y \leq 1900\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + z \cdot x}{x + t}\\
\end{array}
\end{array}
if y < -8.0000000000000003e-42 or 2.49999999999999996e-119 < y < 2.6999999999999999e-65 or 1900 < y Initial program 46.1%
Taylor expanded in y around inf 70.9%
if -8.0000000000000003e-42 < y < 2.49999999999999996e-119 or 2.6999999999999999e-65 < y < 1900Initial program 87.4%
Taylor expanded in y around 0 71.1%
Final simplification71.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (/ (+ y t) (+ y (+ x t))))) (t_2 (- (+ z a) b)))
(if (<= y -4.8e-42)
t_2
(if (<= y 3e-235) t_1 (if (<= y 5.5e-128) z (if (<= y 9e+21) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * ((y + t) / (y + (x + t)));
double t_2 = (z + a) - b;
double tmp;
if (y <= -4.8e-42) {
tmp = t_2;
} else if (y <= 3e-235) {
tmp = t_1;
} else if (y <= 5.5e-128) {
tmp = z;
} else if (y <= 9e+21) {
tmp = t_1;
} 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 = a * ((y + t) / (y + (x + t)))
t_2 = (z + a) - b
if (y <= (-4.8d-42)) then
tmp = t_2
else if (y <= 3d-235) then
tmp = t_1
else if (y <= 5.5d-128) then
tmp = z
else if (y <= 9d+21) then
tmp = t_1
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 = a * ((y + t) / (y + (x + t)));
double t_2 = (z + a) - b;
double tmp;
if (y <= -4.8e-42) {
tmp = t_2;
} else if (y <= 3e-235) {
tmp = t_1;
} else if (y <= 5.5e-128) {
tmp = z;
} else if (y <= 9e+21) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * ((y + t) / (y + (x + t))) t_2 = (z + a) - b tmp = 0 if y <= -4.8e-42: tmp = t_2 elif y <= 3e-235: tmp = t_1 elif y <= 5.5e-128: tmp = z elif y <= 9e+21: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -4.8e-42) tmp = t_2; elseif (y <= 3e-235) tmp = t_1; elseif (y <= 5.5e-128) tmp = z; elseif (y <= 9e+21) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * ((y + t) / (y + (x + t))); t_2 = (z + a) - b; tmp = 0.0; if (y <= -4.8e-42) tmp = t_2; elseif (y <= 3e-235) tmp = t_1; elseif (y <= 5.5e-128) tmp = z; elseif (y <= 9e+21) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -4.8e-42], t$95$2, If[LessEqual[y, 3e-235], t$95$1, If[LessEqual[y, 5.5e-128], z, If[LessEqual[y, 9e+21], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \frac{y + t}{y + \left(x + t\right)}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{-42}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-235}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-128}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -4.80000000000000005e-42 or 9e21 < y Initial program 47.0%
Taylor expanded in y around inf 70.5%
if -4.80000000000000005e-42 < y < 2.9999999999999999e-235 or 5.5000000000000004e-128 < y < 9e21Initial program 79.4%
Taylor expanded in a around inf 45.4%
associate-/l*57.6%
associate-+r+57.6%
Simplified57.6%
if 2.9999999999999999e-235 < y < 5.5000000000000004e-128Initial program 86.7%
Taylor expanded in x around inf 61.0%
Final simplification65.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (* a (/ (+ y t) t_1))))
(if (<= a -4.8e+217)
t_2
(if (<= a -7.2e-13)
(- (+ z a) b)
(if (<= a -5.6e-74)
(- a (/ (* x a) (+ y t)))
(if (<= a 1.8e-33) (- z (* y (/ b t_1))) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = a * ((y + t) / t_1);
double tmp;
if (a <= -4.8e+217) {
tmp = t_2;
} else if (a <= -7.2e-13) {
tmp = (z + a) - b;
} else if (a <= -5.6e-74) {
tmp = a - ((x * a) / (y + t));
} else if (a <= 1.8e-33) {
tmp = z - (y * (b / t_1));
} 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 = y + (x + t)
t_2 = a * ((y + t) / t_1)
if (a <= (-4.8d+217)) then
tmp = t_2
else if (a <= (-7.2d-13)) then
tmp = (z + a) - b
else if (a <= (-5.6d-74)) then
tmp = a - ((x * a) / (y + t))
else if (a <= 1.8d-33) then
tmp = z - (y * (b / t_1))
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 = y + (x + t);
double t_2 = a * ((y + t) / t_1);
double tmp;
if (a <= -4.8e+217) {
tmp = t_2;
} else if (a <= -7.2e-13) {
tmp = (z + a) - b;
} else if (a <= -5.6e-74) {
tmp = a - ((x * a) / (y + t));
} else if (a <= 1.8e-33) {
tmp = z - (y * (b / t_1));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = a * ((y + t) / t_1) tmp = 0 if a <= -4.8e+217: tmp = t_2 elif a <= -7.2e-13: tmp = (z + a) - b elif a <= -5.6e-74: tmp = a - ((x * a) / (y + t)) elif a <= 1.8e-33: tmp = z - (y * (b / t_1)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(a * Float64(Float64(y + t) / t_1)) tmp = 0.0 if (a <= -4.8e+217) tmp = t_2; elseif (a <= -7.2e-13) tmp = Float64(Float64(z + a) - b); elseif (a <= -5.6e-74) tmp = Float64(a - Float64(Float64(x * a) / Float64(y + t))); elseif (a <= 1.8e-33) tmp = Float64(z - Float64(y * Float64(b / t_1))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = a * ((y + t) / t_1); tmp = 0.0; if (a <= -4.8e+217) tmp = t_2; elseif (a <= -7.2e-13) tmp = (z + a) - b; elseif (a <= -5.6e-74) tmp = a - ((x * a) / (y + t)); elseif (a <= 1.8e-33) tmp = z - (y * (b / t_1)); else tmp = t_2; 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[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.8e+217], t$95$2, If[LessEqual[a, -7.2e-13], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[a, -5.6e-74], N[(a - N[(N[(x * a), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e-33], N[(z - N[(y * N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := a \cdot \frac{y + t}{t\_1}\\
\mathbf{if}\;a \leq -4.8 \cdot 10^{+217}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -7.2 \cdot 10^{-13}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;a \leq -5.6 \cdot 10^{-74}:\\
\;\;\;\;a - \frac{x \cdot a}{y + t}\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-33}:\\
\;\;\;\;z - y \cdot \frac{b}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -4.7999999999999996e217 or 1.80000000000000017e-33 < a Initial program 52.3%
Taylor expanded in a around inf 38.6%
associate-/l*70.7%
associate-+r+70.7%
Simplified70.7%
if -4.7999999999999996e217 < a < -7.1999999999999996e-13Initial program 64.3%
Taylor expanded in y around inf 69.1%
if -7.1999999999999996e-13 < a < -5.59999999999999976e-74Initial program 80.5%
Taylor expanded in a around inf 58.7%
Taylor expanded in x around 0 59.7%
mul-1-neg59.7%
unsub-neg59.7%
*-commutative59.7%
Simplified59.7%
if -5.59999999999999976e-74 < a < 1.80000000000000017e-33Initial program 66.1%
Taylor expanded in b around 0 66.1%
mul-1-neg66.1%
+-commutative66.1%
unsub-neg66.1%
+-commutative66.1%
associate-/l*85.2%
fma-define85.2%
+-commutative85.2%
associate-+r+85.2%
associate-/l*85.2%
associate-+r+85.2%
Simplified95.7%
Taylor expanded in x around inf 67.2%
Final simplification68.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (/ b (+ y (+ x t))))))
(if (or (<= t -5e-33) (not (<= t 14000000000000.0)))
(- (+ a (* y (/ z (+ y t)))) t_1)
(- (+ z (* a (/ y (+ y x)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b / (y + (x + t)));
double tmp;
if ((t <= -5e-33) || !(t <= 14000000000000.0)) {
tmp = (a + (y * (z / (y + t)))) - t_1;
} else {
tmp = (z + (a * (y / (y + x)))) - 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 * (b / (y + (x + t)))
if ((t <= (-5d-33)) .or. (.not. (t <= 14000000000000.0d0))) then
tmp = (a + (y * (z / (y + t)))) - t_1
else
tmp = (z + (a * (y / (y + x)))) - 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 * (b / (y + (x + t)));
double tmp;
if ((t <= -5e-33) || !(t <= 14000000000000.0)) {
tmp = (a + (y * (z / (y + t)))) - t_1;
} else {
tmp = (z + (a * (y / (y + x)))) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b / (y + (x + t))) tmp = 0 if (t <= -5e-33) or not (t <= 14000000000000.0): tmp = (a + (y * (z / (y + t)))) - t_1 else: tmp = (z + (a * (y / (y + x)))) - t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b / Float64(y + Float64(x + t)))) tmp = 0.0 if ((t <= -5e-33) || !(t <= 14000000000000.0)) tmp = Float64(Float64(a + Float64(y * Float64(z / Float64(y + t)))) - t_1); else tmp = Float64(Float64(z + Float64(a * Float64(y / Float64(y + x)))) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (b / (y + (x + t))); tmp = 0.0; if ((t <= -5e-33) || ~((t <= 14000000000000.0))) tmp = (a + (y * (z / (y + t)))) - t_1; else tmp = (z + (a * (y / (y + x)))) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -5e-33], N[Not[LessEqual[t, 14000000000000.0]], $MachinePrecision]], N[(N[(a + N[(y * N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(z + N[(a * N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{b}{y + \left(x + t\right)}\\
\mathbf{if}\;t \leq -5 \cdot 10^{-33} \lor \neg \left(t \leq 14000000000000\right):\\
\;\;\;\;\left(a + y \cdot \frac{z}{y + t}\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(z + a \cdot \frac{y}{y + x}\right) - t\_1\\
\end{array}
\end{array}
if t < -5.00000000000000028e-33 or 1.4e13 < t Initial program 55.1%
Taylor expanded in b around 0 55.1%
mul-1-neg55.1%
+-commutative55.1%
unsub-neg55.1%
+-commutative55.1%
associate-/l*69.1%
fma-define69.1%
+-commutative69.1%
associate-+r+69.1%
associate-/l*85.1%
associate-+r+85.1%
Simplified98.8%
Taylor expanded in x around 0 66.5%
associate-/l*83.1%
+-commutative83.1%
Simplified83.1%
if -5.00000000000000028e-33 < t < 1.4e13Initial program 70.3%
Taylor expanded in b around 0 70.3%
mul-1-neg70.3%
+-commutative70.3%
unsub-neg70.3%
+-commutative70.3%
associate-/l*80.1%
fma-define80.1%
+-commutative80.1%
associate-+r+80.1%
associate-/l*88.4%
associate-+r+88.4%
Simplified95.0%
Taylor expanded in t around 0 79.1%
+-commutative79.1%
associate-/l*91.4%
+-commutative91.4%
Simplified91.4%
Final simplification86.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))))
(if (<= z -5.6e+176)
(* z (/ (+ y x) t_1))
(if (<= z 2.4e+137)
(- (+ a (* y (/ z (+ y t)))) (* y (/ b t_1)))
(* z (/ 1.0 (/ t_1 (+ y x))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if (z <= -5.6e+176) {
tmp = z * ((y + x) / t_1);
} else if (z <= 2.4e+137) {
tmp = (a + (y * (z / (y + t)))) - (y * (b / t_1));
} else {
tmp = z * (1.0 / (t_1 / (y + x)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = y + (x + t)
if (z <= (-5.6d+176)) then
tmp = z * ((y + x) / t_1)
else if (z <= 2.4d+137) then
tmp = (a + (y * (z / (y + t)))) - (y * (b / t_1))
else
tmp = z * (1.0d0 / (t_1 / (y + x)))
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 + (x + t);
double tmp;
if (z <= -5.6e+176) {
tmp = z * ((y + x) / t_1);
} else if (z <= 2.4e+137) {
tmp = (a + (y * (z / (y + t)))) - (y * (b / t_1));
} else {
tmp = z * (1.0 / (t_1 / (y + x)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) tmp = 0 if z <= -5.6e+176: tmp = z * ((y + x) / t_1) elif z <= 2.4e+137: tmp = (a + (y * (z / (y + t)))) - (y * (b / t_1)) else: tmp = z * (1.0 / (t_1 / (y + x))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) tmp = 0.0 if (z <= -5.6e+176) tmp = Float64(z * Float64(Float64(y + x) / t_1)); elseif (z <= 2.4e+137) tmp = Float64(Float64(a + Float64(y * Float64(z / Float64(y + t)))) - Float64(y * Float64(b / t_1))); else tmp = Float64(z * Float64(1.0 / Float64(t_1 / Float64(y + x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); tmp = 0.0; if (z <= -5.6e+176) tmp = z * ((y + x) / t_1); elseif (z <= 2.4e+137) tmp = (a + (y * (z / (y + t)))) - (y * (b / t_1)); else tmp = z * (1.0 / (t_1 / (y + x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.6e+176], N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e+137], N[(N[(a + N[(y * N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(1.0 / N[(t$95$1 / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;z \leq -5.6 \cdot 10^{+176}:\\
\;\;\;\;z \cdot \frac{y + x}{t\_1}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+137}:\\
\;\;\;\;\left(a + y \cdot \frac{z}{y + t}\right) - y \cdot \frac{b}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{1}{\frac{t\_1}{y + x}}\\
\end{array}
\end{array}
if z < -5.6000000000000005e176Initial program 25.7%
Taylor expanded in z around inf 26.4%
associate-/l*93.5%
+-commutative93.5%
associate-+r+93.5%
Simplified93.5%
if -5.6000000000000005e176 < z < 2.39999999999999983e137Initial program 71.8%
Taylor expanded in b around 0 71.8%
mul-1-neg71.8%
+-commutative71.8%
unsub-neg71.8%
+-commutative71.8%
associate-/l*75.3%
fma-define75.3%
+-commutative75.3%
associate-+r+75.3%
associate-/l*87.8%
associate-+r+87.8%
Simplified96.7%
Taylor expanded in x around 0 74.7%
associate-/l*77.1%
+-commutative77.1%
Simplified77.1%
if 2.39999999999999983e137 < z Initial program 34.4%
Taylor expanded in z around inf 32.2%
associate-/l*83.2%
+-commutative83.2%
associate-+r+83.2%
Simplified83.2%
clear-num83.3%
inv-pow83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
Applied egg-rr83.3%
unpow-183.3%
Simplified83.3%
Final simplification79.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.5e-42) (not (<= y 4.5e-221))) (- (+ z a) b) a))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.5e-42) || !(y <= 4.5e-221)) {
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 ((y <= (-4.5d-42)) .or. (.not. (y <= 4.5d-221))) 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 ((y <= -4.5e-42) || !(y <= 4.5e-221)) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4.5e-42) or not (y <= 4.5e-221): tmp = (z + a) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4.5e-42) || !(y <= 4.5e-221)) 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 ((y <= -4.5e-42) || ~((y <= 4.5e-221))) tmp = (z + a) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4.5e-42], N[Not[LessEqual[y, 4.5e-221]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{-42} \lor \neg \left(y \leq 4.5 \cdot 10^{-221}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if y < -4.5e-42 or 4.50000000000000026e-221 < y Initial program 53.9%
Taylor expanded in y around inf 66.7%
if -4.5e-42 < y < 4.50000000000000026e-221Initial program 85.4%
Taylor expanded in t around inf 50.6%
Final simplification62.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -3.7e+55) z (if (<= z 7400.0) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.7e+55) {
tmp = z;
} else if (z <= 7400.0) {
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 (z <= (-3.7d+55)) then
tmp = z
else if (z <= 7400.0d0) 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 (z <= -3.7e+55) {
tmp = z;
} else if (z <= 7400.0) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.7e+55: tmp = z elif z <= 7400.0: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.7e+55) tmp = z; elseif (z <= 7400.0) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.7e+55) tmp = z; elseif (z <= 7400.0) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.7e+55], z, If[LessEqual[z, 7400.0], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+55}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 7400:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -3.7000000000000002e55 or 7400 < z Initial program 48.3%
Taylor expanded in x around inf 56.6%
if -3.7000000000000002e55 < z < 7400Initial program 72.5%
Taylor expanded in t around inf 51.2%
Final simplification53.5%
(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 61.9%
Taylor expanded in t around inf 36.9%
Final simplification36.9%
(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 2024080
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:alt
(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)))