
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -6700000000000.0) (not (<= z 1.25e+14)))
(+
(/ (- (/ x (/ (- b y) y)) (/ y (/ (pow (- b y) 2.0) (- t a)))) z)
(/ (- t a) (- b y)))
(/ (fma x y (* z (- t a))) (fma z (- b y) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6700000000000.0) || !(z <= 1.25e+14)) {
tmp = (((x / ((b - y) / y)) - (y / (pow((b - y), 2.0) / (t - a)))) / z) + ((t - a) / (b - y));
} else {
tmp = fma(x, y, (z * (t - a))) / fma(z, (b - y), y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6700000000000.0) || !(z <= 1.25e+14)) tmp = Float64(Float64(Float64(Float64(x / Float64(Float64(b - y) / y)) - Float64(y / Float64((Float64(b - y) ^ 2.0) / Float64(t - a)))) / z) + Float64(Float64(t - a) / Float64(b - y))); else tmp = Float64(fma(x, y, Float64(z * Float64(t - a))) / fma(z, Float64(b - y), y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6700000000000.0], N[Not[LessEqual[z, 1.25e+14]], $MachinePrecision]], N[(N[(N[(N[(x / N[(N[(b - y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - N[(y / N[(N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6700000000000 \lor \neg \left(z \leq 1.25 \cdot 10^{+14}\right):\\
\;\;\;\;\frac{\frac{x}{\frac{b - y}{y}} - \frac{y}{\frac{{\left(b - y\right)}^{2}}{t - a}}}{z} + \frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\end{array}
\end{array}
if z < -6.7e12 or 1.25e14 < z Initial program 35.8%
Taylor expanded in z around -inf 78.0%
associate--l+78.0%
mul-1-neg78.0%
distribute-lft-out--78.0%
associate-/l*82.0%
associate-/l*93.1%
div-sub93.9%
Simplified93.9%
if -6.7e12 < z < 1.25e14Initial program 92.2%
fma-def92.2%
+-commutative92.2%
fma-def92.2%
Simplified92.2%
Final simplification93.0%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -3.6e+14) (not (<= z 1.3e+14)))
(+
(/ (- (/ x (/ (- b y) y)) (/ y (/ (pow (- b y) 2.0) (- t a)))) z)
(/ (- t a) (- b y)))
(/ (fma x y (* z (- t a))) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.6e+14) || !(z <= 1.3e+14)) {
tmp = (((x / ((b - y) / y)) - (y / (pow((b - y), 2.0) / (t - a)))) / z) + ((t - a) / (b - y));
} else {
tmp = fma(x, y, (z * (t - a))) / (y + (z * (b - y)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.6e+14) || !(z <= 1.3e+14)) tmp = Float64(Float64(Float64(Float64(x / Float64(Float64(b - y) / y)) - Float64(y / Float64((Float64(b - y) ^ 2.0) / Float64(t - a)))) / z) + Float64(Float64(t - a) / Float64(b - y))); else tmp = Float64(fma(x, y, Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.6e+14], N[Not[LessEqual[z, 1.3e+14]], $MachinePrecision]], N[(N[(N[(N[(x / N[(N[(b - y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - N[(y / N[(N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+14} \lor \neg \left(z \leq 1.3 \cdot 10^{+14}\right):\\
\;\;\;\;\frac{\frac{x}{\frac{b - y}{y}} - \frac{y}{\frac{{\left(b - y\right)}^{2}}{t - a}}}{z} + \frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -3.6e14 or 1.3e14 < z Initial program 35.8%
Taylor expanded in z around -inf 78.0%
associate--l+78.0%
mul-1-neg78.0%
distribute-lft-out--78.0%
associate-/l*82.0%
associate-/l*93.1%
div-sub93.9%
Simplified93.9%
if -3.6e14 < z < 1.3e14Initial program 92.2%
fma-def92.2%
Simplified92.2%
Final simplification93.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -2.25e+55)
(- t_1 (/ x z))
(if (<= z 2.2e+68) (/ (fma x y (* z (- t a))) (+ y (* z (- b y)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -2.25e+55) {
tmp = t_1 - (x / z);
} else if (z <= 2.2e+68) {
tmp = fma(x, y, (z * (t - a))) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -2.25e+55) tmp = Float64(t_1 - Float64(x / z)); elseif (z <= 2.2e+68) tmp = Float64(fma(x, y, Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.25e+55], N[(t$95$1 - N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e+68], N[(N[(x * y + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.25 \cdot 10^{+55}:\\
\;\;\;\;t_1 - \frac{x}{z}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+68}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.24999999999999999e55Initial program 30.4%
Taylor expanded in z around -inf 73.9%
associate--l+73.9%
mul-1-neg73.9%
distribute-lft-out--73.9%
associate-/l*78.8%
associate-/l*91.1%
div-sub92.8%
Simplified92.8%
Taylor expanded in y around inf 88.1%
if -2.24999999999999999e55 < z < 2.19999999999999987e68Initial program 90.9%
fma-def90.9%
Simplified90.9%
if 2.19999999999999987e68 < z Initial program 31.0%
Taylor expanded in z around inf 89.3%
Final simplification90.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- t a)))
(t_2 (+ x (/ t_1 y)))
(t_3 (/ (- t a) (- b y)))
(t_4 (- t_3 (/ x z))))
(if (<= z -1.5e-25)
t_4
(if (<= z -1.45e-141)
t_2
(if (<= z -8.2e-202)
(/ t_1 (+ y (* z (- b y))))
(if (<= z 1e-21) t_2 (if (<= z 1.6e+100) t_4 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (t - a);
double t_2 = x + (t_1 / y);
double t_3 = (t - a) / (b - y);
double t_4 = t_3 - (x / z);
double tmp;
if (z <= -1.5e-25) {
tmp = t_4;
} else if (z <= -1.45e-141) {
tmp = t_2;
} else if (z <= -8.2e-202) {
tmp = t_1 / (y + (z * (b - y)));
} else if (z <= 1e-21) {
tmp = t_2;
} else if (z <= 1.6e+100) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = z * (t - a)
t_2 = x + (t_1 / y)
t_3 = (t - a) / (b - y)
t_4 = t_3 - (x / z)
if (z <= (-1.5d-25)) then
tmp = t_4
else if (z <= (-1.45d-141)) then
tmp = t_2
else if (z <= (-8.2d-202)) then
tmp = t_1 / (y + (z * (b - y)))
else if (z <= 1d-21) then
tmp = t_2
else if (z <= 1.6d+100) then
tmp = t_4
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (t - a);
double t_2 = x + (t_1 / y);
double t_3 = (t - a) / (b - y);
double t_4 = t_3 - (x / z);
double tmp;
if (z <= -1.5e-25) {
tmp = t_4;
} else if (z <= -1.45e-141) {
tmp = t_2;
} else if (z <= -8.2e-202) {
tmp = t_1 / (y + (z * (b - y)));
} else if (z <= 1e-21) {
tmp = t_2;
} else if (z <= 1.6e+100) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (t - a) t_2 = x + (t_1 / y) t_3 = (t - a) / (b - y) t_4 = t_3 - (x / z) tmp = 0 if z <= -1.5e-25: tmp = t_4 elif z <= -1.45e-141: tmp = t_2 elif z <= -8.2e-202: tmp = t_1 / (y + (z * (b - y))) elif z <= 1e-21: tmp = t_2 elif z <= 1.6e+100: tmp = t_4 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(t - a)) t_2 = Float64(x + Float64(t_1 / y)) t_3 = Float64(Float64(t - a) / Float64(b - y)) t_4 = Float64(t_3 - Float64(x / z)) tmp = 0.0 if (z <= -1.5e-25) tmp = t_4; elseif (z <= -1.45e-141) tmp = t_2; elseif (z <= -8.2e-202) tmp = Float64(t_1 / Float64(y + Float64(z * Float64(b - y)))); elseif (z <= 1e-21) tmp = t_2; elseif (z <= 1.6e+100) tmp = t_4; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (t - a); t_2 = x + (t_1 / y); t_3 = (t - a) / (b - y); t_4 = t_3 - (x / z); tmp = 0.0; if (z <= -1.5e-25) tmp = t_4; elseif (z <= -1.45e-141) tmp = t_2; elseif (z <= -8.2e-202) tmp = t_1 / (y + (z * (b - y))); elseif (z <= 1e-21) tmp = t_2; elseif (z <= 1.6e+100) tmp = t_4; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e-25], t$95$4, If[LessEqual[z, -1.45e-141], t$95$2, If[LessEqual[z, -8.2e-202], N[(t$95$1 / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-21], t$95$2, If[LessEqual[z, 1.6e+100], t$95$4, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t - a\right)\\
t_2 := x + \frac{t_1}{y}\\
t_3 := \frac{t - a}{b - y}\\
t_4 := t_3 - \frac{x}{z}\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{-25}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-141}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-202}:\\
\;\;\;\;\frac{t_1}{y + z \cdot \left(b - y\right)}\\
\mathbf{elif}\;z \leq 10^{-21}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+100}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -1.4999999999999999e-25 or 9.99999999999999908e-22 < z < 1.5999999999999999e100Initial program 51.4%
Taylor expanded in z around -inf 71.3%
associate--l+71.3%
mul-1-neg71.3%
distribute-lft-out--71.3%
associate-/l*74.4%
associate-/l*86.1%
div-sub87.2%
Simplified87.2%
Taylor expanded in y around inf 81.9%
if -1.4999999999999999e-25 < z < -1.45e-141 or -8.2000000000000008e-202 < z < 9.99999999999999908e-22Initial program 91.0%
Taylor expanded in z around 0 70.6%
Taylor expanded in x around 0 77.6%
if -1.45e-141 < z < -8.2000000000000008e-202Initial program 99.2%
Taylor expanded in x around 0 78.4%
if 1.5999999999999999e100 < z Initial program 30.8%
Taylor expanded in z around inf 90.8%
Final simplification81.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -2.2e+55)
(- t_1 (/ x z))
(if (<= z 1.8e+68)
(/ (+ (* z (- t a)) (* x y)) (+ y (* z (- b y))))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -2.2e+55) {
tmp = t_1 - (x / z);
} else if (z <= 1.8e+68) {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
} 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 = (t - a) / (b - y)
if (z <= (-2.2d+55)) then
tmp = t_1 - (x / z)
else if (z <= 1.8d+68) then
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)))
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 = (t - a) / (b - y);
double tmp;
if (z <= -2.2e+55) {
tmp = t_1 - (x / z);
} else if (z <= 1.8e+68) {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -2.2e+55: tmp = t_1 - (x / z) elif z <= 1.8e+68: tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -2.2e+55) tmp = Float64(t_1 - Float64(x / z)); elseif (z <= 1.8e+68) tmp = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / Float64(y + Float64(z * Float64(b - y)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -2.2e+55) tmp = t_1 - (x / z); elseif (z <= 1.8e+68) tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+55], N[(t$95$1 - N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e+68], N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+55}:\\
\;\;\;\;t_1 - \frac{x}{z}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+68}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.2000000000000001e55Initial program 30.4%
Taylor expanded in z around -inf 73.9%
associate--l+73.9%
mul-1-neg73.9%
distribute-lft-out--73.9%
associate-/l*78.8%
associate-/l*91.1%
div-sub92.8%
Simplified92.8%
Taylor expanded in y around inf 88.1%
if -2.2000000000000001e55 < z < 1.7999999999999999e68Initial program 90.9%
if 1.7999999999999999e68 < z Initial program 31.0%
Taylor expanded in z around inf 89.3%
Final simplification90.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))) (t_2 (- t_1 (/ x z))))
(if (<= z -1.8e-28)
t_2
(if (<= z 3.4e-21)
(+ x (/ (* z (- t a)) y))
(if (<= z 1.9e+100) t_2 t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double t_2 = t_1 - (x / z);
double tmp;
if (z <= -1.8e-28) {
tmp = t_2;
} else if (z <= 3.4e-21) {
tmp = x + ((z * (t - a)) / y);
} else if (z <= 1.9e+100) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (t - a) / (b - y)
t_2 = t_1 - (x / z)
if (z <= (-1.8d-28)) then
tmp = t_2
else if (z <= 3.4d-21) then
tmp = x + ((z * (t - a)) / y)
else if (z <= 1.9d+100) then
tmp = t_2
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 = (t - a) / (b - y);
double t_2 = t_1 - (x / z);
double tmp;
if (z <= -1.8e-28) {
tmp = t_2;
} else if (z <= 3.4e-21) {
tmp = x + ((z * (t - a)) / y);
} else if (z <= 1.9e+100) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) t_2 = t_1 - (x / z) tmp = 0 if z <= -1.8e-28: tmp = t_2 elif z <= 3.4e-21: tmp = x + ((z * (t - a)) / y) elif z <= 1.9e+100: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) t_2 = Float64(t_1 - Float64(x / z)) tmp = 0.0 if (z <= -1.8e-28) tmp = t_2; elseif (z <= 3.4e-21) tmp = Float64(x + Float64(Float64(z * Float64(t - a)) / y)); elseif (z <= 1.9e+100) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); t_2 = t_1 - (x / z); tmp = 0.0; if (z <= -1.8e-28) tmp = t_2; elseif (z <= 3.4e-21) tmp = x + ((z * (t - a)) / y); elseif (z <= 1.9e+100) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e-28], t$95$2, If[LessEqual[z, 3.4e-21], N[(x + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+100], t$95$2, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
t_2 := t_1 - \frac{x}{z}\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{-28}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-21}:\\
\;\;\;\;x + \frac{z \cdot \left(t - a\right)}{y}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+100}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.7999999999999999e-28 or 3.4e-21 < z < 1.89999999999999982e100Initial program 51.4%
Taylor expanded in z around -inf 71.3%
associate--l+71.3%
mul-1-neg71.3%
distribute-lft-out--71.3%
associate-/l*74.4%
associate-/l*86.1%
div-sub87.2%
Simplified87.2%
Taylor expanded in y around inf 81.9%
if -1.7999999999999999e-28 < z < 3.4e-21Initial program 91.7%
Taylor expanded in z around 0 67.2%
Taylor expanded in x around 0 73.6%
if 1.89999999999999982e100 < z Initial program 30.8%
Taylor expanded in z around inf 90.8%
Final simplification79.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a) b)))
(if (<= y -1.2e-47)
x
(if (<= y -1.45e-115)
t_1
(if (<= y -6e-263)
(/ t b)
(if (<= y 1.9e-240)
t_1
(if (<= y 3.2e-180) (/ t b) (if (<= y 2.95e-80) t_1 x))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -a / b;
double tmp;
if (y <= -1.2e-47) {
tmp = x;
} else if (y <= -1.45e-115) {
tmp = t_1;
} else if (y <= -6e-263) {
tmp = t / b;
} else if (y <= 1.9e-240) {
tmp = t_1;
} else if (y <= 3.2e-180) {
tmp = t / b;
} else if (y <= 2.95e-80) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = -a / b
if (y <= (-1.2d-47)) then
tmp = x
else if (y <= (-1.45d-115)) then
tmp = t_1
else if (y <= (-6d-263)) then
tmp = t / b
else if (y <= 1.9d-240) then
tmp = t_1
else if (y <= 3.2d-180) then
tmp = t / b
else if (y <= 2.95d-80) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -a / b;
double tmp;
if (y <= -1.2e-47) {
tmp = x;
} else if (y <= -1.45e-115) {
tmp = t_1;
} else if (y <= -6e-263) {
tmp = t / b;
} else if (y <= 1.9e-240) {
tmp = t_1;
} else if (y <= 3.2e-180) {
tmp = t / b;
} else if (y <= 2.95e-80) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -a / b tmp = 0 if y <= -1.2e-47: tmp = x elif y <= -1.45e-115: tmp = t_1 elif y <= -6e-263: tmp = t / b elif y <= 1.9e-240: tmp = t_1 elif y <= 3.2e-180: tmp = t / b elif y <= 2.95e-80: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-a) / b) tmp = 0.0 if (y <= -1.2e-47) tmp = x; elseif (y <= -1.45e-115) tmp = t_1; elseif (y <= -6e-263) tmp = Float64(t / b); elseif (y <= 1.9e-240) tmp = t_1; elseif (y <= 3.2e-180) tmp = Float64(t / b); elseif (y <= 2.95e-80) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -a / b; tmp = 0.0; if (y <= -1.2e-47) tmp = x; elseif (y <= -1.45e-115) tmp = t_1; elseif (y <= -6e-263) tmp = t / b; elseif (y <= 1.9e-240) tmp = t_1; elseif (y <= 3.2e-180) tmp = t / b; elseif (y <= 2.95e-80) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-a) / b), $MachinePrecision]}, If[LessEqual[y, -1.2e-47], x, If[LessEqual[y, -1.45e-115], t$95$1, If[LessEqual[y, -6e-263], N[(t / b), $MachinePrecision], If[LessEqual[y, 1.9e-240], t$95$1, If[LessEqual[y, 3.2e-180], N[(t / b), $MachinePrecision], If[LessEqual[y, 2.95e-80], t$95$1, x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-a}{b}\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{-47}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{-115}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-263}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-240}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-180}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;y \leq 2.95 \cdot 10^{-80}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.2e-47 or 2.95e-80 < y Initial program 60.0%
Taylor expanded in z around 0 38.3%
if -1.2e-47 < y < -1.4499999999999999e-115 or -6.0000000000000001e-263 < y < 1.89999999999999994e-240 or 3.20000000000000015e-180 < y < 2.95e-80Initial program 69.5%
Taylor expanded in y around 0 72.2%
Taylor expanded in t around 0 56.3%
mul-1-neg56.3%
Simplified56.3%
if -1.4499999999999999e-115 < y < -6.0000000000000001e-263 or 1.89999999999999994e-240 < y < 3.20000000000000015e-180Initial program 77.9%
Taylor expanded in y around 0 67.1%
Taylor expanded in t around inf 47.7%
Final simplification44.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a) b)) (t_2 (/ x (- 1.0 z))))
(if (<= y -4.8e-99)
t_2
(if (<= y -4.2e-265)
(/ t b)
(if (<= y 8.6e-241)
t_1
(if (<= y 2.5e-180) (/ t b) (if (<= y 8.6e-81) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -a / b;
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -4.8e-99) {
tmp = t_2;
} else if (y <= -4.2e-265) {
tmp = t / b;
} else if (y <= 8.6e-241) {
tmp = t_1;
} else if (y <= 2.5e-180) {
tmp = t / b;
} else if (y <= 8.6e-81) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -a / b
t_2 = x / (1.0d0 - z)
if (y <= (-4.8d-99)) then
tmp = t_2
else if (y <= (-4.2d-265)) then
tmp = t / b
else if (y <= 8.6d-241) then
tmp = t_1
else if (y <= 2.5d-180) then
tmp = t / b
else if (y <= 8.6d-81) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -a / b;
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -4.8e-99) {
tmp = t_2;
} else if (y <= -4.2e-265) {
tmp = t / b;
} else if (y <= 8.6e-241) {
tmp = t_1;
} else if (y <= 2.5e-180) {
tmp = t / b;
} else if (y <= 8.6e-81) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -a / b t_2 = x / (1.0 - z) tmp = 0 if y <= -4.8e-99: tmp = t_2 elif y <= -4.2e-265: tmp = t / b elif y <= 8.6e-241: tmp = t_1 elif y <= 2.5e-180: tmp = t / b elif y <= 8.6e-81: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-a) / b) t_2 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -4.8e-99) tmp = t_2; elseif (y <= -4.2e-265) tmp = Float64(t / b); elseif (y <= 8.6e-241) tmp = t_1; elseif (y <= 2.5e-180) tmp = Float64(t / b); elseif (y <= 8.6e-81) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -a / b; t_2 = x / (1.0 - z); tmp = 0.0; if (y <= -4.8e-99) tmp = t_2; elseif (y <= -4.2e-265) tmp = t / b; elseif (y <= 8.6e-241) tmp = t_1; elseif (y <= 2.5e-180) tmp = t / b; elseif (y <= 8.6e-81) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-a) / b), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.8e-99], t$95$2, If[LessEqual[y, -4.2e-265], N[(t / b), $MachinePrecision], If[LessEqual[y, 8.6e-241], t$95$1, If[LessEqual[y, 2.5e-180], N[(t / b), $MachinePrecision], If[LessEqual[y, 8.6e-81], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-a}{b}\\
t_2 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{-99}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-265}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{-241}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-180}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{-81}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -4.8000000000000001e-99 or 8.6000000000000006e-81 < y Initial program 60.3%
fma-def60.4%
Simplified60.4%
fma-def60.3%
sub-neg60.3%
distribute-lft-in60.3%
*-commutative60.3%
associate-+r+60.3%
*-commutative60.3%
Applied egg-rr60.3%
Taylor expanded in y around inf 51.8%
mul-1-neg51.8%
sub-neg51.8%
Simplified51.8%
if -4.8000000000000001e-99 < y < -4.20000000000000007e-265 or 8.5999999999999997e-241 < y < 2.5000000000000001e-180Initial program 78.8%
Taylor expanded in y around 0 65.0%
Taylor expanded in t around inf 45.7%
if -4.20000000000000007e-265 < y < 8.5999999999999997e-241 or 2.5000000000000001e-180 < y < 8.6000000000000006e-81Initial program 68.6%
Taylor expanded in y around 0 77.7%
Taylor expanded in t around 0 59.1%
mul-1-neg59.1%
Simplified59.1%
Final simplification51.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -1.7e+146)
t_1
(if (<= y -7.5e-39)
(+ x (* z (/ t y)))
(if (<= y -7e-39) (/ (- x) z) (if (<= y 5.2e-24) (/ (- t a) b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -1.7e+146) {
tmp = t_1;
} else if (y <= -7.5e-39) {
tmp = x + (z * (t / y));
} else if (y <= -7e-39) {
tmp = -x / z;
} else if (y <= 5.2e-24) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 - z)
if (y <= (-1.7d+146)) then
tmp = t_1
else if (y <= (-7.5d-39)) then
tmp = x + (z * (t / y))
else if (y <= (-7d-39)) then
tmp = -x / z
else if (y <= 5.2d-24) then
tmp = (t - a) / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -1.7e+146) {
tmp = t_1;
} else if (y <= -7.5e-39) {
tmp = x + (z * (t / y));
} else if (y <= -7e-39) {
tmp = -x / z;
} else if (y <= 5.2e-24) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -1.7e+146: tmp = t_1 elif y <= -7.5e-39: tmp = x + (z * (t / y)) elif y <= -7e-39: tmp = -x / z elif y <= 5.2e-24: tmp = (t - a) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -1.7e+146) tmp = t_1; elseif (y <= -7.5e-39) tmp = Float64(x + Float64(z * Float64(t / y))); elseif (y <= -7e-39) tmp = Float64(Float64(-x) / z); elseif (y <= 5.2e-24) tmp = Float64(Float64(t - a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -1.7e+146) tmp = t_1; elseif (y <= -7.5e-39) tmp = x + (z * (t / y)); elseif (y <= -7e-39) tmp = -x / z; elseif (y <= 5.2e-24) tmp = (t - a) / b; 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 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.7e+146], t$95$1, If[LessEqual[y, -7.5e-39], N[(x + N[(z * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7e-39], N[((-x) / z), $MachinePrecision], If[LessEqual[y, 5.2e-24], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{+146}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{-39}:\\
\;\;\;\;x + z \cdot \frac{t}{y}\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-39}:\\
\;\;\;\;\frac{-x}{z}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-24}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.69999999999999995e146 or 5.2e-24 < y Initial program 59.0%
fma-def59.0%
Simplified59.0%
fma-def59.0%
sub-neg59.0%
distribute-lft-in59.0%
*-commutative59.0%
associate-+r+59.0%
*-commutative59.0%
Applied egg-rr59.0%
Taylor expanded in y around inf 62.4%
mul-1-neg62.4%
sub-neg62.4%
Simplified62.4%
if -1.69999999999999995e146 < y < -7.49999999999999971e-39Initial program 62.1%
Taylor expanded in z around 0 54.4%
Taylor expanded in x around 0 57.1%
Taylor expanded in t around inf 52.5%
associate-/l*50.0%
associate-/r/52.5%
Simplified52.5%
if -7.49999999999999971e-39 < y < -6.99999999999999999e-39Initial program 100.0%
Taylor expanded in z around -inf 100.0%
associate--l+100.0%
mul-1-neg100.0%
distribute-lft-out--100.0%
associate-/l*100.0%
associate-/l*100.0%
div-sub100.0%
Simplified100.0%
clear-num100.0%
inv-pow100.0%
sqr-pow0.0%
Applied egg-rr0.0%
pow-sqr100.0%
metadata-eval100.0%
unpow-1100.0%
fma-udef100.0%
cancel-sign-sub-inv100.0%
associate-*r/100.0%
associate-/l*100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
associate-*r/100.0%
mul-1-neg100.0%
Simplified100.0%
if -6.99999999999999999e-39 < y < 5.2e-24Initial program 72.6%
Taylor expanded in y around 0 67.9%
Final simplification63.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -3.4e+148)
t_1
(if (<= y -7.2e-39)
(+ x (/ (* z t) y))
(if (<= y -7e-39) (/ (- x) z) (if (<= y 4.1e-16) (/ (- t a) b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -3.4e+148) {
tmp = t_1;
} else if (y <= -7.2e-39) {
tmp = x + ((z * t) / y);
} else if (y <= -7e-39) {
tmp = -x / z;
} else if (y <= 4.1e-16) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 - z)
if (y <= (-3.4d+148)) then
tmp = t_1
else if (y <= (-7.2d-39)) then
tmp = x + ((z * t) / y)
else if (y <= (-7d-39)) then
tmp = -x / z
else if (y <= 4.1d-16) then
tmp = (t - a) / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -3.4e+148) {
tmp = t_1;
} else if (y <= -7.2e-39) {
tmp = x + ((z * t) / y);
} else if (y <= -7e-39) {
tmp = -x / z;
} else if (y <= 4.1e-16) {
tmp = (t - a) / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -3.4e+148: tmp = t_1 elif y <= -7.2e-39: tmp = x + ((z * t) / y) elif y <= -7e-39: tmp = -x / z elif y <= 4.1e-16: tmp = (t - a) / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -3.4e+148) tmp = t_1; elseif (y <= -7.2e-39) tmp = Float64(x + Float64(Float64(z * t) / y)); elseif (y <= -7e-39) tmp = Float64(Float64(-x) / z); elseif (y <= 4.1e-16) tmp = Float64(Float64(t - a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -3.4e+148) tmp = t_1; elseif (y <= -7.2e-39) tmp = x + ((z * t) / y); elseif (y <= -7e-39) tmp = -x / z; elseif (y <= 4.1e-16) tmp = (t - a) / b; 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 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.4e+148], t$95$1, If[LessEqual[y, -7.2e-39], N[(x + N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7e-39], N[((-x) / z), $MachinePrecision], If[LessEqual[y, 4.1e-16], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -3.4 \cdot 10^{+148}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -7.2 \cdot 10^{-39}:\\
\;\;\;\;x + \frac{z \cdot t}{y}\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-39}:\\
\;\;\;\;\frac{-x}{z}\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-16}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.4000000000000003e148 or 4.10000000000000006e-16 < y Initial program 59.0%
fma-def59.0%
Simplified59.0%
fma-def59.0%
sub-neg59.0%
distribute-lft-in59.0%
*-commutative59.0%
associate-+r+59.0%
*-commutative59.0%
Applied egg-rr59.0%
Taylor expanded in y around inf 62.4%
mul-1-neg62.4%
sub-neg62.4%
Simplified62.4%
if -3.4000000000000003e148 < y < -7.2000000000000001e-39Initial program 62.1%
Taylor expanded in z around 0 54.4%
Taylor expanded in x around 0 57.1%
Taylor expanded in t around inf 52.5%
if -7.2000000000000001e-39 < y < -6.99999999999999999e-39Initial program 100.0%
Taylor expanded in z around -inf 100.0%
associate--l+100.0%
mul-1-neg100.0%
distribute-lft-out--100.0%
associate-/l*100.0%
associate-/l*100.0%
div-sub100.0%
Simplified100.0%
clear-num100.0%
inv-pow100.0%
sqr-pow0.0%
Applied egg-rr0.0%
pow-sqr100.0%
metadata-eval100.0%
unpow-1100.0%
fma-udef100.0%
cancel-sign-sub-inv100.0%
associate-*r/100.0%
associate-/l*100.0%
*-commutative100.0%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
associate-*r/100.0%
mul-1-neg100.0%
Simplified100.0%
if -6.99999999999999999e-39 < y < 4.10000000000000006e-16Initial program 72.6%
Taylor expanded in y around 0 67.9%
Final simplification63.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.1e-26) (not (<= z 1.5e-22))) (/ (- t a) (- b y)) (+ x (/ (* z (- t a)) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.1e-26) || !(z <= 1.5e-22)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((z * (t - a)) / y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-2.1d-26)) .or. (.not. (z <= 1.5d-22))) then
tmp = (t - a) / (b - y)
else
tmp = x + ((z * (t - a)) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.1e-26) || !(z <= 1.5e-22)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((z * (t - a)) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.1e-26) or not (z <= 1.5e-22): tmp = (t - a) / (b - y) else: tmp = x + ((z * (t - a)) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.1e-26) || !(z <= 1.5e-22)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(Float64(z * Float64(t - a)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.1e-26) || ~((z <= 1.5e-22))) tmp = (t - a) / (b - y); else tmp = x + ((z * (t - a)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.1e-26], N[Not[LessEqual[z, 1.5e-22]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-26} \lor \neg \left(z \leq 1.5 \cdot 10^{-22}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot \left(t - a\right)}{y}\\
\end{array}
\end{array}
if z < -2.10000000000000008e-26 or 1.5e-22 < z Initial program 44.8%
Taylor expanded in z around inf 78.6%
if -2.10000000000000008e-26 < z < 1.5e-22Initial program 91.7%
Taylor expanded in z around 0 67.2%
Taylor expanded in x around 0 73.6%
Final simplification76.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.4e-27) (not (<= z 3.2e-23))) (/ (- t a) (- b y)) (+ x (/ (* z t) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.4e-27) || !(z <= 3.2e-23)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((z * t) / y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.4d-27)) .or. (.not. (z <= 3.2d-23))) then
tmp = (t - a) / (b - y)
else
tmp = x + ((z * t) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.4e-27) || !(z <= 3.2e-23)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((z * t) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.4e-27) or not (z <= 3.2e-23): tmp = (t - a) / (b - y) else: tmp = x + ((z * t) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.4e-27) || !(z <= 3.2e-23)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(Float64(z * t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.4e-27) || ~((z <= 3.2e-23))) tmp = (t - a) / (b - y); else tmp = x + ((z * t) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.4e-27], N[Not[LessEqual[z, 3.2e-23]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-27} \lor \neg \left(z \leq 3.2 \cdot 10^{-23}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot t}{y}\\
\end{array}
\end{array}
if z < -1.4e-27 or 3.19999999999999976e-23 < z Initial program 44.8%
Taylor expanded in z around inf 78.6%
if -1.4e-27 < z < 3.19999999999999976e-23Initial program 91.7%
Taylor expanded in z around 0 67.2%
Taylor expanded in x around 0 73.6%
Taylor expanded in t around inf 62.0%
Final simplification70.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7e-39) (not (<= y 6.5e-17))) (/ x (- 1.0 z)) (/ (- t a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7e-39) || !(y <= 6.5e-17)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-7d-39)) .or. (.not. (y <= 6.5d-17))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7e-39) || !(y <= 6.5e-17)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7e-39) or not (y <= 6.5e-17): tmp = x / (1.0 - z) else: tmp = (t - a) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7e-39) || !(y <= 6.5e-17)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -7e-39) || ~((y <= 6.5e-17))) tmp = x / (1.0 - z); else tmp = (t - a) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7e-39], N[Not[LessEqual[y, 6.5e-17]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-39} \lor \neg \left(y \leq 6.5 \cdot 10^{-17}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -6.99999999999999999e-39 or 6.4999999999999996e-17 < y Initial program 60.3%
fma-def60.3%
Simplified60.3%
fma-def60.3%
sub-neg60.3%
distribute-lft-in60.3%
*-commutative60.3%
associate-+r+60.3%
*-commutative60.3%
Applied egg-rr60.3%
Taylor expanded in y around inf 56.2%
mul-1-neg56.2%
sub-neg56.2%
Simplified56.2%
if -6.99999999999999999e-39 < y < 6.4999999999999996e-17Initial program 72.6%
Taylor expanded in y around 0 67.9%
Final simplification62.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.62e-115) x (if (<= y 1.4e-23) (/ t b) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.62e-115) {
tmp = x;
} else if (y <= 1.4e-23) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.62d-115)) then
tmp = x
else if (y <= 1.4d-23) then
tmp = t / b
else
tmp = x
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.62e-115) {
tmp = x;
} else if (y <= 1.4e-23) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.62e-115: tmp = x elif y <= 1.4e-23: tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.62e-115) tmp = x; elseif (y <= 1.4e-23) tmp = Float64(t / b); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.62e-115) tmp = x; elseif (y <= 1.4e-23) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.62e-115], x, If[LessEqual[y, 1.4e-23], N[(t / b), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.62 \cdot 10^{-115}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-23}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.62e-115 or 1.3999999999999999e-23 < y Initial program 62.0%
Taylor expanded in z around 0 37.6%
if -1.62e-115 < y < 1.3999999999999999e-23Initial program 72.2%
Taylor expanded in y around 0 69.8%
Taylor expanded in t around inf 39.6%
Final simplification38.5%
(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 66.4%
Taylor expanded in z around 0 24.6%
Final simplification24.6%
(FPCore (x y z t a b) :precision binary64 (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
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 = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
def code(x, y, z, t, a, b): return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(z * t) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))) - Float64(a / Float64(Float64(b - y) + Float64(y / z)))) end
function tmp = code(x, y, z, t, a, b) tmp = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(z * t), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(N[(b - y), $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}
\end{array}
herbie shell --seed 2023297
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:herbie-target
(- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))