
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
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)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
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)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b): return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_1 (- INFINITY))
(/
1.0
(+ (/ b z) (/ (- (/ t (/ z (+ a 1.0))) (/ b (/ (* z (/ z t)) x))) y)))
(if (<= t_1 -2e-296)
t_1
(if (<= t_1 4e-25)
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
(if (<= t_1 5e+284)
t_1
(/
1.0
(+
(/ b z)
(* t (- (/ (/ (- a -1.0) z) y) (* (/ b y) (/ (/ x z) z))))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = 1.0 / ((b / z) + (((t / (z / (a + 1.0))) - (b / ((z * (z / t)) / x))) / y));
} else if (t_1 <= -2e-296) {
tmp = t_1;
} else if (t_1 <= 4e-25) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_1 <= 5e+284) {
tmp = t_1;
} else {
tmp = 1.0 / ((b / z) + (t * ((((a - -1.0) / z) / y) - ((b / y) * ((x / z) / z)))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = 1.0 / ((b / z) + (((t / (z / (a + 1.0))) - (b / ((z * (z / t)) / x))) / y));
} else if (t_1 <= -2e-296) {
tmp = t_1;
} else if (t_1 <= 4e-25) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_1 <= 5e+284) {
tmp = t_1;
} else {
tmp = 1.0 / ((b / z) + (t * ((((a - -1.0) / z) / y) - ((b / y) * ((x / z) / z)))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) tmp = 0 if t_1 <= -math.inf: tmp = 1.0 / ((b / z) + (((t / (z / (a + 1.0))) - (b / ((z * (z / t)) / x))) / y)) elif t_1 <= -2e-296: tmp = t_1 elif t_1 <= 4e-25: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) elif t_1 <= 5e+284: tmp = t_1 else: tmp = 1.0 / ((b / z) + (t * ((((a - -1.0) / z) / y) - ((b / y) * ((x / z) / z))))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(1.0 / Float64(Float64(b / z) + Float64(Float64(Float64(t / Float64(z / Float64(a + 1.0))) - Float64(b / Float64(Float64(z * Float64(z / t)) / x))) / y))); elseif (t_1 <= -2e-296) tmp = t_1; elseif (t_1 <= 4e-25) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (t_1 <= 5e+284) tmp = t_1; else tmp = Float64(1.0 / Float64(Float64(b / z) + Float64(t * Float64(Float64(Float64(Float64(a - -1.0) / z) / y) - Float64(Float64(b / y) * Float64(Float64(x / z) / z)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); tmp = 0.0; if (t_1 <= -Inf) tmp = 1.0 / ((b / z) + (((t / (z / (a + 1.0))) - (b / ((z * (z / t)) / x))) / y)); elseif (t_1 <= -2e-296) tmp = t_1; elseif (t_1 <= 4e-25) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); elseif (t_1 <= 5e+284) tmp = t_1; else tmp = 1.0 / ((b / z) + (t * ((((a - -1.0) / z) / y) - ((b / y) * ((x / z) / z))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(1.0 / N[(N[(b / z), $MachinePrecision] + N[(N[(N[(t / N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b / N[(N[(z * N[(z / t), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-296], t$95$1, If[LessEqual[t$95$1, 4e-25], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+284], t$95$1, N[(1.0 / N[(N[(b / z), $MachinePrecision] + N[(t * N[(N[(N[(N[(a - -1.0), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision] - N[(N[(b / y), $MachinePrecision] * N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{1}{\frac{b}{z} + \frac{\frac{t}{\frac{z}{a + 1}} - \frac{b}{\frac{z \cdot \frac{z}{t}}{x}}}{y}}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-296}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{-25}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+284}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{b}{z} + t \cdot \left(\frac{\frac{a - -1}{z}}{y} - \frac{b}{y} \cdot \frac{\frac{x}{z}}{z}\right)}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 10.4%
*-commutative10.4%
associate-*l/33.1%
*-commutative33.1%
associate-*l/33.1%
Simplified33.1%
clear-num33.0%
associate-*l/33.1%
*-commutative33.1%
associate-*l/10.4%
*-commutative10.4%
inv-pow10.4%
+-commutative10.4%
*-commutative10.4%
associate-*l/10.4%
*-commutative10.4%
fma-def10.4%
+-commutative10.4%
*-commutative10.4%
associate-*l/33.0%
fma-def33.0%
Applied egg-rr33.0%
unpow-133.0%
+-commutative33.0%
Simplified33.0%
Taylor expanded in y around inf 64.8%
associate--l+64.8%
times-frac87.9%
times-frac87.9%
*-commutative87.9%
unpow287.9%
Simplified87.9%
Taylor expanded in y around 0 82.4%
associate-/l*88.1%
unpow288.1%
associate-/l*88.1%
associate-/r*88.2%
associate-*l/88.2%
Simplified88.2%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2e-296 or 4.00000000000000015e-25 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.9999999999999999e284Initial program 99.8%
if -2e-296 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.00000000000000015e-25Initial program 75.3%
*-commutative75.3%
associate-*l/76.6%
*-commutative76.6%
associate-*l/82.6%
Simplified82.6%
if 4.9999999999999999e284 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 5.1%
*-commutative5.1%
associate-*l/11.8%
*-commutative11.8%
associate-*l/18.5%
Simplified18.5%
clear-num18.4%
associate-*l/11.8%
*-commutative11.8%
associate-*l/5.1%
*-commutative5.1%
inv-pow5.1%
+-commutative5.1%
*-commutative5.1%
associate-*l/5.5%
*-commutative5.5%
fma-def5.5%
+-commutative5.5%
*-commutative5.5%
associate-*l/18.4%
fma-def18.4%
Applied egg-rr18.4%
unpow-118.4%
+-commutative18.4%
Simplified18.4%
Taylor expanded in y around inf 76.6%
associate--l+76.6%
times-frac76.6%
times-frac79.9%
*-commutative79.9%
unpow279.9%
Simplified79.9%
Taylor expanded in t around -inf 76.7%
mul-1-neg76.7%
distribute-rgt-neg-in76.7%
sub-neg76.7%
associate-*r/76.7%
neg-mul-176.7%
*-commutative76.7%
associate-/r*79.9%
distribute-neg-in79.9%
metadata-eval79.9%
unsub-neg79.9%
mul-1-neg79.9%
remove-double-neg79.9%
unpow279.9%
times-frac93.2%
associate-/r*93.2%
Simplified93.2%
Final simplification93.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0))))
(t_2
(/
1.0
(+
(/ b z)
(/ (- (/ t (/ z (+ a 1.0))) (/ b (/ (* z (/ z t)) x))) y)))))
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 -2e-296)
t_1
(if (<= t_1 4e-25)
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
(if (<= t_1 5e+284) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double t_2 = 1.0 / ((b / z) + (((t / (z / (a + 1.0))) - (b / ((z * (z / t)) / x))) / y));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= -2e-296) {
tmp = t_1;
} else if (t_1 <= 4e-25) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_1 <= 5e+284) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double t_2 = 1.0 / ((b / z) + (((t / (z / (a + 1.0))) - (b / ((z * (z / t)) / x))) / y));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= -2e-296) {
tmp = t_1;
} else if (t_1 <= 4e-25) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_1 <= 5e+284) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) t_2 = 1.0 / ((b / z) + (((t / (z / (a + 1.0))) - (b / ((z * (z / t)) / x))) / y)) tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= -2e-296: tmp = t_1 elif t_1 <= 4e-25: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) elif t_1 <= 5e+284: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) t_2 = Float64(1.0 / Float64(Float64(b / z) + Float64(Float64(Float64(t / Float64(z / Float64(a + 1.0))) - Float64(b / Float64(Float64(z * Float64(z / t)) / x))) / y))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= -2e-296) tmp = t_1; elseif (t_1 <= 4e-25) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (t_1 <= 5e+284) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); t_2 = 1.0 / ((b / z) + (((t / (z / (a + 1.0))) - (b / ((z * (z / t)) / x))) / y)); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= -2e-296) tmp = t_1; elseif (t_1 <= 4e-25) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); elseif (t_1 <= 5e+284) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(N[(b / z), $MachinePrecision] + N[(N[(N[(t / N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b / N[(N[(z * N[(z / t), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -2e-296], t$95$1, If[LessEqual[t$95$1, 4e-25], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+284], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
t_2 := \frac{1}{\frac{b}{z} + \frac{\frac{t}{\frac{z}{a + 1}} - \frac{b}{\frac{z \cdot \frac{z}{t}}{x}}}{y}}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-296}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{-25}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+284}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0 or 4.9999999999999999e284 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 7.0%
*-commutative7.0%
associate-*l/19.5%
*-commutative19.5%
associate-*l/23.8%
Simplified23.8%
clear-num23.7%
associate-*l/19.5%
*-commutative19.5%
associate-*l/7.0%
*-commutative7.0%
inv-pow7.0%
+-commutative7.0%
*-commutative7.0%
associate-*l/7.3%
*-commutative7.3%
fma-def7.3%
+-commutative7.3%
*-commutative7.3%
associate-*l/23.7%
fma-def23.7%
Applied egg-rr23.7%
unpow-123.7%
+-commutative23.7%
Simplified23.7%
Taylor expanded in y around inf 72.3%
associate--l+72.3%
times-frac80.7%
times-frac82.8%
*-commutative82.8%
unpow282.8%
Simplified82.8%
Taylor expanded in y around 0 82.9%
associate-/l*82.8%
unpow282.8%
associate-/l*85.0%
associate-/r*91.4%
associate-*l/91.4%
Simplified91.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2e-296 or 4.00000000000000015e-25 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.9999999999999999e284Initial program 99.8%
if -2e-296 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.00000000000000015e-25Initial program 75.3%
*-commutative75.3%
associate-*l/76.6%
*-commutative76.6%
associate-*l/82.6%
Simplified82.6%
Final simplification93.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
(if (<= t_1 (- INFINITY))
(/ (+ z (/ t (/ y x))) b)
(if (<= t_1 -2e-296)
t_1
(if (<= t_1 4e-25)
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
(if (<= t_1 5e+284) t_1 (/ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (z + (t / (y / x))) / b;
} else if (t_1 <= -2e-296) {
tmp = t_1;
} else if (t_1 <= 4e-25) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_1 <= 5e+284) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (z + (t / (y / x))) / b;
} else if (t_1 <= -2e-296) {
tmp = t_1;
} else if (t_1 <= 4e-25) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_1 <= 5e+284) {
tmp = t_1;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)) tmp = 0 if t_1 <= -math.inf: tmp = (z + (t / (y / x))) / b elif t_1 <= -2e-296: tmp = t_1 elif t_1 <= 4e-25: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) elif t_1 <= 5e+284: tmp = t_1 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); elseif (t_1 <= -2e-296) tmp = t_1; elseif (t_1 <= 4e-25) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (t_1 <= 5e+284) tmp = t_1; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0)); tmp = 0.0; if (t_1 <= -Inf) tmp = (z + (t / (y / x))) / b; elseif (t_1 <= -2e-296) tmp = t_1; elseif (t_1 <= 4e-25) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); elseif (t_1 <= 5e+284) tmp = t_1; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t$95$1, -2e-296], t$95$1, If[LessEqual[t$95$1, 4e-25], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+284], t$95$1, N[(z / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{-296}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{-25}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+284}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -inf.0Initial program 10.4%
*-commutative10.4%
associate-*l/33.1%
*-commutative33.1%
associate-*l/33.1%
Simplified33.1%
Taylor expanded in y around inf 24.4%
times-frac24.1%
associate-/l*30.2%
*-commutative30.2%
unpow230.2%
Simplified30.2%
Taylor expanded in b around inf 71.4%
associate-/l*71.4%
Simplified71.4%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < -2e-296 or 4.00000000000000015e-25 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.9999999999999999e284Initial program 99.8%
if -2e-296 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) < 4.00000000000000015e-25Initial program 75.3%
*-commutative75.3%
associate-*l/76.6%
*-commutative76.6%
associate-*l/82.6%
Simplified82.6%
if 4.9999999999999999e284 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a 1) (/.f64 (*.f64 y b) t))) Initial program 5.1%
*-commutative5.1%
associate-*l/11.8%
*-commutative11.8%
associate-*l/18.5%
Simplified18.5%
Taylor expanded in t around 0 81.0%
Final simplification90.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* y (/ z t))) (+ a 1.0))))
(if (<= t -3.6e-85)
t_1
(if (<= t 1.9e-122)
(/ (+ z (/ t (/ y x))) b)
(if (<= t 4.6e-23)
(/ (+ x (* (* y z) (/ 1.0 t))) (+ a 1.0))
(if (<= t 8.4e+40)
(* (/ y t) (/ z (+ 1.0 (+ a (* y (/ b t))))))
t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (y * (z / t))) / (a + 1.0);
double tmp;
if (t <= -3.6e-85) {
tmp = t_1;
} else if (t <= 1.9e-122) {
tmp = (z + (t / (y / x))) / b;
} else if (t <= 4.6e-23) {
tmp = (x + ((y * z) * (1.0 / t))) / (a + 1.0);
} else if (t <= 8.4e+40) {
tmp = (y / t) * (z / (1.0 + (a + (y * (b / 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 = (x + (y * (z / t))) / (a + 1.0d0)
if (t <= (-3.6d-85)) then
tmp = t_1
else if (t <= 1.9d-122) then
tmp = (z + (t / (y / x))) / b
else if (t <= 4.6d-23) then
tmp = (x + ((y * z) * (1.0d0 / t))) / (a + 1.0d0)
else if (t <= 8.4d+40) then
tmp = (y / t) * (z / (1.0d0 + (a + (y * (b / 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 = (x + (y * (z / t))) / (a + 1.0);
double tmp;
if (t <= -3.6e-85) {
tmp = t_1;
} else if (t <= 1.9e-122) {
tmp = (z + (t / (y / x))) / b;
} else if (t <= 4.6e-23) {
tmp = (x + ((y * z) * (1.0 / t))) / (a + 1.0);
} else if (t <= 8.4e+40) {
tmp = (y / t) * (z / (1.0 + (a + (y * (b / t)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (y * (z / t))) / (a + 1.0) tmp = 0 if t <= -3.6e-85: tmp = t_1 elif t <= 1.9e-122: tmp = (z + (t / (y / x))) / b elif t <= 4.6e-23: tmp = (x + ((y * z) * (1.0 / t))) / (a + 1.0) elif t <= 8.4e+40: tmp = (y / t) * (z / (1.0 + (a + (y * (b / t))))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 1.0)) tmp = 0.0 if (t <= -3.6e-85) tmp = t_1; elseif (t <= 1.9e-122) tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); elseif (t <= 4.6e-23) tmp = Float64(Float64(x + Float64(Float64(y * z) * Float64(1.0 / t))) / Float64(a + 1.0)); elseif (t <= 8.4e+40) tmp = Float64(Float64(y / t) * Float64(z / Float64(1.0 + Float64(a + Float64(y * Float64(b / t)))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (y * (z / t))) / (a + 1.0); tmp = 0.0; if (t <= -3.6e-85) tmp = t_1; elseif (t <= 1.9e-122) tmp = (z + (t / (y / x))) / b; elseif (t <= 4.6e-23) tmp = (x + ((y * z) * (1.0 / t))) / (a + 1.0); elseif (t <= 8.4e+40) tmp = (y / t) * (z / (1.0 + (a + (y * (b / t))))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.6e-85], t$95$1, If[LessEqual[t, 1.9e-122], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t, 4.6e-23], N[(N[(x + N[(N[(y * z), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.4e+40], N[(N[(y / t), $MachinePrecision] * N[(z / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{-85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-122}:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-23}:\\
\;\;\;\;\frac{x + \left(y \cdot z\right) \cdot \frac{1}{t}}{a + 1}\\
\mathbf{elif}\;t \leq 8.4 \cdot 10^{+40}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.5999999999999998e-85 or 8.4000000000000004e40 < t Initial program 85.4%
*-commutative85.4%
associate-*l/89.6%
*-commutative89.6%
associate-*l/94.4%
Simplified94.4%
Taylor expanded in b around 0 80.4%
if -3.5999999999999998e-85 < t < 1.9e-122Initial program 58.0%
*-commutative58.0%
associate-*l/47.9%
*-commutative47.9%
associate-*l/42.8%
Simplified42.8%
Taylor expanded in y around inf 53.5%
times-frac48.4%
associate-/l*48.6%
*-commutative48.6%
unpow248.6%
Simplified48.6%
Taylor expanded in b around inf 72.0%
associate-/l*71.9%
Simplified71.9%
if 1.9e-122 < t < 4.6000000000000002e-23Initial program 81.7%
*-commutative81.7%
associate-*l/81.7%
*-commutative81.7%
associate-*l/81.7%
Simplified81.7%
Taylor expanded in b around 0 81.0%
div-inv81.1%
Applied egg-rr81.1%
if 4.6000000000000002e-23 < t < 8.4000000000000004e40Initial program 62.7%
*-commutative62.7%
associate-*l/62.7%
*-commutative62.7%
associate-*l/62.7%
Simplified62.7%
Taylor expanded in x around 0 37.4%
times-frac62.2%
*-commutative62.2%
associate-*r/62.2%
Simplified62.2%
Final simplification76.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -5.2e-176) (not (<= t 1.5e-122))) (/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t)))) (/ (+ z (/ t (/ y x))) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5.2e-176) || !(t <= 1.5e-122)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = (z + (t / (y / x))) / 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 <= (-5.2d-176)) .or. (.not. (t <= 1.5d-122))) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
else
tmp = (z + (t / (y / x))) / 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 <= -5.2e-176) || !(t <= 1.5e-122)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = (z + (t / (y / x))) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -5.2e-176) or not (t <= 1.5e-122): tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) else: tmp = (z + (t / (y / x))) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -5.2e-176) || !(t <= 1.5e-122)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); else tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -5.2e-176) || ~((t <= 1.5e-122))) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); else tmp = (z + (t / (y / x))) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -5.2e-176], N[Not[LessEqual[t, 1.5e-122]], $MachinePrecision]], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{-176} \lor \neg \left(t \leq 1.5 \cdot 10^{-122}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\end{array}
\end{array}
if t < -5.19999999999999984e-176 or 1.50000000000000002e-122 < t Initial program 80.8%
*-commutative80.8%
associate-*l/83.3%
*-commutative83.3%
associate-*l/86.7%
Simplified86.7%
if -5.19999999999999984e-176 < t < 1.50000000000000002e-122Initial program 56.3%
*-commutative56.3%
associate-*l/44.8%
*-commutative44.8%
associate-*l/38.1%
Simplified38.1%
Taylor expanded in y around inf 60.9%
times-frac54.2%
associate-/l*54.3%
*-commutative54.3%
unpow254.3%
Simplified54.3%
Taylor expanded in b around inf 76.6%
associate-/l*76.4%
Simplified76.4%
Final simplification84.4%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= y -2.3e-63)
(not (or (<= y 1900000.0) (and (not (<= y 8.5e+33)) (<= y 5.4e+73)))))
(/ (+ z (/ t (/ y x))) b)
(/ x (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.3e-63) || !((y <= 1900000.0) || (!(y <= 8.5e+33) && (y <= 5.4e+73)))) {
tmp = (z + (t / (y / x))) / b;
} else {
tmp = x / (a + 1.0);
}
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 <= (-2.3d-63)) .or. (.not. (y <= 1900000.0d0) .or. (.not. (y <= 8.5d+33)) .and. (y <= 5.4d+73))) then
tmp = (z + (t / (y / x))) / b
else
tmp = x / (a + 1.0d0)
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 <= -2.3e-63) || !((y <= 1900000.0) || (!(y <= 8.5e+33) && (y <= 5.4e+73)))) {
tmp = (z + (t / (y / x))) / b;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.3e-63) or not ((y <= 1900000.0) or (not (y <= 8.5e+33) and (y <= 5.4e+73))): tmp = (z + (t / (y / x))) / b else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.3e-63) || !((y <= 1900000.0) || (!(y <= 8.5e+33) && (y <= 5.4e+73)))) tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); else tmp = Float64(x / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.3e-63) || ~(((y <= 1900000.0) || (~((y <= 8.5e+33)) && (y <= 5.4e+73))))) tmp = (z + (t / (y / x))) / b; else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.3e-63], N[Not[Or[LessEqual[y, 1900000.0], And[N[Not[LessEqual[y, 8.5e+33]], $MachinePrecision], LessEqual[y, 5.4e+73]]]], $MachinePrecision]], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-63} \lor \neg \left(y \leq 1900000 \lor \neg \left(y \leq 8.5 \cdot 10^{+33}\right) \land y \leq 5.4 \cdot 10^{+73}\right):\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -2.3e-63 or 1.9e6 < y < 8.4999999999999998e33 or 5.3999999999999998e73 < y Initial program 56.5%
*-commutative56.5%
associate-*l/60.2%
*-commutative60.2%
associate-*l/64.5%
Simplified64.5%
Taylor expanded in y around inf 41.6%
times-frac44.5%
associate-/l*47.7%
*-commutative47.7%
unpow247.7%
Simplified47.7%
Taylor expanded in b around inf 55.7%
associate-/l*61.7%
Simplified61.7%
if -2.3e-63 < y < 1.9e6 or 8.4999999999999998e33 < y < 5.3999999999999998e73Initial program 95.2%
*-commutative95.2%
associate-*l/89.9%
*-commutative89.9%
associate-*l/87.6%
Simplified87.6%
Taylor expanded in t around inf 73.9%
Final simplification67.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ z (/ t (/ y x))) b)))
(if (<= y -2.9e-63)
t_1
(if (<= y 800000.0)
(/ x (+ 1.0 (+ a (* y (/ b t)))))
(if (or (<= y 8.5e+33) (not (<= y 1.95e+73))) t_1 (/ x (+ a 1.0)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + (t / (y / x))) / b;
double tmp;
if (y <= -2.9e-63) {
tmp = t_1;
} else if (y <= 800000.0) {
tmp = x / (1.0 + (a + (y * (b / t))));
} else if ((y <= 8.5e+33) || !(y <= 1.95e+73)) {
tmp = t_1;
} else {
tmp = x / (a + 1.0);
}
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 + (t / (y / x))) / b
if (y <= (-2.9d-63)) then
tmp = t_1
else if (y <= 800000.0d0) then
tmp = x / (1.0d0 + (a + (y * (b / t))))
else if ((y <= 8.5d+33) .or. (.not. (y <= 1.95d+73))) then
tmp = t_1
else
tmp = x / (a + 1.0d0)
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 + (t / (y / x))) / b;
double tmp;
if (y <= -2.9e-63) {
tmp = t_1;
} else if (y <= 800000.0) {
tmp = x / (1.0 + (a + (y * (b / t))));
} else if ((y <= 8.5e+33) || !(y <= 1.95e+73)) {
tmp = t_1;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + (t / (y / x))) / b tmp = 0 if y <= -2.9e-63: tmp = t_1 elif y <= 800000.0: tmp = x / (1.0 + (a + (y * (b / t)))) elif (y <= 8.5e+33) or not (y <= 1.95e+73): tmp = t_1 else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + Float64(t / Float64(y / x))) / b) tmp = 0.0 if (y <= -2.9e-63) tmp = t_1; elseif (y <= 800000.0) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(y * Float64(b / t))))); elseif ((y <= 8.5e+33) || !(y <= 1.95e+73)) tmp = t_1; else tmp = Float64(x / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + (t / (y / x))) / b; tmp = 0.0; if (y <= -2.9e-63) tmp = t_1; elseif (y <= 800000.0) tmp = x / (1.0 + (a + (y * (b / t)))); elseif ((y <= 8.5e+33) || ~((y <= 1.95e+73))) tmp = t_1; else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -2.9e-63], t$95$1, If[LessEqual[y, 800000.0], N[(x / N[(1.0 + N[(a + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 8.5e+33], N[Not[LessEqual[y, 1.95e+73]], $MachinePrecision]], t$95$1, N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{-63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 800000:\\
\;\;\;\;\frac{x}{1 + \left(a + y \cdot \frac{b}{t}\right)}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+33} \lor \neg \left(y \leq 1.95 \cdot 10^{+73}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -2.89999999999999975e-63 or 8e5 < y < 8.4999999999999998e33 or 1.95e73 < y Initial program 56.5%
*-commutative56.5%
associate-*l/60.2%
*-commutative60.2%
associate-*l/64.5%
Simplified64.5%
Taylor expanded in y around inf 41.6%
times-frac44.5%
associate-/l*47.7%
*-commutative47.7%
unpow247.7%
Simplified47.7%
Taylor expanded in b around inf 55.7%
associate-/l*61.7%
Simplified61.7%
if -2.89999999999999975e-63 < y < 8e5Initial program 95.7%
*-commutative95.7%
associate-*l/89.1%
*-commutative89.1%
associate-*l/86.5%
Simplified86.5%
Taylor expanded in x around inf 79.6%
*-commutative79.6%
associate-*r/76.2%
Simplified76.2%
if 8.4999999999999998e33 < y < 1.95e73Initial program 89.7%
*-commutative89.7%
associate-*l/99.8%
*-commutative99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in t around inf 71.6%
Final simplification68.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ z (/ t (/ y x))) b)))
(if (<= y -6e-24)
t_1
(if (<= y 30000000.0)
(/ x (+ 1.0 (+ a (/ (* y b) t))))
(if (or (<= y 8.2e+33) (not (<= y 4.3e+74))) t_1 (/ x (+ a 1.0)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + (t / (y / x))) / b;
double tmp;
if (y <= -6e-24) {
tmp = t_1;
} else if (y <= 30000000.0) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if ((y <= 8.2e+33) || !(y <= 4.3e+74)) {
tmp = t_1;
} else {
tmp = x / (a + 1.0);
}
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 + (t / (y / x))) / b
if (y <= (-6d-24)) then
tmp = t_1
else if (y <= 30000000.0d0) then
tmp = x / (1.0d0 + (a + ((y * b) / t)))
else if ((y <= 8.2d+33) .or. (.not. (y <= 4.3d+74))) then
tmp = t_1
else
tmp = x / (a + 1.0d0)
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 + (t / (y / x))) / b;
double tmp;
if (y <= -6e-24) {
tmp = t_1;
} else if (y <= 30000000.0) {
tmp = x / (1.0 + (a + ((y * b) / t)));
} else if ((y <= 8.2e+33) || !(y <= 4.3e+74)) {
tmp = t_1;
} else {
tmp = x / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + (t / (y / x))) / b tmp = 0 if y <= -6e-24: tmp = t_1 elif y <= 30000000.0: tmp = x / (1.0 + (a + ((y * b) / t))) elif (y <= 8.2e+33) or not (y <= 4.3e+74): tmp = t_1 else: tmp = x / (a + 1.0) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + Float64(t / Float64(y / x))) / b) tmp = 0.0 if (y <= -6e-24) tmp = t_1; elseif (y <= 30000000.0) tmp = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))); elseif ((y <= 8.2e+33) || !(y <= 4.3e+74)) tmp = t_1; else tmp = Float64(x / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + (t / (y / x))) / b; tmp = 0.0; if (y <= -6e-24) tmp = t_1; elseif (y <= 30000000.0) tmp = x / (1.0 + (a + ((y * b) / t))); elseif ((y <= 8.2e+33) || ~((y <= 4.3e+74))) tmp = t_1; else tmp = x / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[y, -6e-24], t$95$1, If[LessEqual[y, 30000000.0], N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 8.2e+33], N[Not[LessEqual[y, 4.3e+74]], $MachinePrecision]], t$95$1, N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\mathbf{if}\;y \leq -6 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 30000000:\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+33} \lor \neg \left(y \leq 4.3 \cdot 10^{+74}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a + 1}\\
\end{array}
\end{array}
if y < -5.99999999999999991e-24 or 3e7 < y < 8.1999999999999999e33 or 4.30000000000000001e74 < y Initial program 55.2%
*-commutative55.2%
associate-*l/58.9%
*-commutative58.9%
associate-*l/64.1%
Simplified64.1%
Taylor expanded in y around inf 42.1%
times-frac45.9%
associate-/l*49.1%
*-commutative49.1%
unpow249.1%
Simplified49.1%
Taylor expanded in b around inf 56.6%
associate-/l*62.7%
Simplified62.7%
if -5.99999999999999991e-24 < y < 3e7Initial program 95.9%
*-commutative95.9%
associate-*l/89.4%
*-commutative89.4%
associate-*l/86.2%
Simplified86.2%
Taylor expanded in x around inf 78.6%
if 8.1999999999999999e33 < y < 4.30000000000000001e74Initial program 89.7%
*-commutative89.7%
associate-*l/99.8%
*-commutative99.8%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in t around inf 71.6%
Final simplification70.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.5e-13)
(/ z b)
(if (<= y 4.6e-268)
(/ x a)
(if (<= y 1700.0)
x
(if (<= y 1e+34)
(/ z b)
(if (<= y 8e+56) x (if (<= y 3.1e+90) (/ x a) (/ z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.5e-13) {
tmp = z / b;
} else if (y <= 4.6e-268) {
tmp = x / a;
} else if (y <= 1700.0) {
tmp = x;
} else if (y <= 1e+34) {
tmp = z / b;
} else if (y <= 8e+56) {
tmp = x;
} else if (y <= 3.1e+90) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.5d-13)) then
tmp = z / b
else if (y <= 4.6d-268) then
tmp = x / a
else if (y <= 1700.0d0) then
tmp = x
else if (y <= 1d+34) then
tmp = z / b
else if (y <= 8d+56) then
tmp = x
else if (y <= 3.1d+90) then
tmp = x / a
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.5e-13) {
tmp = z / b;
} else if (y <= 4.6e-268) {
tmp = x / a;
} else if (y <= 1700.0) {
tmp = x;
} else if (y <= 1e+34) {
tmp = z / b;
} else if (y <= 8e+56) {
tmp = x;
} else if (y <= 3.1e+90) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.5e-13: tmp = z / b elif y <= 4.6e-268: tmp = x / a elif y <= 1700.0: tmp = x elif y <= 1e+34: tmp = z / b elif y <= 8e+56: tmp = x elif y <= 3.1e+90: tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.5e-13) tmp = Float64(z / b); elseif (y <= 4.6e-268) tmp = Float64(x / a); elseif (y <= 1700.0) tmp = x; elseif (y <= 1e+34) tmp = Float64(z / b); elseif (y <= 8e+56) tmp = x; elseif (y <= 3.1e+90) tmp = Float64(x / a); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.5e-13) tmp = z / b; elseif (y <= 4.6e-268) tmp = x / a; elseif (y <= 1700.0) tmp = x; elseif (y <= 1e+34) tmp = z / b; elseif (y <= 8e+56) tmp = x; elseif (y <= 3.1e+90) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.5e-13], N[(z / b), $MachinePrecision], If[LessEqual[y, 4.6e-268], N[(x / a), $MachinePrecision], If[LessEqual[y, 1700.0], x, If[LessEqual[y, 1e+34], N[(z / b), $MachinePrecision], If[LessEqual[y, 8e+56], x, If[LessEqual[y, 3.1e+90], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{-13}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-268}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;y \leq 1700:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 10^{+34}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+56}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+90}:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -1.49999999999999992e-13 or 1700 < y < 9.99999999999999946e33 or 3.09999999999999988e90 < y Initial program 54.5%
*-commutative54.5%
associate-*l/58.4%
*-commutative58.4%
associate-*l/63.8%
Simplified63.8%
Taylor expanded in t around 0 54.8%
if -1.49999999999999992e-13 < y < 4.60000000000000021e-268 or 8.00000000000000074e56 < y < 3.09999999999999988e90Initial program 95.8%
*-commutative95.8%
associate-*l/87.6%
*-commutative87.6%
associate-*l/83.5%
Simplified83.5%
Taylor expanded in x around inf 75.6%
*-commutative75.6%
associate-*r/70.2%
Simplified70.2%
Taylor expanded in a around inf 49.3%
if 4.60000000000000021e-268 < y < 1700 or 9.99999999999999946e33 < y < 8.00000000000000074e56Initial program 93.7%
*-commutative93.7%
associate-*l/92.4%
*-commutative92.4%
associate-*l/90.8%
Simplified90.8%
clear-num89.4%
associate-*l/91.0%
*-commutative91.0%
associate-*l/92.4%
*-commutative92.4%
inv-pow92.4%
+-commutative92.4%
*-commutative92.4%
associate-*l/89.3%
*-commutative89.3%
fma-def89.3%
+-commutative89.3%
*-commutative89.3%
associate-*l/89.4%
fma-def89.4%
Applied egg-rr89.4%
unpow-189.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in y around 0 69.7%
Taylor expanded in a around 0 49.2%
Final simplification51.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x (* y (/ z t))) a)))
(if (<= a -1.0)
t_1
(if (<= a 2.35e-88)
(+ x (* z (/ y t)))
(if (<= a 3.9e+48) (/ z b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (y * (z / t))) / a;
double tmp;
if (a <= -1.0) {
tmp = t_1;
} else if (a <= 2.35e-88) {
tmp = x + (z * (y / t));
} else if (a <= 3.9e+48) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y * (z / t))) / a
if (a <= (-1.0d0)) then
tmp = t_1
else if (a <= 2.35d-88) then
tmp = x + (z * (y / t))
else if (a <= 3.9d+48) then
tmp = z / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + (y * (z / t))) / a;
double tmp;
if (a <= -1.0) {
tmp = t_1;
} else if (a <= 2.35e-88) {
tmp = x + (z * (y / t));
} else if (a <= 3.9e+48) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + (y * (z / t))) / a tmp = 0 if a <= -1.0: tmp = t_1 elif a <= 2.35e-88: tmp = x + (z * (y / t)) elif a <= 3.9e+48: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + Float64(y * Float64(z / t))) / a) tmp = 0.0 if (a <= -1.0) tmp = t_1; elseif (a <= 2.35e-88) tmp = Float64(x + Float64(z * Float64(y / t))); elseif (a <= 3.9e+48) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + (y * (z / t))) / a; tmp = 0.0; if (a <= -1.0) tmp = t_1; elseif (a <= 2.35e-88) tmp = x + (z * (y / t)); elseif (a <= 3.9e+48) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -1.0], t$95$1, If[LessEqual[a, 2.35e-88], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.9e+48], N[(z / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + y \cdot \frac{z}{t}}{a}\\
\mathbf{if}\;a \leq -1:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.35 \cdot 10^{-88}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{elif}\;a \leq 3.9 \cdot 10^{+48}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -1 or 3.9000000000000001e48 < a Initial program 70.7%
*-commutative70.7%
associate-*l/70.7%
*-commutative70.7%
associate-*l/74.7%
Simplified74.7%
Taylor expanded in a around inf 63.0%
if -1 < a < 2.35e-88Initial program 83.5%
*-commutative83.5%
associate-*l/81.1%
*-commutative81.1%
associate-*l/78.6%
Simplified78.6%
Taylor expanded in b around 0 62.7%
Taylor expanded in a around 0 62.4%
associate-*l/62.7%
*-commutative62.7%
Simplified62.7%
if 2.35e-88 < a < 3.9000000000000001e48Initial program 58.2%
*-commutative58.2%
associate-*l/62.3%
*-commutative62.3%
associate-*l/66.6%
Simplified66.6%
Taylor expanded in t around 0 61.0%
Final simplification62.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.5e-85) (not (<= t 4.8e-132))) (/ (+ x (* y (/ z t))) (+ a 1.0)) (/ (+ z (/ t (/ y x))) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.5e-85) || !(t <= 4.8e-132)) {
tmp = (x + (y * (z / t))) / (a + 1.0);
} else {
tmp = (z + (t / (y / x))) / 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 <= (-3.5d-85)) .or. (.not. (t <= 4.8d-132))) then
tmp = (x + (y * (z / t))) / (a + 1.0d0)
else
tmp = (z + (t / (y / x))) / 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 <= -3.5e-85) || !(t <= 4.8e-132)) {
tmp = (x + (y * (z / t))) / (a + 1.0);
} else {
tmp = (z + (t / (y / x))) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.5e-85) or not (t <= 4.8e-132): tmp = (x + (y * (z / t))) / (a + 1.0) else: tmp = (z + (t / (y / x))) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.5e-85) || !(t <= 4.8e-132)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(a + 1.0)); else tmp = Float64(Float64(z + Float64(t / Float64(y / x))) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3.5e-85) || ~((t <= 4.8e-132))) tmp = (x + (y * (z / t))) / (a + 1.0); else tmp = (z + (t / (y / x))) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.5e-85], N[Not[LessEqual[t, 4.8e-132]], $MachinePrecision]], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(t / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-85} \lor \neg \left(t \leq 4.8 \cdot 10^{-132}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{t}{\frac{y}{x}}}{b}\\
\end{array}
\end{array}
if t < -3.49999999999999978e-85 or 4.80000000000000031e-132 < t Initial program 82.6%
*-commutative82.6%
associate-*l/85.9%
*-commutative85.9%
associate-*l/89.6%
Simplified89.6%
Taylor expanded in b around 0 76.0%
if -3.49999999999999978e-85 < t < 4.80000000000000031e-132Initial program 58.0%
*-commutative58.0%
associate-*l/47.9%
*-commutative47.9%
associate-*l/42.8%
Simplified42.8%
Taylor expanded in y around inf 53.5%
times-frac48.4%
associate-/l*48.6%
*-commutative48.6%
unpow248.6%
Simplified48.6%
Taylor expanded in b around inf 72.0%
associate-/l*71.9%
Simplified71.9%
Final simplification74.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.2e-22)
(/ z b)
(if (or (<= y 25000000.0) (and (not (<= y 8e+33)) (<= y 8.1e+74)))
(/ x (+ a 1.0))
(/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.2e-22) {
tmp = z / b;
} else if ((y <= 25000000.0) || (!(y <= 8e+33) && (y <= 8.1e+74))) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2.2d-22)) then
tmp = z / b
else if ((y <= 25000000.0d0) .or. (.not. (y <= 8d+33)) .and. (y <= 8.1d+74)) then
tmp = x / (a + 1.0d0)
else
tmp = z / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.2e-22) {
tmp = z / b;
} else if ((y <= 25000000.0) || (!(y <= 8e+33) && (y <= 8.1e+74))) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.2e-22: tmp = z / b elif (y <= 25000000.0) or (not (y <= 8e+33) and (y <= 8.1e+74)): tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.2e-22) tmp = Float64(z / b); elseif ((y <= 25000000.0) || (!(y <= 8e+33) && (y <= 8.1e+74))) tmp = Float64(x / Float64(a + 1.0)); else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.2e-22) tmp = z / b; elseif ((y <= 25000000.0) || (~((y <= 8e+33)) && (y <= 8.1e+74))) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.2e-22], N[(z / b), $MachinePrecision], If[Or[LessEqual[y, 25000000.0], And[N[Not[LessEqual[y, 8e+33]], $MachinePrecision], LessEqual[y, 8.1e+74]]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-22}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;y \leq 25000000 \lor \neg \left(y \leq 8 \cdot 10^{+33}\right) \land y \leq 8.1 \cdot 10^{+74}:\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if y < -2.2000000000000001e-22 or 2.5e7 < y < 7.9999999999999996e33 or 8.1000000000000003e74 < y Initial program 55.2%
*-commutative55.2%
associate-*l/58.9%
*-commutative58.9%
associate-*l/64.1%
Simplified64.1%
Taylor expanded in t around 0 54.0%
if -2.2000000000000001e-22 < y < 2.5e7 or 7.9999999999999996e33 < y < 8.1000000000000003e74Initial program 95.4%
*-commutative95.4%
associate-*l/90.2%
*-commutative90.2%
associate-*l/87.3%
Simplified87.3%
Taylor expanded in t around inf 72.4%
Final simplification63.2%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.0) (/ x a) (if (<= a 0.88) x (/ x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.0) {
tmp = x / a;
} else if (a <= 0.88) {
tmp = x;
} else {
tmp = x / 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 (a <= (-1.0d0)) then
tmp = x / a
else if (a <= 0.88d0) then
tmp = x
else
tmp = x / 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 (a <= -1.0) {
tmp = x / a;
} else if (a <= 0.88) {
tmp = x;
} else {
tmp = x / a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.0: tmp = x / a elif a <= 0.88: tmp = x else: tmp = x / a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.0) tmp = Float64(x / a); elseif (a <= 0.88) tmp = x; else tmp = Float64(x / a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.0) tmp = x / a; elseif (a <= 0.88) tmp = x; else tmp = x / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.0], N[(x / a), $MachinePrecision], If[LessEqual[a, 0.88], x, N[(x / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1:\\
\;\;\;\;\frac{x}{a}\\
\mathbf{elif}\;a \leq 0.88:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a}\\
\end{array}
\end{array}
if a < -1 or 0.880000000000000004 < a Initial program 69.3%
*-commutative69.3%
associate-*l/69.3%
*-commutative69.3%
associate-*l/73.0%
Simplified73.0%
Taylor expanded in x around inf 53.4%
*-commutative53.4%
associate-*r/54.2%
Simplified54.2%
Taylor expanded in a around inf 47.8%
if -1 < a < 0.880000000000000004Initial program 81.4%
*-commutative81.4%
associate-*l/79.9%
*-commutative79.9%
associate-*l/78.5%
Simplified78.5%
clear-num78.3%
associate-*l/79.8%
*-commutative79.8%
associate-*l/81.2%
*-commutative81.2%
inv-pow81.2%
+-commutative81.2%
*-commutative81.2%
associate-*l/78.3%
*-commutative78.3%
fma-def78.3%
+-commutative78.3%
*-commutative78.3%
associate-*l/78.3%
fma-def78.3%
Applied egg-rr78.3%
unpow-178.3%
+-commutative78.3%
Simplified78.3%
Taylor expanded in y around 0 40.1%
Taylor expanded in a around 0 39.3%
Final simplification43.6%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 75.3%
*-commutative75.3%
associate-*l/74.6%
*-commutative74.6%
associate-*l/75.7%
Simplified75.7%
clear-num75.3%
associate-*l/74.1%
*-commutative74.1%
associate-*l/74.9%
*-commutative74.9%
inv-pow74.9%
+-commutative74.9%
*-commutative74.9%
associate-*l/74.2%
*-commutative74.2%
fma-def74.2%
+-commutative74.2%
*-commutative74.2%
associate-*l/75.3%
fma-def75.3%
Applied egg-rr75.3%
unpow-175.3%
+-commutative75.3%
Simplified75.3%
Taylor expanded in y around 0 43.9%
Taylor expanded in a around 0 21.4%
Final simplification21.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(if (< t -1.3659085366310088e-271)
t_1
(if (< t 3.036967103737246e-130) (/ z b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 * ((x + ((y / t) * z)) * (1.0d0 / ((a + 1.0d0) + ((y / t) * b))))
if (t < (-1.3659085366310088d-271)) then
tmp = t_1
else if (t < 3.036967103737246d-130) then
tmp = z / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
double tmp;
if (t < -1.3659085366310088e-271) {
tmp = t_1;
} else if (t < 3.036967103737246e-130) {
tmp = z / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))) tmp = 0 if t < -1.3659085366310088e-271: tmp = t_1 elif t < 3.036967103737246e-130: tmp = z / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 * Float64(Float64(x + Float64(Float64(y / t) * z)) * Float64(1.0 / Float64(Float64(a + 1.0) + Float64(Float64(y / t) * b))))) tmp = 0.0 if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = Float64(z / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b)))); tmp = 0.0; if (t < -1.3659085366310088e-271) tmp = t_1; elseif (t < 3.036967103737246e-130) tmp = z / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 * N[(N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y / t), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.3659085366310088e-271], t$95$1, If[Less[t, 3.036967103737246e-130], N[(z / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 \cdot \left(\left(x + \frac{y}{t} \cdot z\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\right)\\
\mathbf{if}\;t < -1.3659085366310088 \cdot 10^{-271}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t < 3.036967103737246 \cdot 10^{-130}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023290
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:herbie-target
(if (< t -1.3659085366310088e-271) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b))))) (if (< t 3.036967103737246e-130) (/ z b) (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))