
(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 17 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 (/ (* y b) t))
(t_2 (+ x (/ (* y z) t)))
(t_3 (+ 1.0 (+ a t_1)))
(t_4 (/ t_2 (+ (+ a 1.0) t_1)))
(t_5 (* z (+ (/ x (* z t_3)) (/ y (* t t_3))))))
(if (<= t_4 -1e+236)
t_5
(if (<= t_4 2e+306)
(/ t_2 (+ (+ a 1.0) (+ 1.0 (+ (* b (/ y t)) -1.0))))
(if (<= t_4 INFINITY) t_5 (/ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * b) / t;
double t_2 = x + ((y * z) / t);
double t_3 = 1.0 + (a + t_1);
double t_4 = t_2 / ((a + 1.0) + t_1);
double t_5 = z * ((x / (z * t_3)) + (y / (t * t_3)));
double tmp;
if (t_4 <= -1e+236) {
tmp = t_5;
} else if (t_4 <= 2e+306) {
tmp = t_2 / ((a + 1.0) + (1.0 + ((b * (y / t)) + -1.0)));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_5;
} 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 = (y * b) / t;
double t_2 = x + ((y * z) / t);
double t_3 = 1.0 + (a + t_1);
double t_4 = t_2 / ((a + 1.0) + t_1);
double t_5 = z * ((x / (z * t_3)) + (y / (t * t_3)));
double tmp;
if (t_4 <= -1e+236) {
tmp = t_5;
} else if (t_4 <= 2e+306) {
tmp = t_2 / ((a + 1.0) + (1.0 + ((b * (y / t)) + -1.0)));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = t_5;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * b) / t t_2 = x + ((y * z) / t) t_3 = 1.0 + (a + t_1) t_4 = t_2 / ((a + 1.0) + t_1) t_5 = z * ((x / (z * t_3)) + (y / (t * t_3))) tmp = 0 if t_4 <= -1e+236: tmp = t_5 elif t_4 <= 2e+306: tmp = t_2 / ((a + 1.0) + (1.0 + ((b * (y / t)) + -1.0))) elif t_4 <= math.inf: tmp = t_5 else: tmp = z / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * b) / t) t_2 = Float64(x + Float64(Float64(y * z) / t)) t_3 = Float64(1.0 + Float64(a + t_1)) t_4 = Float64(t_2 / Float64(Float64(a + 1.0) + t_1)) t_5 = Float64(z * Float64(Float64(x / Float64(z * t_3)) + Float64(y / Float64(t * t_3)))) tmp = 0.0 if (t_4 <= -1e+236) tmp = t_5; elseif (t_4 <= 2e+306) tmp = Float64(t_2 / Float64(Float64(a + 1.0) + Float64(1.0 + Float64(Float64(b * Float64(y / t)) + -1.0)))); elseif (t_4 <= Inf) tmp = t_5; else tmp = Float64(z / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * b) / t; t_2 = x + ((y * z) / t); t_3 = 1.0 + (a + t_1); t_4 = t_2 / ((a + 1.0) + t_1); t_5 = z * ((x / (z * t_3)) + (y / (t * t_3))); tmp = 0.0; if (t_4 <= -1e+236) tmp = t_5; elseif (t_4 <= 2e+306) tmp = t_2 / ((a + 1.0) + (1.0 + ((b * (y / t)) + -1.0))); elseif (t_4 <= Inf) tmp = t_5; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 / N[(N[(a + 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(z * N[(N[(x / N[(z * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -1e+236], t$95$5, If[LessEqual[t$95$4, 2e+306], N[(t$95$2 / N[(N[(a + 1.0), $MachinePrecision] + N[(1.0 + N[(N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$5, N[(z / b), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := x + \frac{y \cdot z}{t}\\
t_3 := 1 + \left(a + t\_1\right)\\
t_4 := \frac{t\_2}{\left(a + 1\right) + t\_1}\\
t_5 := z \cdot \left(\frac{x}{z \cdot t\_3} + \frac{y}{t \cdot t\_3}\right)\\
\mathbf{if}\;t\_4 \leq -1 \cdot 10^{+236}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;\frac{t\_2}{\left(a + 1\right) + \left(1 + \left(b \cdot \frac{y}{t} + -1\right)\right)}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1.00000000000000005e236 or 2.00000000000000003e306 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 49.0%
+-commutative49.0%
associate-/l*72.0%
fma-define72.0%
+-commutative72.0%
associate-/l*72.0%
fma-define72.0%
Simplified72.0%
Taylor expanded in z around inf 86.7%
if -1.00000000000000005e236 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.00000000000000003e306Initial program 91.5%
*-commutative91.5%
associate-/l*93.4%
Applied egg-rr93.4%
expm1-log1p-u78.7%
expm1-undefine78.7%
log1p-undefine78.7%
add-exp-log93.4%
*-commutative93.4%
Applied egg-rr93.4%
associate--l+93.5%
*-commutative93.5%
Simplified93.5%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 0.0%
+-commutative0.0%
associate-/l*0.2%
fma-define0.2%
+-commutative0.2%
associate-/l*4.4%
fma-define4.4%
Simplified4.4%
Taylor expanded in y around inf 96.2%
Final simplification92.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ 1.0 (fma b (/ y t) a))))
(if (<= (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))) INFINITY)
(fma (/ y t) (/ z t_1) (/ x t_1))
(/ z b))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 + fma(b, (y / t), a);
double tmp;
if (((x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))) <= ((double) INFINITY)) {
tmp = fma((y / t), (z / t_1), (x / t_1));
} else {
tmp = z / b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(1.0 + fma(b, Float64(y / t), a)) tmp = 0.0 if (Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) <= Inf) tmp = fma(Float64(y / t), Float64(z / t_1), Float64(x / t_1)); else tmp = Float64(z / b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 + N[(b * N[(y / t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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], Infinity], N[(N[(y / t), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision] + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 + \mathsf{fma}\left(b, \frac{y}{t}, a\right)\\
\mathbf{if}\;\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t}, \frac{z}{t\_1}, \frac{x}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0Initial program 84.8%
+-commutative84.8%
associate-/l*81.8%
fma-define81.8%
+-commutative81.8%
associate-/l*81.4%
fma-define81.4%
Simplified81.4%
Taylor expanded in z around 0 84.7%
+-commutative84.7%
times-frac88.3%
fma-define88.3%
associate-*r/88.1%
+-commutative88.1%
fma-define88.1%
associate-*r/89.3%
+-commutative89.3%
fma-define89.3%
Simplified89.3%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 0.0%
+-commutative0.0%
associate-/l*0.2%
fma-define0.2%
+-commutative0.2%
associate-/l*4.4%
fma-define4.4%
Simplified4.4%
Taylor expanded in y around inf 96.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t))) (t_2 (/ t_1 (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_2 -1e+236)
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
(if (<= t_2 2e+306)
(/ t_1 (+ (+ a 1.0) (+ 1.0 (+ (* b (/ y t)) -1.0))))
(/ (+ z (/ (* x t) y)) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -1e+236) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_2 <= 2e+306) {
tmp = t_1 / ((a + 1.0) + (1.0 + ((b * (y / t)) + -1.0)));
} else {
tmp = (z + ((x * t) / y)) / 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + ((y * z) / t)
t_2 = t_1 / ((a + 1.0d0) + ((y * b) / t))
if (t_2 <= (-1d+236)) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
else if (t_2 <= 2d+306) then
tmp = t_1 / ((a + 1.0d0) + (1.0d0 + ((b * (y / t)) + (-1.0d0))))
else
tmp = (z + ((x * t) / y)) / b
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);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -1e+236) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_2 <= 2e+306) {
tmp = t_1 / ((a + 1.0) + (1.0 + ((b * (y / t)) + -1.0)));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((y * z) / t) t_2 = t_1 / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_2 <= -1e+236: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) elif t_2 <= 2e+306: tmp = t_1 / ((a + 1.0) + (1.0 + ((b * (y / t)) + -1.0))) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) t_2 = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_2 <= -1e+236) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (t_2 <= 2e+306) tmp = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(1.0 + Float64(Float64(b * Float64(y / t)) + -1.0)))); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + ((y * z) / t); t_2 = t_1 / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_2 <= -1e+236) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); elseif (t_2 <= 2e+306) tmp = t_1 / ((a + 1.0) + (1.0 + ((b * (y / t)) + -1.0))); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+236], 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$2, 2e+306], N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(1.0 + N[(N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t\_1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+236}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;\frac{t\_1}{\left(a + 1\right) + \left(1 + \left(b \cdot \frac{y}{t} + -1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1.00000000000000005e236Initial program 72.3%
associate-/l*86.0%
associate-/l*86.0%
Simplified86.0%
if -1.00000000000000005e236 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.00000000000000003e306Initial program 91.5%
*-commutative91.5%
associate-/l*93.4%
Applied egg-rr93.4%
expm1-log1p-u78.7%
expm1-undefine78.7%
log1p-undefine78.7%
add-exp-log93.4%
*-commutative93.4%
Applied egg-rr93.4%
associate--l+93.5%
*-commutative93.5%
Simplified93.5%
if 2.00000000000000003e306 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 9.0%
+-commutative9.0%
associate-/l*23.1%
fma-define23.1%
+-commutative23.1%
associate-/l*25.6%
fma-define25.6%
Simplified25.6%
Taylor expanded in z around 0 18.7%
+-commutative18.7%
times-frac34.9%
fma-define34.9%
associate-*r/34.7%
+-commutative34.7%
fma-define34.7%
associate-*r/37.0%
+-commutative37.0%
fma-define37.0%
Simplified37.0%
Taylor expanded in b around inf 76.4%
*-commutative76.4%
Simplified76.4%
Final simplification90.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (/ (* y z) t))) (t_2 (/ t_1 (+ (+ a 1.0) (/ (* y b) t)))))
(if (<= t_2 -1e+236)
(/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
(if (<= t_2 2e+306)
(/ t_1 (+ (+ a 1.0) (* b (/ y t))))
(/ (+ z (/ (* x t) y)) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + ((y * z) / t);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -1e+236) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_2 <= 2e+306) {
tmp = t_1 / ((a + 1.0) + (b * (y / t)));
} else {
tmp = (z + ((x * t) / y)) / 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + ((y * z) / t)
t_2 = t_1 / ((a + 1.0d0) + ((y * b) / t))
if (t_2 <= (-1d+236)) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
else if (t_2 <= 2d+306) then
tmp = t_1 / ((a + 1.0d0) + (b * (y / t)))
else
tmp = (z + ((x * t) / y)) / b
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);
double t_2 = t_1 / ((a + 1.0) + ((y * b) / t));
double tmp;
if (t_2 <= -1e+236) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else if (t_2 <= 2e+306) {
tmp = t_1 / ((a + 1.0) + (b * (y / t)));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + ((y * z) / t) t_2 = t_1 / ((a + 1.0) + ((y * b) / t)) tmp = 0 if t_2 <= -1e+236: tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) elif t_2 <= 2e+306: tmp = t_1 / ((a + 1.0) + (b * (y / t))) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(y * z) / t)) t_2 = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t))) tmp = 0.0 if (t_2 <= -1e+236) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); elseif (t_2 <= 2e+306) tmp = Float64(t_1 / Float64(Float64(a + 1.0) + Float64(b * Float64(y / t)))); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + ((y * z) / t); t_2 = t_1 / ((a + 1.0) + ((y * b) / t)); tmp = 0.0; if (t_2 <= -1e+236) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); elseif (t_2 <= 2e+306) tmp = t_1 / ((a + 1.0) + (b * (y / t))); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+236], 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$2, 2e+306], N[(t$95$1 / N[(N[(a + 1.0), $MachinePrecision] + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot z}{t}\\
t_2 := \frac{t\_1}{\left(a + 1\right) + \frac{y \cdot b}{t}}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+236}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;\frac{t\_1}{\left(a + 1\right) + b \cdot \frac{y}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -1.00000000000000005e236Initial program 72.3%
associate-/l*86.0%
associate-/l*86.0%
Simplified86.0%
if -1.00000000000000005e236 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 2.00000000000000003e306Initial program 91.5%
*-commutative91.5%
associate-/l*93.4%
Applied egg-rr93.4%
if 2.00000000000000003e306 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) Initial program 9.0%
+-commutative9.0%
associate-/l*23.1%
fma-define23.1%
+-commutative23.1%
associate-/l*25.6%
fma-define25.6%
Simplified25.6%
Taylor expanded in z around 0 18.7%
+-commutative18.7%
times-frac34.9%
fma-define34.9%
associate-*r/34.7%
+-commutative34.7%
fma-define34.7%
associate-*r/37.0%
+-commutative37.0%
fma-define37.0%
Simplified37.0%
Taylor expanded in b around inf 76.4%
*-commutative76.4%
Simplified76.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (+ a 1.0) -200000.0) (not (<= (+ a 1.0) 1.1))) (/ (+ x (/ (* y z) t)) (+ a (* b (/ y t)))) (/ (+ x (* y (/ z t))) (+ 1.0 (* y (/ b t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a + 1.0) <= -200000.0) || !((a + 1.0) <= 1.1)) {
tmp = (x + ((y * z) / t)) / (a + (b * (y / t)));
} else {
tmp = (x + (y * (z / t))) / (1.0 + (y * (b / 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 (((a + 1.0d0) <= (-200000.0d0)) .or. (.not. ((a + 1.0d0) <= 1.1d0))) then
tmp = (x + ((y * z) / t)) / (a + (b * (y / t)))
else
tmp = (x + (y * (z / t))) / (1.0d0 + (y * (b / 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 (((a + 1.0) <= -200000.0) || !((a + 1.0) <= 1.1)) {
tmp = (x + ((y * z) / t)) / (a + (b * (y / t)));
} else {
tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((a + 1.0) <= -200000.0) or not ((a + 1.0) <= 1.1): tmp = (x + ((y * z) / t)) / (a + (b * (y / t))) else: tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a + 1.0) <= -200000.0) || !(Float64(a + 1.0) <= 1.1)) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + Float64(b * Float64(y / t)))); else tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(1.0 + Float64(y * Float64(b / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((a + 1.0) <= -200000.0) || ~(((a + 1.0) <= 1.1))) tmp = (x + ((y * z) / t)) / (a + (b * (y / t))); else tmp = (x + (y * (z / t))) / (1.0 + (y * (b / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a + 1.0), $MachinePrecision], -200000.0], N[Not[LessEqual[N[(a + 1.0), $MachinePrecision], 1.1]], $MachinePrecision]], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a + 1 \leq -200000 \lor \neg \left(a + 1 \leq 1.1\right):\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + b \cdot \frac{y}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{1 + y \cdot \frac{b}{t}}\\
\end{array}
\end{array}
if (+.f64 a #s(literal 1 binary64)) < -2e5 or 1.1000000000000001 < (+.f64 a #s(literal 1 binary64)) Initial program 74.1%
*-commutative74.1%
associate-/l*73.2%
Applied egg-rr73.2%
Taylor expanded in a around inf 72.4%
if -2e5 < (+.f64 a #s(literal 1 binary64)) < 1.1000000000000001Initial program 80.3%
associate-/l*80.2%
associate-/l*79.5%
Simplified79.5%
Taylor expanded in a around 0 79.5%
Final simplification75.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y (/ z t)))) (t_2 (* y (/ b t))))
(if (or (<= (+ a 1.0) -200000.0) (not (<= (+ a 1.0) 1.0)))
(/ t_1 (+ a t_2))
(/ t_1 (+ 1.0 t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * (z / t));
double t_2 = y * (b / t);
double tmp;
if (((a + 1.0) <= -200000.0) || !((a + 1.0) <= 1.0)) {
tmp = t_1 / (a + t_2);
} else {
tmp = t_1 / (1.0 + t_2);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (y * (z / t))
t_2 = y * (b / t)
if (((a + 1.0d0) <= (-200000.0d0)) .or. (.not. ((a + 1.0d0) <= 1.0d0))) then
tmp = t_1 / (a + t_2)
else
tmp = t_1 / (1.0d0 + t_2)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * (z / t));
double t_2 = y * (b / t);
double tmp;
if (((a + 1.0) <= -200000.0) || !((a + 1.0) <= 1.0)) {
tmp = t_1 / (a + t_2);
} else {
tmp = t_1 / (1.0 + t_2);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * (z / t)) t_2 = y * (b / t) tmp = 0 if ((a + 1.0) <= -200000.0) or not ((a + 1.0) <= 1.0): tmp = t_1 / (a + t_2) else: tmp = t_1 / (1.0 + t_2) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * Float64(z / t))) t_2 = Float64(y * Float64(b / t)) tmp = 0.0 if ((Float64(a + 1.0) <= -200000.0) || !(Float64(a + 1.0) <= 1.0)) tmp = Float64(t_1 / Float64(a + t_2)); else tmp = Float64(t_1 / Float64(1.0 + t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * (z / t)); t_2 = y * (b / t); tmp = 0.0; if (((a + 1.0) <= -200000.0) || ~(((a + 1.0) <= 1.0))) tmp = t_1 / (a + t_2); else tmp = t_1 / (1.0 + t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(a + 1.0), $MachinePrecision], -200000.0], N[Not[LessEqual[N[(a + 1.0), $MachinePrecision], 1.0]], $MachinePrecision]], N[(t$95$1 / N[(a + t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{t}\\
t_2 := y \cdot \frac{b}{t}\\
\mathbf{if}\;a + 1 \leq -200000 \lor \neg \left(a + 1 \leq 1\right):\\
\;\;\;\;\frac{t\_1}{a + t\_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{1 + t\_2}\\
\end{array}
\end{array}
if (+.f64 a #s(literal 1 binary64)) < -2e5 or 1 < (+.f64 a #s(literal 1 binary64)) Initial program 73.7%
associate-/l*69.1%
associate-/l*69.7%
Simplified69.7%
Taylor expanded in a around inf 68.9%
if -2e5 < (+.f64 a #s(literal 1 binary64)) < 1Initial program 80.8%
associate-/l*80.7%
associate-/l*80.0%
Simplified80.0%
Taylor expanded in a around 0 80.0%
Final simplification73.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (/ b t))) (t_2 (+ x (* y (/ z t)))))
(if (<= (+ a 1.0) -200000.0)
(/ t_2 (+ a t_1))
(if (<= (+ a 1.0) 1.0000005)
(/ t_2 (+ 1.0 t_1))
(/ t_2 (+ a (* b (/ y t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b / t);
double t_2 = x + (y * (z / t));
double tmp;
if ((a + 1.0) <= -200000.0) {
tmp = t_2 / (a + t_1);
} else if ((a + 1.0) <= 1.0000005) {
tmp = t_2 / (1.0 + t_1);
} else {
tmp = t_2 / (a + (b * (y / 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) :: t_2
real(8) :: tmp
t_1 = y * (b / t)
t_2 = x + (y * (z / t))
if ((a + 1.0d0) <= (-200000.0d0)) then
tmp = t_2 / (a + t_1)
else if ((a + 1.0d0) <= 1.0000005d0) then
tmp = t_2 / (1.0d0 + t_1)
else
tmp = t_2 / (a + (b * (y / 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 = y * (b / t);
double t_2 = x + (y * (z / t));
double tmp;
if ((a + 1.0) <= -200000.0) {
tmp = t_2 / (a + t_1);
} else if ((a + 1.0) <= 1.0000005) {
tmp = t_2 / (1.0 + t_1);
} else {
tmp = t_2 / (a + (b * (y / t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (b / t) t_2 = x + (y * (z / t)) tmp = 0 if (a + 1.0) <= -200000.0: tmp = t_2 / (a + t_1) elif (a + 1.0) <= 1.0000005: tmp = t_2 / (1.0 + t_1) else: tmp = t_2 / (a + (b * (y / t))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b / t)) t_2 = Float64(x + Float64(y * Float64(z / t))) tmp = 0.0 if (Float64(a + 1.0) <= -200000.0) tmp = Float64(t_2 / Float64(a + t_1)); elseif (Float64(a + 1.0) <= 1.0000005) tmp = Float64(t_2 / Float64(1.0 + t_1)); else tmp = Float64(t_2 / Float64(a + Float64(b * Float64(y / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (b / t); t_2 = x + (y * (z / t)); tmp = 0.0; if ((a + 1.0) <= -200000.0) tmp = t_2 / (a + t_1); elseif ((a + 1.0) <= 1.0000005) tmp = t_2 / (1.0 + t_1); else tmp = t_2 / (a + (b * (y / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a + 1.0), $MachinePrecision], -200000.0], N[(t$95$2 / N[(a + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a + 1.0), $MachinePrecision], 1.0000005], N[(t$95$2 / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$2 / N[(a + N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{b}{t}\\
t_2 := x + y \cdot \frac{z}{t}\\
\mathbf{if}\;a + 1 \leq -200000:\\
\;\;\;\;\frac{t\_2}{a + t\_1}\\
\mathbf{elif}\;a + 1 \leq 1.0000005:\\
\;\;\;\;\frac{t\_2}{1 + t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_2}{a + b \cdot \frac{y}{t}}\\
\end{array}
\end{array}
if (+.f64 a #s(literal 1 binary64)) < -2e5Initial program 77.7%
associate-/l*72.4%
associate-/l*73.6%
Simplified73.6%
Taylor expanded in a around inf 72.8%
if -2e5 < (+.f64 a #s(literal 1 binary64)) < 1.0000005000000001Initial program 80.1%
associate-/l*80.0%
associate-/l*79.3%
Simplified79.3%
Taylor expanded in a around 0 79.3%
if 1.0000005000000001 < (+.f64 a #s(literal 1 binary64)) Initial program 70.6%
*-commutative70.6%
associate-/l*72.1%
Applied egg-rr72.1%
Taylor expanded in a around inf 71.2%
associate-*r/67.1%
*-commutative67.1%
Applied egg-rr67.1%
Final simplification74.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.05e-144) (not (<= t 1.9e-218))) (/ (+ x (/ y (/ t z))) (+ (+ a 1.0) (* y (/ b t)))) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.05e-144) || !(t <= 1.9e-218)) {
tmp = (x + (y / (t / z))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.05d-144)) .or. (.not. (t <= 1.9d-218))) then
tmp = (x + (y / (t / z))) / ((a + 1.0d0) + (y * (b / t)))
else
tmp = (z + ((x * t) / y)) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.05e-144) || !(t <= 1.9e-218)) {
tmp = (x + (y / (t / z))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.05e-144) or not (t <= 1.9e-218): tmp = (x + (y / (t / z))) / ((a + 1.0) + (y * (b / t))) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.05e-144) || !(t <= 1.9e-218)) tmp = Float64(Float64(x + Float64(y / Float64(t / z))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t)))); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.05e-144) || ~((t <= 1.9e-218))) tmp = (x + (y / (t / z))) / ((a + 1.0) + (y * (b / t))); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.05e-144], N[Not[LessEqual[t, 1.9e-218]], $MachinePrecision]], N[(N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-144} \lor \neg \left(t \leq 1.9 \cdot 10^{-218}\right):\\
\;\;\;\;\frac{x + \frac{y}{\frac{t}{z}}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -1.0500000000000001e-144 or 1.8999999999999999e-218 < t Initial program 81.4%
associate-/l*81.9%
associate-/l*83.3%
Simplified83.3%
clear-num83.2%
un-div-inv83.7%
Applied egg-rr83.7%
if -1.0500000000000001e-144 < t < 1.8999999999999999e-218Initial program 56.9%
+-commutative56.9%
associate-/l*40.5%
fma-define40.5%
+-commutative40.5%
associate-/l*34.5%
fma-define34.5%
Simplified34.5%
Taylor expanded in z around 0 65.2%
+-commutative65.2%
times-frac60.8%
fma-define60.8%
associate-*r/58.7%
+-commutative58.7%
fma-define58.7%
associate-*r/58.8%
+-commutative58.8%
fma-define58.8%
Simplified58.8%
Taylor expanded in b around inf 66.0%
*-commutative66.0%
Simplified66.0%
Final simplification80.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.22e-144) (not (<= t 2.1e-218))) (/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t)))) (/ (+ z (/ (* x t) y)) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.22e-144) || !(t <= 2.1e-218)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.22d-144)) .or. (.not. (t <= 2.1d-218))) then
tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
else
tmp = (z + ((x * t) / y)) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.22e-144) || !(t <= 2.1e-218)) {
tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.22e-144) or not (t <= 2.1e-218): tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.22e-144) || !(t <= 2.1e-218)) 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(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.22e-144) || ~((t <= 2.1e-218))) tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t))); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.22e-144], N[Not[LessEqual[t, 2.1e-218]], $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[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.22 \cdot 10^{-144} \lor \neg \left(t \leq 2.1 \cdot 10^{-218}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if t < -1.22e-144 or 2.09999999999999994e-218 < t Initial program 81.4%
associate-/l*81.9%
associate-/l*83.3%
Simplified83.3%
if -1.22e-144 < t < 2.09999999999999994e-218Initial program 56.9%
+-commutative56.9%
associate-/l*40.5%
fma-define40.5%
+-commutative40.5%
associate-/l*34.5%
fma-define34.5%
Simplified34.5%
Taylor expanded in z around 0 65.2%
+-commutative65.2%
times-frac60.8%
fma-define60.8%
associate-*r/58.7%
+-commutative58.7%
fma-define58.7%
associate-*r/58.8%
+-commutative58.8%
fma-define58.8%
Simplified58.8%
Taylor expanded in b around inf 66.0%
*-commutative66.0%
Simplified66.0%
Final simplification80.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.55e+169)
(/ (* x (+ (/ t y) (/ z x))) b)
(if (<= y 5.2e+229)
(/ (+ x (/ (* y z) t)) (+ a (+ 1.0 (* y (/ b t)))))
(/ (+ z (/ (* x t) y)) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.55e+169) {
tmp = (x * ((t / y) + (z / x))) / b;
} else if (y <= 5.2e+229) {
tmp = (x + ((y * z) / t)) / (a + (1.0 + (y * (b / t))));
} else {
tmp = (z + ((x * t) / y)) / 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.55d+169)) then
tmp = (x * ((t / y) + (z / x))) / b
else if (y <= 5.2d+229) then
tmp = (x + ((y * z) / t)) / (a + (1.0d0 + (y * (b / t))))
else
tmp = (z + ((x * t) / y)) / 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.55e+169) {
tmp = (x * ((t / y) + (z / x))) / b;
} else if (y <= 5.2e+229) {
tmp = (x + ((y * z) / t)) / (a + (1.0 + (y * (b / t))));
} else {
tmp = (z + ((x * t) / y)) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.55e+169: tmp = (x * ((t / y) + (z / x))) / b elif y <= 5.2e+229: tmp = (x + ((y * z) / t)) / (a + (1.0 + (y * (b / t)))) else: tmp = (z + ((x * t) / y)) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.55e+169) tmp = Float64(Float64(x * Float64(Float64(t / y) + Float64(z / x))) / b); elseif (y <= 5.2e+229) tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + Float64(1.0 + Float64(y * Float64(b / t))))); else tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.55e+169) tmp = (x * ((t / y) + (z / x))) / b; elseif (y <= 5.2e+229) tmp = (x + ((y * z) / t)) / (a + (1.0 + (y * (b / t)))); else tmp = (z + ((x * t) / y)) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.55e+169], N[(N[(x * N[(N[(t / y), $MachinePrecision] + N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 5.2e+229], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + N[(1.0 + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.55 \cdot 10^{+169}:\\
\;\;\;\;\frac{x \cdot \left(\frac{t}{y} + \frac{z}{x}\right)}{b}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+229}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + \left(1 + y \cdot \frac{b}{t}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\end{array}
\end{array}
if y < -2.55000000000000004e169Initial program 37.9%
+-commutative37.9%
associate-/l*38.3%
fma-define38.3%
+-commutative38.3%
associate-/l*46.3%
fma-define46.3%
Simplified46.3%
Taylor expanded in b around inf 21.9%
Taylor expanded in x around inf 45.9%
*-commutative45.9%
*-commutative45.9%
Simplified45.9%
Taylor expanded in b around 0 69.2%
if -2.55000000000000004e169 < y < 5.2e229Initial program 86.3%
*-commutative86.3%
associate-/l*86.7%
Applied egg-rr86.7%
associate-+l+86.7%
*-un-lft-identity86.7%
fma-define86.7%
*-commutative86.7%
Applied egg-rr86.7%
fma-undefine86.7%
*-commutative86.7%
*-rgt-identity86.7%
associate-*l/86.3%
associate-/l*83.1%
Simplified83.1%
if 5.2e229 < y Initial program 37.2%
+-commutative37.2%
associate-/l*44.5%
fma-define44.5%
+-commutative44.5%
associate-/l*45.4%
fma-define45.4%
Simplified45.4%
Taylor expanded in z around 0 41.2%
+-commutative41.2%
times-frac41.0%
fma-define41.0%
associate-*r/40.6%
+-commutative40.6%
fma-define40.6%
associate-*r/40.6%
+-commutative40.6%
fma-define40.6%
Simplified40.6%
Taylor expanded in b around inf 73.8%
*-commutative73.8%
Simplified73.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ 1.0 (+ a (/ (* y b) t))))))
(if (<= t -1.4e-22)
t_1
(if (<= t 1.02e-16)
(/ (+ z (/ (* x t) y)) b)
(if (<= t 2.25e+159) (* (/ y t) (/ z (+ a 1.0))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 + (a + ((y * b) / t)));
double tmp;
if (t <= -1.4e-22) {
tmp = t_1;
} else if (t <= 1.02e-16) {
tmp = (z + ((x * t) / y)) / b;
} else if (t <= 2.25e+159) {
tmp = (y / t) * (z / (a + 1.0));
} 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 / (1.0d0 + (a + ((y * b) / t)))
if (t <= (-1.4d-22)) then
tmp = t_1
else if (t <= 1.02d-16) then
tmp = (z + ((x * t) / y)) / b
else if (t <= 2.25d+159) then
tmp = (y / t) * (z / (a + 1.0d0))
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 / (1.0 + (a + ((y * b) / t)));
double tmp;
if (t <= -1.4e-22) {
tmp = t_1;
} else if (t <= 1.02e-16) {
tmp = (z + ((x * t) / y)) / b;
} else if (t <= 2.25e+159) {
tmp = (y / t) * (z / (a + 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 + (a + ((y * b) / t))) tmp = 0 if t <= -1.4e-22: tmp = t_1 elif t <= 1.02e-16: tmp = (z + ((x * t) / y)) / b elif t <= 2.25e+159: tmp = (y / t) * (z / (a + 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 + Float64(a + Float64(Float64(y * b) / t)))) tmp = 0.0 if (t <= -1.4e-22) tmp = t_1; elseif (t <= 1.02e-16) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); elseif (t <= 2.25e+159) tmp = Float64(Float64(y / t) * Float64(z / Float64(a + 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 + (a + ((y * b) / t))); tmp = 0.0; if (t <= -1.4e-22) tmp = t_1; elseif (t <= 1.02e-16) tmp = (z + ((x * t) / y)) / b; elseif (t <= 2.25e+159) tmp = (y / t) * (z / (a + 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 + N[(a + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.4e-22], t$95$1, If[LessEqual[t, 1.02e-16], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t, 2.25e+159], N[(N[(y / t), $MachinePrecision] * N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\
\mathbf{if}\;t \leq -1.4 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{-16}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{+159}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.39999999999999997e-22 or 2.25000000000000013e159 < t Initial program 86.4%
+-commutative86.4%
associate-/l*89.4%
fma-define89.4%
+-commutative89.4%
associate-/l*94.4%
fma-define94.4%
Simplified94.4%
Taylor expanded in z around 0 76.1%
if -1.39999999999999997e-22 < t < 1.0200000000000001e-16Initial program 69.3%
+-commutative69.3%
associate-/l*58.4%
fma-define58.3%
+-commutative58.3%
associate-/l*53.3%
fma-define53.3%
Simplified53.3%
Taylor expanded in z around 0 73.8%
+-commutative73.8%
times-frac66.7%
fma-define66.7%
associate-*r/63.9%
+-commutative63.9%
fma-define63.9%
associate-*r/63.9%
+-commutative63.9%
fma-define63.9%
Simplified63.9%
Taylor expanded in b around inf 61.3%
*-commutative61.3%
Simplified61.3%
if 1.0200000000000001e-16 < t < 2.25000000000000013e159Initial program 74.7%
+-commutative74.7%
associate-/l*81.3%
fma-define81.3%
+-commutative81.3%
associate-/l*83.7%
fma-define83.7%
Simplified83.7%
Taylor expanded in y around 0 63.2%
Taylor expanded in z around inf 37.9%
times-frac53.9%
Simplified53.9%
Final simplification65.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= t -1.46e-21)
t_1
(if (<= t 1.26e-16)
(/ (+ z (/ (* x t) y)) b)
(if (<= t 2.25e+159) (* (/ y t) (/ z (+ a 1.0))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (t <= -1.46e-21) {
tmp = t_1;
} else if (t <= 1.26e-16) {
tmp = (z + ((x * t) / y)) / b;
} else if (t <= 2.25e+159) {
tmp = (y / t) * (z / (a + 1.0));
} 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 / (a + 1.0d0)
if (t <= (-1.46d-21)) then
tmp = t_1
else if (t <= 1.26d-16) then
tmp = (z + ((x * t) / y)) / b
else if (t <= 2.25d+159) then
tmp = (y / t) * (z / (a + 1.0d0))
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 / (a + 1.0);
double tmp;
if (t <= -1.46e-21) {
tmp = t_1;
} else if (t <= 1.26e-16) {
tmp = (z + ((x * t) / y)) / b;
} else if (t <= 2.25e+159) {
tmp = (y / t) * (z / (a + 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if t <= -1.46e-21: tmp = t_1 elif t <= 1.26e-16: tmp = (z + ((x * t) / y)) / b elif t <= 2.25e+159: tmp = (y / t) * (z / (a + 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -1.46e-21) tmp = t_1; elseif (t <= 1.26e-16) tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b); elseif (t <= 2.25e+159) tmp = Float64(Float64(y / t) * Float64(z / Float64(a + 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (a + 1.0); tmp = 0.0; if (t <= -1.46e-21) tmp = t_1; elseif (t <= 1.26e-16) tmp = (z + ((x * t) / y)) / b; elseif (t <= 2.25e+159) tmp = (y / t) * (z / (a + 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.46e-21], t$95$1, If[LessEqual[t, 1.26e-16], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[t, 2.25e+159], N[(N[(y / t), $MachinePrecision] * N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -1.46 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.26 \cdot 10^{-16}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{+159}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.46000000000000006e-21 or 2.25000000000000013e159 < t Initial program 86.4%
+-commutative86.4%
associate-/l*89.4%
fma-define89.4%
+-commutative89.4%
associate-/l*94.4%
fma-define94.4%
Simplified94.4%
Taylor expanded in y around 0 72.7%
if -1.46000000000000006e-21 < t < 1.26000000000000001e-16Initial program 69.3%
+-commutative69.3%
associate-/l*58.4%
fma-define58.3%
+-commutative58.3%
associate-/l*53.3%
fma-define53.3%
Simplified53.3%
Taylor expanded in z around 0 73.8%
+-commutative73.8%
times-frac66.7%
fma-define66.7%
associate-*r/63.9%
+-commutative63.9%
fma-define63.9%
associate-*r/63.9%
+-commutative63.9%
fma-define63.9%
Simplified63.9%
Taylor expanded in b around inf 61.3%
*-commutative61.3%
Simplified61.3%
if 1.26000000000000001e-16 < t < 2.25000000000000013e159Initial program 74.7%
+-commutative74.7%
associate-/l*81.3%
fma-define81.3%
+-commutative81.3%
associate-/l*83.7%
fma-define83.7%
Simplified83.7%
Taylor expanded in y around 0 63.2%
Taylor expanded in z around inf 37.9%
times-frac53.9%
Simplified53.9%
Final simplification64.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (+ a 1.0))))
(if (<= t -9.2)
t_1
(if (<= t 4.5e-19)
(/ z b)
(if (<= t 2.25e+159) (* (/ y t) (/ z (+ a 1.0))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (a + 1.0);
double tmp;
if (t <= -9.2) {
tmp = t_1;
} else if (t <= 4.5e-19) {
tmp = z / b;
} else if (t <= 2.25e+159) {
tmp = (y / t) * (z / (a + 1.0));
} 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 / (a + 1.0d0)
if (t <= (-9.2d0)) then
tmp = t_1
else if (t <= 4.5d-19) then
tmp = z / b
else if (t <= 2.25d+159) then
tmp = (y / t) * (z / (a + 1.0d0))
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 / (a + 1.0);
double tmp;
if (t <= -9.2) {
tmp = t_1;
} else if (t <= 4.5e-19) {
tmp = z / b;
} else if (t <= 2.25e+159) {
tmp = (y / t) * (z / (a + 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (a + 1.0) tmp = 0 if t <= -9.2: tmp = t_1 elif t <= 4.5e-19: tmp = z / b elif t <= 2.25e+159: tmp = (y / t) * (z / (a + 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(a + 1.0)) tmp = 0.0 if (t <= -9.2) tmp = t_1; elseif (t <= 4.5e-19) tmp = Float64(z / b); elseif (t <= 2.25e+159) tmp = Float64(Float64(y / t) * Float64(z / Float64(a + 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (a + 1.0); tmp = 0.0; if (t <= -9.2) tmp = t_1; elseif (t <= 4.5e-19) tmp = z / b; elseif (t <= 2.25e+159) tmp = (y / t) * (z / (a + 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.2], t$95$1, If[LessEqual[t, 4.5e-19], N[(z / b), $MachinePrecision], If[LessEqual[t, 2.25e+159], N[(N[(y / t), $MachinePrecision] * N[(z / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{a + 1}\\
\mathbf{if}\;t \leq -9.2:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-19}:\\
\;\;\;\;\frac{z}{b}\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{+159}:\\
\;\;\;\;\frac{y}{t} \cdot \frac{z}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.1999999999999993 or 2.25000000000000013e159 < t Initial program 87.0%
+-commutative87.0%
associate-/l*90.1%
fma-define90.1%
+-commutative90.1%
associate-/l*95.2%
fma-define95.2%
Simplified95.2%
Taylor expanded in y around 0 73.9%
if -9.1999999999999993 < t < 4.50000000000000013e-19Initial program 69.0%
+-commutative69.0%
associate-/l*58.2%
fma-define58.2%
+-commutative58.2%
associate-/l*53.2%
fma-define53.2%
Simplified53.2%
Taylor expanded in y around inf 53.8%
if 4.50000000000000013e-19 < t < 2.25000000000000013e159Initial program 75.3%
+-commutative75.3%
associate-/l*81.7%
fma-define81.7%
+-commutative81.7%
associate-/l*84.1%
fma-define84.1%
Simplified84.1%
Taylor expanded in y around 0 61.8%
Taylor expanded in z around inf 37.1%
times-frac52.7%
Simplified52.7%
Final simplification61.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.7e+29) (not (<= b 1.35e+102))) (+ (/ z b) (* t (/ (/ x b) y))) (/ (+ x (/ (* y z) t)) (+ a 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.7e+29) || !(b <= 1.35e+102)) {
tmp = (z / b) + (t * ((x / b) / y));
} else {
tmp = (x + ((y * z) / t)) / (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 ((b <= (-1.7d+29)) .or. (.not. (b <= 1.35d+102))) then
tmp = (z / b) + (t * ((x / b) / y))
else
tmp = (x + ((y * z) / t)) / (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 ((b <= -1.7e+29) || !(b <= 1.35e+102)) {
tmp = (z / b) + (t * ((x / b) / y));
} else {
tmp = (x + ((y * z) / t)) / (a + 1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.7e+29) or not (b <= 1.35e+102): tmp = (z / b) + (t * ((x / b) / y)) else: tmp = (x + ((y * z) / t)) / (a + 1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.7e+29) || !(b <= 1.35e+102)) tmp = Float64(Float64(z / b) + Float64(t * Float64(Float64(x / b) / y))); else tmp = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(a + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.7e+29) || ~((b <= 1.35e+102))) tmp = (z / b) + (t * ((x / b) / y)); else tmp = (x + ((y * z) / t)) / (a + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.7e+29], N[Not[LessEqual[b, 1.35e+102]], $MachinePrecision]], N[(N[(z / b), $MachinePrecision] + N[(t * N[(N[(x / b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(a + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.7 \cdot 10^{+29} \lor \neg \left(b \leq 1.35 \cdot 10^{+102}\right):\\
\;\;\;\;\frac{z}{b} + t \cdot \frac{\frac{x}{b}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{t}}{a + 1}\\
\end{array}
\end{array}
if b < -1.69999999999999991e29 or 1.3500000000000001e102 < b Initial program 60.8%
+-commutative60.8%
associate-/l*56.3%
fma-define56.3%
+-commutative56.3%
associate-/l*56.4%
fma-define56.4%
Simplified56.4%
Taylor expanded in b around inf 34.6%
Taylor expanded in x around inf 50.9%
*-commutative50.9%
*-commutative50.9%
Simplified50.9%
Taylor expanded in x around 0 61.8%
associate-/l*67.5%
associate-/r*71.4%
Simplified71.4%
if -1.69999999999999991e29 < b < 1.3500000000000001e102Initial program 84.8%
+-commutative84.8%
associate-/l*83.0%
fma-define83.0%
+-commutative83.0%
associate-/l*83.0%
fma-define83.0%
Simplified83.0%
Taylor expanded in b around 0 73.2%
Final simplification72.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -0.44) (not (<= t 2.6e+53))) (/ x (+ a 1.0)) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -0.44) || !(t <= 2.6e+53)) {
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 ((t <= (-0.44d0)) .or. (.not. (t <= 2.6d+53))) 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 ((t <= -0.44) || !(t <= 2.6e+53)) {
tmp = x / (a + 1.0);
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -0.44) or not (t <= 2.6e+53): tmp = x / (a + 1.0) else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -0.44) || !(t <= 2.6e+53)) 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 ((t <= -0.44) || ~((t <= 2.6e+53))) tmp = x / (a + 1.0); else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -0.44], N[Not[LessEqual[t, 2.6e+53]], $MachinePrecision]], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.44 \lor \neg \left(t \leq 2.6 \cdot 10^{+53}\right):\\
\;\;\;\;\frac{x}{a + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -0.440000000000000002 or 2.59999999999999998e53 < t Initial program 83.4%
+-commutative83.4%
associate-/l*88.1%
fma-define88.1%
+-commutative88.1%
associate-/l*93.0%
fma-define93.0%
Simplified93.0%
Taylor expanded in y around 0 67.4%
if -0.440000000000000002 < t < 2.59999999999999998e53Initial program 70.9%
+-commutative70.9%
associate-/l*61.6%
fma-define61.5%
+-commutative61.5%
associate-/l*57.3%
fma-define57.3%
Simplified57.3%
Taylor expanded in y around inf 51.4%
Final simplification58.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -14.0) (not (<= t 7e+56))) (/ x a) (/ z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -14.0) || !(t <= 7e+56)) {
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 ((t <= (-14.0d0)) .or. (.not. (t <= 7d+56))) 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 ((t <= -14.0) || !(t <= 7e+56)) {
tmp = x / a;
} else {
tmp = z / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -14.0) or not (t <= 7e+56): tmp = x / a else: tmp = z / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -14.0) || !(t <= 7e+56)) 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 ((t <= -14.0) || ~((t <= 7e+56))) tmp = x / a; else tmp = z / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -14.0], N[Not[LessEqual[t, 7e+56]], $MachinePrecision]], N[(x / a), $MachinePrecision], N[(z / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -14 \lor \neg \left(t \leq 7 \cdot 10^{+56}\right):\\
\;\;\;\;\frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b}\\
\end{array}
\end{array}
if t < -14 or 6.99999999999999999e56 < t Initial program 83.9%
*-commutative83.9%
associate-/l*87.9%
Applied egg-rr87.9%
Taylor expanded in a around inf 55.6%
Taylor expanded in y around 0 40.5%
if -14 < t < 6.99999999999999999e56Initial program 70.6%
+-commutative70.6%
associate-/l*61.4%
fma-define61.4%
+-commutative61.4%
associate-/l*57.9%
fma-define57.9%
Simplified57.9%
Taylor expanded in y around inf 51.0%
Final simplification46.1%
(FPCore (x y z t a b) :precision binary64 (/ x a))
double code(double x, double y, double z, double t, double a, double b) {
return x / 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 = x / a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / a;
}
def code(x, y, z, t, a, b): return x / a
function code(x, y, z, t, a, b) return Float64(x / a) end
function tmp = code(x, y, z, t, a, b) tmp = x / a; end
code[x_, y_, z_, t_, a_, b_] := N[(x / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{a}
\end{array}
Initial program 76.8%
*-commutative76.8%
associate-/l*76.6%
Applied egg-rr76.6%
Taylor expanded in a around inf 51.9%
Taylor expanded in y around 0 25.5%
(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 2024182
(FPCore (x y z t a b)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:alt
(! :herbie-platform default (if (< t -1707385670788761/12500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))) (if (< t 1518483551868623/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ z b) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))))))
(/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))