
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ y z) (/ t (- 1.0 z)))) (t_2 (* t_1 x)))
(if (<= t_1 (- INFINITY))
(* y (/ x z))
(if (<= t_1 -4e-197)
t_2
(if (<= t_1 0.0)
(* (/ x z) (+ y t))
(if (<= t_1 2e+290) t_2 (/ y (/ z x))))))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double t_2 = t_1 * x;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = y * (x / z);
} else if (t_1 <= -4e-197) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = (x / z) * (y + t);
} else if (t_1 <= 2e+290) {
tmp = t_2;
} else {
tmp = y / (z / x);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double t_2 = t_1 * x;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y * (x / z);
} else if (t_1 <= -4e-197) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = (x / z) * (y + t);
} else if (t_1 <= 2e+290) {
tmp = t_2;
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) - (t / (1.0 - z)) t_2 = t_1 * x tmp = 0 if t_1 <= -math.inf: tmp = y * (x / z) elif t_1 <= -4e-197: tmp = t_2 elif t_1 <= 0.0: tmp = (x / z) * (y + t) elif t_1 <= 2e+290: tmp = t_2 else: tmp = y / (z / x) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) t_2 = Float64(t_1 * x) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(x / z)); elseif (t_1 <= -4e-197) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(Float64(x / z) * Float64(y + t)); elseif (t_1 <= 2e+290) tmp = t_2; else tmp = Float64(y / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) - (t / (1.0 - z)); t_2 = t_1 * x; tmp = 0.0; if (t_1 <= -Inf) tmp = y * (x / z); elseif (t_1 <= -4e-197) tmp = t_2; elseif (t_1 <= 0.0) tmp = (x / z) * (y + t); elseif (t_1 <= 2e+290) tmp = t_2; else tmp = y / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * x), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -4e-197], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(x / z), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+290], t$95$2, N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
t_2 := t_1 \cdot x\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;t_1 \leq -4 \cdot 10^{-197}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{x}{z} \cdot \left(y + t\right)\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+290}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < -inf.0Initial program 59.9%
sub-neg59.9%
distribute-rgt-in49.4%
fma-def49.4%
distribute-neg-frac49.4%
Applied egg-rr49.4%
Taylor expanded in y around inf 99.8%
associate-*r/99.8%
Simplified99.8%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < -3.9999999999999999e-197 or -0.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < 2.00000000000000012e290Initial program 99.6%
if -3.9999999999999999e-197 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < -0.0Initial program 57.0%
Taylor expanded in z around inf 99.5%
*-commutative99.5%
associate-/l*53.2%
associate-/r/99.7%
cancel-sign-sub-inv99.7%
metadata-eval99.7%
*-lft-identity99.7%
Simplified99.7%
if 2.00000000000000012e290 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) Initial program 60.3%
Taylor expanded in y around inf 94.7%
associate-*l/55.3%
Simplified55.3%
associate-*l/94.7%
associate-*r/99.7%
clear-num99.7%
un-div-inv99.9%
Applied egg-rr99.9%
Final simplification99.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))) (t_2 (* x (- (/ y z) t))))
(if (<= z -2.1e+177)
t_1
(if (<= z -2e+163)
(/ y (/ z x))
(if (<= z -1.2e+158)
t_1
(if (<= z -7.5e-203)
t_2
(if (<= z -7.5e-307)
(/ (* y x) z)
(if (<= z 6.5e+90) t_2 (/ x (/ z t))))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double t_2 = x * ((y / z) - t);
double tmp;
if (z <= -2.1e+177) {
tmp = t_1;
} else if (z <= -2e+163) {
tmp = y / (z / x);
} else if (z <= -1.2e+158) {
tmp = t_1;
} else if (z <= -7.5e-203) {
tmp = t_2;
} else if (z <= -7.5e-307) {
tmp = (y * x) / z;
} else if (z <= 6.5e+90) {
tmp = t_2;
} else {
tmp = x / (z / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (t / z)
t_2 = x * ((y / z) - t)
if (z <= (-2.1d+177)) then
tmp = t_1
else if (z <= (-2d+163)) then
tmp = y / (z / x)
else if (z <= (-1.2d+158)) then
tmp = t_1
else if (z <= (-7.5d-203)) then
tmp = t_2
else if (z <= (-7.5d-307)) then
tmp = (y * x) / z
else if (z <= 6.5d+90) then
tmp = t_2
else
tmp = x / (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double t_2 = x * ((y / z) - t);
double tmp;
if (z <= -2.1e+177) {
tmp = t_1;
} else if (z <= -2e+163) {
tmp = y / (z / x);
} else if (z <= -1.2e+158) {
tmp = t_1;
} else if (z <= -7.5e-203) {
tmp = t_2;
} else if (z <= -7.5e-307) {
tmp = (y * x) / z;
} else if (z <= 6.5e+90) {
tmp = t_2;
} else {
tmp = x / (z / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) t_2 = x * ((y / z) - t) tmp = 0 if z <= -2.1e+177: tmp = t_1 elif z <= -2e+163: tmp = y / (z / x) elif z <= -1.2e+158: tmp = t_1 elif z <= -7.5e-203: tmp = t_2 elif z <= -7.5e-307: tmp = (y * x) / z elif z <= 6.5e+90: tmp = t_2 else: tmp = x / (z / t) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) t_2 = Float64(x * Float64(Float64(y / z) - t)) tmp = 0.0 if (z <= -2.1e+177) tmp = t_1; elseif (z <= -2e+163) tmp = Float64(y / Float64(z / x)); elseif (z <= -1.2e+158) tmp = t_1; elseif (z <= -7.5e-203) tmp = t_2; elseif (z <= -7.5e-307) tmp = Float64(Float64(y * x) / z); elseif (z <= 6.5e+90) tmp = t_2; else tmp = Float64(x / Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); t_2 = x * ((y / z) - t); tmp = 0.0; if (z <= -2.1e+177) tmp = t_1; elseif (z <= -2e+163) tmp = y / (z / x); elseif (z <= -1.2e+158) tmp = t_1; elseif (z <= -7.5e-203) tmp = t_2; elseif (z <= -7.5e-307) tmp = (y * x) / z; elseif (z <= 6.5e+90) tmp = t_2; else tmp = x / (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+177], t$95$1, If[LessEqual[z, -2e+163], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.2e+158], t$95$1, If[LessEqual[z, -7.5e-203], t$95$2, If[LessEqual[z, -7.5e-307], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 6.5e+90], t$95$2, N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
t_2 := x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+177}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2 \cdot 10^{+163}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{+158}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-203}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-307}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+90}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\end{array}
\end{array}
if z < -2.10000000000000013e177 or -1.9999999999999999e163 < z < -1.20000000000000004e158Initial program 84.7%
Taylor expanded in z around inf 79.4%
*-commutative79.4%
associate-/l*82.7%
associate-/r/82.9%
cancel-sign-sub-inv82.9%
metadata-eval82.9%
*-lft-identity82.9%
Simplified82.9%
Taylor expanded in x around 0 79.4%
Taylor expanded in y around 0 57.0%
associate-/l*56.6%
associate-/r/64.0%
Simplified64.0%
if -2.10000000000000013e177 < z < -1.9999999999999999e163Initial program 86.3%
Taylor expanded in y around inf 72.3%
associate-*l/86.3%
Simplified86.3%
associate-*l/72.3%
associate-*r/86.1%
clear-num86.1%
un-div-inv86.3%
Applied egg-rr86.3%
if -1.20000000000000004e158 < z < -7.50000000000000027e-203 or -7.5000000000000006e-307 < z < 6.5000000000000001e90Initial program 94.2%
Taylor expanded in z around 0 79.2%
associate-*l/78.5%
associate-*r*78.5%
neg-mul-178.5%
distribute-rgt-out82.2%
unsub-neg82.2%
Simplified82.2%
if -7.50000000000000027e-203 < z < -7.5000000000000006e-307Initial program 74.5%
Taylor expanded in y around inf 90.2%
if 6.5000000000000001e90 < z Initial program 95.8%
Taylor expanded in z around inf 84.1%
*-commutative84.1%
associate-/l*95.8%
neg-mul-195.8%
Simplified95.8%
Taylor expanded in y around 0 68.8%
Final simplification78.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t (+ z -1.0)))))
(if (<= y -7.5e-78)
(/ y (/ z x))
(if (<= y 2.45e-307)
t_1
(if (<= y 9.8e-232)
(* x (- (/ y z) t))
(if (<= y 8.2e-128)
t_1
(if (<= y 2.6e-72)
(* y (/ x z))
(if (<= y 1.2e+46) t_1 (/ (* y x) z)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / (z + -1.0));
double tmp;
if (y <= -7.5e-78) {
tmp = y / (z / x);
} else if (y <= 2.45e-307) {
tmp = t_1;
} else if (y <= 9.8e-232) {
tmp = x * ((y / z) - t);
} else if (y <= 8.2e-128) {
tmp = t_1;
} else if (y <= 2.6e-72) {
tmp = y * (x / z);
} else if (y <= 1.2e+46) {
tmp = t_1;
} else {
tmp = (y * x) / z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t / (z + (-1.0d0)))
if (y <= (-7.5d-78)) then
tmp = y / (z / x)
else if (y <= 2.45d-307) then
tmp = t_1
else if (y <= 9.8d-232) then
tmp = x * ((y / z) - t)
else if (y <= 8.2d-128) then
tmp = t_1
else if (y <= 2.6d-72) then
tmp = y * (x / z)
else if (y <= 1.2d+46) then
tmp = t_1
else
tmp = (y * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t / (z + -1.0));
double tmp;
if (y <= -7.5e-78) {
tmp = y / (z / x);
} else if (y <= 2.45e-307) {
tmp = t_1;
} else if (y <= 9.8e-232) {
tmp = x * ((y / z) - t);
} else if (y <= 8.2e-128) {
tmp = t_1;
} else if (y <= 2.6e-72) {
tmp = y * (x / z);
} else if (y <= 1.2e+46) {
tmp = t_1;
} else {
tmp = (y * x) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / (z + -1.0)) tmp = 0 if y <= -7.5e-78: tmp = y / (z / x) elif y <= 2.45e-307: tmp = t_1 elif y <= 9.8e-232: tmp = x * ((y / z) - t) elif y <= 8.2e-128: tmp = t_1 elif y <= 2.6e-72: tmp = y * (x / z) elif y <= 1.2e+46: tmp = t_1 else: tmp = (y * x) / z return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / Float64(z + -1.0))) tmp = 0.0 if (y <= -7.5e-78) tmp = Float64(y / Float64(z / x)); elseif (y <= 2.45e-307) tmp = t_1; elseif (y <= 9.8e-232) tmp = Float64(x * Float64(Float64(y / z) - t)); elseif (y <= 8.2e-128) tmp = t_1; elseif (y <= 2.6e-72) tmp = Float64(y * Float64(x / z)); elseif (y <= 1.2e+46) tmp = t_1; else tmp = Float64(Float64(y * x) / z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / (z + -1.0)); tmp = 0.0; if (y <= -7.5e-78) tmp = y / (z / x); elseif (y <= 2.45e-307) tmp = t_1; elseif (y <= 9.8e-232) tmp = x * ((y / z) - t); elseif (y <= 8.2e-128) tmp = t_1; elseif (y <= 2.6e-72) tmp = y * (x / z); elseif (y <= 1.2e+46) tmp = t_1; else tmp = (y * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.5e-78], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45e-307], t$95$1, If[LessEqual[y, 9.8e-232], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e-128], t$95$1, If[LessEqual[y, 2.6e-72], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+46], t$95$1, N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z + -1}\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{-78}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{-307}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-232}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-128}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-72}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+46}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}
\end{array}
if y < -7.50000000000000041e-78Initial program 90.4%
Taylor expanded in y around inf 77.5%
associate-*l/71.8%
Simplified71.8%
associate-*l/77.5%
associate-*r/78.7%
clear-num78.7%
un-div-inv78.8%
Applied egg-rr78.8%
if -7.50000000000000041e-78 < y < 2.4500000000000001e-307 or 9.8000000000000006e-232 < y < 8.1999999999999999e-128 or 2.59999999999999996e-72 < y < 1.20000000000000004e46Initial program 94.4%
Taylor expanded in y around 0 70.9%
associate-*r/70.9%
associate-*r*70.9%
neg-mul-170.9%
associate-*l/74.8%
*-commutative74.8%
neg-mul-174.8%
*-commutative74.8%
associate-*r/74.9%
metadata-eval74.9%
associate-/r*74.9%
neg-mul-174.9%
associate-*r/74.8%
*-rgt-identity74.8%
neg-sub074.8%
associate--r-74.8%
metadata-eval74.8%
Simplified74.8%
if 2.4500000000000001e-307 < y < 9.8000000000000006e-232Initial program 99.9%
Taylor expanded in z around 0 72.2%
associate-*l/86.0%
associate-*r*86.0%
neg-mul-186.0%
distribute-rgt-out86.0%
unsub-neg86.0%
Simplified86.0%
if 8.1999999999999999e-128 < y < 2.59999999999999996e-72Initial program 88.1%
sub-neg88.1%
distribute-rgt-in88.1%
fma-def88.1%
distribute-neg-frac88.1%
Applied egg-rr88.1%
Taylor expanded in y around inf 72.7%
associate-*r/72.7%
Simplified72.7%
if 1.20000000000000004e46 < y Initial program 82.3%
Taylor expanded in y around inf 88.5%
Final simplification79.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) t))) (t_2 (* (/ x z) (+ y t))))
(if (<= z -1.0)
t_2
(if (<= z -7.5e-203)
t_1
(if (<= z 8.8e-302) (/ (* y x) z) (if (<= z 4.6e-6) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - t);
double t_2 = (x / z) * (y + t);
double tmp;
if (z <= -1.0) {
tmp = t_2;
} else if (z <= -7.5e-203) {
tmp = t_1;
} else if (z <= 8.8e-302) {
tmp = (y * x) / z;
} else if (z <= 4.6e-6) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * ((y / z) - t)
t_2 = (x / z) * (y + t)
if (z <= (-1.0d0)) then
tmp = t_2
else if (z <= (-7.5d-203)) then
tmp = t_1
else if (z <= 8.8d-302) then
tmp = (y * x) / z
else if (z <= 4.6d-6) 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 t_1 = x * ((y / z) - t);
double t_2 = (x / z) * (y + t);
double tmp;
if (z <= -1.0) {
tmp = t_2;
} else if (z <= -7.5e-203) {
tmp = t_1;
} else if (z <= 8.8e-302) {
tmp = (y * x) / z;
} else if (z <= 4.6e-6) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - t) t_2 = (x / z) * (y + t) tmp = 0 if z <= -1.0: tmp = t_2 elif z <= -7.5e-203: tmp = t_1 elif z <= 8.8e-302: tmp = (y * x) / z elif z <= 4.6e-6: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - t)) t_2 = Float64(Float64(x / z) * Float64(y + t)) tmp = 0.0 if (z <= -1.0) tmp = t_2; elseif (z <= -7.5e-203) tmp = t_1; elseif (z <= 8.8e-302) tmp = Float64(Float64(y * x) / z); elseif (z <= 4.6e-6) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - t); t_2 = (x / z) * (y + t); tmp = 0.0; if (z <= -1.0) tmp = t_2; elseif (z <= -7.5e-203) tmp = t_1; elseif (z <= 8.8e-302) tmp = (y * x) / z; elseif (z <= 4.6e-6) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / z), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.0], t$95$2, If[LessEqual[z, -7.5e-203], t$95$1, If[LessEqual[z, 8.8e-302], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 4.6e-6], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t\right)\\
t_2 := \frac{x}{z} \cdot \left(y + t\right)\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-203}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-302}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1 or 4.6e-6 < z Initial program 94.1%
Taylor expanded in z around inf 87.5%
*-commutative87.5%
associate-/l*93.1%
associate-/r/86.3%
cancel-sign-sub-inv86.3%
metadata-eval86.3%
*-lft-identity86.3%
Simplified86.3%
if -1 < z < -7.50000000000000027e-203 or 8.8000000000000003e-302 < z < 4.6e-6Initial program 91.1%
Taylor expanded in z around 0 86.6%
associate-*l/84.4%
associate-*r*84.4%
neg-mul-184.4%
distribute-rgt-out90.2%
unsub-neg90.2%
Simplified90.2%
if -7.50000000000000027e-203 < z < 8.8000000000000003e-302Initial program 74.5%
Taylor expanded in y around inf 90.2%
Final simplification88.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) t))) (t_2 (* x (/ (+ y t) z))))
(if (<= z -1.0)
t_2
(if (<= z -1.25e-203)
t_1
(if (<= z 1.35e-305) (/ (* y x) z) (if (<= z 4.6e-6) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - t);
double t_2 = x * ((y + t) / z);
double tmp;
if (z <= -1.0) {
tmp = t_2;
} else if (z <= -1.25e-203) {
tmp = t_1;
} else if (z <= 1.35e-305) {
tmp = (y * x) / z;
} else if (z <= 4.6e-6) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * ((y / z) - t)
t_2 = x * ((y + t) / z)
if (z <= (-1.0d0)) then
tmp = t_2
else if (z <= (-1.25d-203)) then
tmp = t_1
else if (z <= 1.35d-305) then
tmp = (y * x) / z
else if (z <= 4.6d-6) 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 t_1 = x * ((y / z) - t);
double t_2 = x * ((y + t) / z);
double tmp;
if (z <= -1.0) {
tmp = t_2;
} else if (z <= -1.25e-203) {
tmp = t_1;
} else if (z <= 1.35e-305) {
tmp = (y * x) / z;
} else if (z <= 4.6e-6) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - t) t_2 = x * ((y + t) / z) tmp = 0 if z <= -1.0: tmp = t_2 elif z <= -1.25e-203: tmp = t_1 elif z <= 1.35e-305: tmp = (y * x) / z elif z <= 4.6e-6: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - t)) t_2 = Float64(x * Float64(Float64(y + t) / z)) tmp = 0.0 if (z <= -1.0) tmp = t_2; elseif (z <= -1.25e-203) tmp = t_1; elseif (z <= 1.35e-305) tmp = Float64(Float64(y * x) / z); elseif (z <= 4.6e-6) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - t); t_2 = x * ((y + t) / z); tmp = 0.0; if (z <= -1.0) tmp = t_2; elseif (z <= -1.25e-203) tmp = t_1; elseif (z <= 1.35e-305) tmp = (y * x) / z; elseif (z <= 4.6e-6) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.0], t$95$2, If[LessEqual[z, -1.25e-203], t$95$1, If[LessEqual[z, 1.35e-305], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 4.6e-6], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t\right)\\
t_2 := x \cdot \frac{y + t}{z}\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-203}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-305}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1 or 4.6e-6 < z Initial program 94.1%
Taylor expanded in z around inf 87.5%
associate-/l*85.8%
associate-/r/93.5%
cancel-sign-sub-inv93.5%
metadata-eval93.5%
*-lft-identity93.5%
Simplified93.5%
if -1 < z < -1.25e-203 or 1.35e-305 < z < 4.6e-6Initial program 91.1%
Taylor expanded in z around 0 86.6%
associate-*l/84.4%
associate-*r*84.4%
neg-mul-184.4%
distribute-rgt-out90.2%
unsub-neg90.2%
Simplified90.2%
if -1.25e-203 < z < 1.35e-305Initial program 74.5%
Taylor expanded in y around inf 90.2%
Final simplification92.0%
(FPCore (x y z t)
:precision binary64
(if (or (<= t -2.35e+107)
(and (not (<= t -2.2)) (or (<= t -1.85e-13) (not (<= t 1.4e+172)))))
(* x (/ t z))
(* y (/ x z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.35e+107) || (!(t <= -2.2) && ((t <= -1.85e-13) || !(t <= 1.4e+172)))) {
tmp = x * (t / z);
} else {
tmp = y * (x / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-2.35d+107)) .or. (.not. (t <= (-2.2d0))) .and. (t <= (-1.85d-13)) .or. (.not. (t <= 1.4d+172))) then
tmp = x * (t / z)
else
tmp = y * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.35e+107) || (!(t <= -2.2) && ((t <= -1.85e-13) || !(t <= 1.4e+172)))) {
tmp = x * (t / z);
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.35e+107) or (not (t <= -2.2) and ((t <= -1.85e-13) or not (t <= 1.4e+172))): tmp = x * (t / z) else: tmp = y * (x / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.35e+107) || (!(t <= -2.2) && ((t <= -1.85e-13) || !(t <= 1.4e+172)))) tmp = Float64(x * Float64(t / z)); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.35e+107) || (~((t <= -2.2)) && ((t <= -1.85e-13) || ~((t <= 1.4e+172))))) tmp = x * (t / z); else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.35e+107], And[N[Not[LessEqual[t, -2.2]], $MachinePrecision], Or[LessEqual[t, -1.85e-13], N[Not[LessEqual[t, 1.4e+172]], $MachinePrecision]]]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.35 \cdot 10^{+107} \lor \neg \left(t \leq -2.2\right) \land \left(t \leq -1.85 \cdot 10^{-13} \lor \neg \left(t \leq 1.4 \cdot 10^{+172}\right)\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if t < -2.35e107 or -2.2000000000000002 < t < -1.84999999999999994e-13 or 1.4e172 < t Initial program 94.0%
Taylor expanded in z around inf 59.8%
*-commutative59.8%
associate-/l*70.1%
associate-/r/61.1%
cancel-sign-sub-inv61.1%
metadata-eval61.1%
*-lft-identity61.1%
Simplified61.1%
Taylor expanded in x around 0 59.8%
Taylor expanded in y around 0 52.8%
associate-/l*55.0%
associate-/r/62.9%
Simplified62.9%
if -2.35e107 < t < -2.2000000000000002 or -1.84999999999999994e-13 < t < 1.4e172Initial program 89.3%
sub-neg89.3%
distribute-rgt-in89.2%
fma-def89.3%
distribute-neg-frac89.3%
Applied egg-rr89.3%
Taylor expanded in y around inf 73.0%
associate-*r/73.6%
Simplified73.6%
Final simplification70.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))) (t_2 (* y (/ x z))))
(if (<= t -1.45e+105)
t_1
(if (<= t -1.65)
t_2
(if (<= t -1.85e-13) (* t (/ x z)) (if (<= t 1.45e+172) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double t_2 = y * (x / z);
double tmp;
if (t <= -1.45e+105) {
tmp = t_1;
} else if (t <= -1.65) {
tmp = t_2;
} else if (t <= -1.85e-13) {
tmp = t * (x / z);
} else if (t <= 1.45e+172) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (t / z)
t_2 = y * (x / z)
if (t <= (-1.45d+105)) then
tmp = t_1
else if (t <= (-1.65d0)) then
tmp = t_2
else if (t <= (-1.85d-13)) then
tmp = t * (x / z)
else if (t <= 1.45d+172) 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 t_1 = x * (t / z);
double t_2 = y * (x / z);
double tmp;
if (t <= -1.45e+105) {
tmp = t_1;
} else if (t <= -1.65) {
tmp = t_2;
} else if (t <= -1.85e-13) {
tmp = t * (x / z);
} else if (t <= 1.45e+172) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) t_2 = y * (x / z) tmp = 0 if t <= -1.45e+105: tmp = t_1 elif t <= -1.65: tmp = t_2 elif t <= -1.85e-13: tmp = t * (x / z) elif t <= 1.45e+172: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) t_2 = Float64(y * Float64(x / z)) tmp = 0.0 if (t <= -1.45e+105) tmp = t_1; elseif (t <= -1.65) tmp = t_2; elseif (t <= -1.85e-13) tmp = Float64(t * Float64(x / z)); elseif (t <= 1.45e+172) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); t_2 = y * (x / z); tmp = 0.0; if (t <= -1.45e+105) tmp = t_1; elseif (t <= -1.65) tmp = t_2; elseif (t <= -1.85e-13) tmp = t * (x / z); elseif (t <= 1.45e+172) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.45e+105], t$95$1, If[LessEqual[t, -1.65], t$95$2, If[LessEqual[t, -1.85e-13], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.45e+172], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
t_2 := y \cdot \frac{x}{z}\\
\mathbf{if}\;t \leq -1.45 \cdot 10^{+105}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.65:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.85 \cdot 10^{-13}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{+172}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.45000000000000005e105 or 1.45e172 < t Initial program 93.5%
Taylor expanded in z around inf 56.7%
*-commutative56.7%
associate-/l*67.8%
associate-/r/59.2%
cancel-sign-sub-inv59.2%
metadata-eval59.2%
*-lft-identity59.2%
Simplified59.2%
Taylor expanded in x around 0 56.7%
Taylor expanded in y around 0 50.4%
associate-/l*52.7%
associate-/r/61.2%
Simplified61.2%
if -1.45000000000000005e105 < t < -1.6499999999999999 or -1.84999999999999994e-13 < t < 1.45e172Initial program 89.3%
sub-neg89.3%
distribute-rgt-in89.2%
fma-def89.3%
distribute-neg-frac89.3%
Applied egg-rr89.3%
Taylor expanded in y around inf 73.0%
associate-*r/73.6%
Simplified73.6%
if -1.6499999999999999 < t < -1.84999999999999994e-13Initial program 99.5%
Taylor expanded in z around inf 99.0%
*-commutative99.0%
associate-/l*99.7%
neg-mul-199.7%
Simplified99.7%
Taylor expanded in y around 0 84.2%
associate-/r/84.2%
Applied egg-rr84.2%
Final simplification70.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= z -2.1e+177)
t_1
(if (<= z -1.02e+55)
(* (/ y z) x)
(if (<= z -1.15e+15)
(* t (/ x z))
(if (<= z 5.8e+90) (* y (/ x z)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (z <= -2.1e+177) {
tmp = t_1;
} else if (z <= -1.02e+55) {
tmp = (y / z) * x;
} else if (z <= -1.15e+15) {
tmp = t * (x / z);
} else if (z <= 5.8e+90) {
tmp = y * (x / z);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t / z)
if (z <= (-2.1d+177)) then
tmp = t_1
else if (z <= (-1.02d+55)) then
tmp = (y / z) * x
else if (z <= (-1.15d+15)) then
tmp = t * (x / z)
else if (z <= 5.8d+90) then
tmp = y * (x / z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (z <= -2.1e+177) {
tmp = t_1;
} else if (z <= -1.02e+55) {
tmp = (y / z) * x;
} else if (z <= -1.15e+15) {
tmp = t * (x / z);
} else if (z <= 5.8e+90) {
tmp = y * (x / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if z <= -2.1e+177: tmp = t_1 elif z <= -1.02e+55: tmp = (y / z) * x elif z <= -1.15e+15: tmp = t * (x / z) elif z <= 5.8e+90: tmp = y * (x / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (z <= -2.1e+177) tmp = t_1; elseif (z <= -1.02e+55) tmp = Float64(Float64(y / z) * x); elseif (z <= -1.15e+15) tmp = Float64(t * Float64(x / z)); elseif (z <= 5.8e+90) tmp = Float64(y * Float64(x / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (z <= -2.1e+177) tmp = t_1; elseif (z <= -1.02e+55) tmp = (y / z) * x; elseif (z <= -1.15e+15) tmp = t * (x / z); elseif (z <= 5.8e+90) tmp = y * (x / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+177], t$95$1, If[LessEqual[z, -1.02e+55], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, -1.15e+15], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+90], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+177}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{+55}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{+15}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+90}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.10000000000000013e177 or 5.8000000000000003e90 < z Initial program 91.2%
Taylor expanded in z around inf 82.0%
*-commutative82.0%
associate-/l*90.4%
associate-/r/82.4%
cancel-sign-sub-inv82.4%
metadata-eval82.4%
*-lft-identity82.4%
Simplified82.4%
Taylor expanded in x around 0 82.0%
Taylor expanded in y around 0 58.9%
associate-/l*57.9%
associate-/r/66.5%
Simplified66.5%
if -2.10000000000000013e177 < z < -1.02000000000000002e55Initial program 95.2%
Taylor expanded in y around inf 60.2%
associate-*l/68.8%
Simplified68.8%
if -1.02000000000000002e55 < z < -1.15e15Initial program 99.7%
Taylor expanded in z around inf 99.9%
*-commutative99.9%
associate-/l*99.9%
neg-mul-199.9%
Simplified99.9%
Taylor expanded in y around 0 75.6%
associate-/r/75.7%
Applied egg-rr75.7%
if -1.15e15 < z < 5.8000000000000003e90Initial program 89.1%
sub-neg89.1%
distribute-rgt-in82.7%
fma-def84.8%
distribute-neg-frac84.8%
Applied egg-rr84.8%
Taylor expanded in y around inf 70.6%
associate-*r/72.0%
Simplified72.0%
Final simplification70.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.3e+177)
(* x (/ t z))
(if (<= z -3.9e+55)
(* (/ y z) x)
(if (<= z -26000000000000.0)
(* t (/ x z))
(if (<= z 1.15e+104) (* y (/ x z)) (/ x (/ z t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.3e+177) {
tmp = x * (t / z);
} else if (z <= -3.9e+55) {
tmp = (y / z) * x;
} else if (z <= -26000000000000.0) {
tmp = t * (x / z);
} else if (z <= 1.15e+104) {
tmp = y * (x / z);
} else {
tmp = x / (z / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2.3d+177)) then
tmp = x * (t / z)
else if (z <= (-3.9d+55)) then
tmp = (y / z) * x
else if (z <= (-26000000000000.0d0)) then
tmp = t * (x / z)
else if (z <= 1.15d+104) then
tmp = y * (x / z)
else
tmp = x / (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.3e+177) {
tmp = x * (t / z);
} else if (z <= -3.9e+55) {
tmp = (y / z) * x;
} else if (z <= -26000000000000.0) {
tmp = t * (x / z);
} else if (z <= 1.15e+104) {
tmp = y * (x / z);
} else {
tmp = x / (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.3e+177: tmp = x * (t / z) elif z <= -3.9e+55: tmp = (y / z) * x elif z <= -26000000000000.0: tmp = t * (x / z) elif z <= 1.15e+104: tmp = y * (x / z) else: tmp = x / (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.3e+177) tmp = Float64(x * Float64(t / z)); elseif (z <= -3.9e+55) tmp = Float64(Float64(y / z) * x); elseif (z <= -26000000000000.0) tmp = Float64(t * Float64(x / z)); elseif (z <= 1.15e+104) tmp = Float64(y * Float64(x / z)); else tmp = Float64(x / Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.3e+177) tmp = x * (t / z); elseif (z <= -3.9e+55) tmp = (y / z) * x; elseif (z <= -26000000000000.0) tmp = t * (x / z); elseif (z <= 1.15e+104) tmp = y * (x / z); else tmp = x / (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.3e+177], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.9e+55], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, -26000000000000.0], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e+104], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+177}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{+55}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;z \leq -26000000000000:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+104}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\end{array}
\end{array}
if z < -2.2999999999999999e177Initial program 84.2%
Taylor expanded in z around inf 78.8%
*-commutative78.8%
associate-/l*82.2%
associate-/r/82.4%
cancel-sign-sub-inv82.4%
metadata-eval82.4%
*-lft-identity82.4%
Simplified82.4%
Taylor expanded in x around 0 78.8%
Taylor expanded in y around 0 55.7%
associate-/l*55.3%
associate-/r/62.9%
Simplified62.9%
if -2.2999999999999999e177 < z < -3.90000000000000027e55Initial program 95.2%
Taylor expanded in y around inf 60.2%
associate-*l/68.8%
Simplified68.8%
if -3.90000000000000027e55 < z < -2.6e13Initial program 99.7%
Taylor expanded in z around inf 99.9%
*-commutative99.9%
associate-/l*99.9%
neg-mul-199.9%
Simplified99.9%
Taylor expanded in y around 0 75.6%
associate-/r/75.7%
Applied egg-rr75.7%
if -2.6e13 < z < 1.14999999999999992e104Initial program 89.2%
sub-neg89.2%
distribute-rgt-in82.9%
fma-def85.0%
distribute-neg-frac85.0%
Applied egg-rr85.0%
Taylor expanded in y around inf 70.4%
associate-*r/71.7%
Simplified71.7%
if 1.14999999999999992e104 < z Initial program 95.6%
Taylor expanded in z around inf 83.4%
*-commutative83.4%
associate-/l*95.7%
neg-mul-195.7%
Simplified95.7%
Taylor expanded in y around 0 69.5%
Final simplification70.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.2e+177)
(* x (/ t z))
(if (<= z -5.2e+55)
(/ x (/ z y))
(if (<= z -4.8e+14)
(* t (/ x z))
(if (<= z 2.85e+103) (* y (/ x z)) (/ x (/ z t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+177) {
tmp = x * (t / z);
} else if (z <= -5.2e+55) {
tmp = x / (z / y);
} else if (z <= -4.8e+14) {
tmp = t * (x / z);
} else if (z <= 2.85e+103) {
tmp = y * (x / z);
} else {
tmp = x / (z / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2.2d+177)) then
tmp = x * (t / z)
else if (z <= (-5.2d+55)) then
tmp = x / (z / y)
else if (z <= (-4.8d+14)) then
tmp = t * (x / z)
else if (z <= 2.85d+103) then
tmp = y * (x / z)
else
tmp = x / (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e+177) {
tmp = x * (t / z);
} else if (z <= -5.2e+55) {
tmp = x / (z / y);
} else if (z <= -4.8e+14) {
tmp = t * (x / z);
} else if (z <= 2.85e+103) {
tmp = y * (x / z);
} else {
tmp = x / (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.2e+177: tmp = x * (t / z) elif z <= -5.2e+55: tmp = x / (z / y) elif z <= -4.8e+14: tmp = t * (x / z) elif z <= 2.85e+103: tmp = y * (x / z) else: tmp = x / (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.2e+177) tmp = Float64(x * Float64(t / z)); elseif (z <= -5.2e+55) tmp = Float64(x / Float64(z / y)); elseif (z <= -4.8e+14) tmp = Float64(t * Float64(x / z)); elseif (z <= 2.85e+103) tmp = Float64(y * Float64(x / z)); else tmp = Float64(x / Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.2e+177) tmp = x * (t / z); elseif (z <= -5.2e+55) tmp = x / (z / y); elseif (z <= -4.8e+14) tmp = t * (x / z); elseif (z <= 2.85e+103) tmp = y * (x / z); else tmp = x / (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.2e+177], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.2e+55], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.8e+14], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.85e+103], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+177}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{+55}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{+14}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{+103}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\end{array}
\end{array}
if z < -2.1999999999999998e177Initial program 84.2%
Taylor expanded in z around inf 78.8%
*-commutative78.8%
associate-/l*82.2%
associate-/r/82.4%
cancel-sign-sub-inv82.4%
metadata-eval82.4%
*-lft-identity82.4%
Simplified82.4%
Taylor expanded in x around 0 78.8%
Taylor expanded in y around 0 55.7%
associate-/l*55.3%
associate-/r/62.9%
Simplified62.9%
if -2.1999999999999998e177 < z < -5.2e55Initial program 95.2%
Taylor expanded in z around inf 91.1%
*-commutative91.1%
associate-/l*95.5%
neg-mul-195.5%
Simplified95.5%
Taylor expanded in y around inf 69.1%
if -5.2e55 < z < -4.8e14Initial program 99.7%
Taylor expanded in z around inf 99.9%
*-commutative99.9%
associate-/l*99.9%
neg-mul-199.9%
Simplified99.9%
Taylor expanded in y around 0 75.6%
associate-/r/75.7%
Applied egg-rr75.7%
if -4.8e14 < z < 2.85000000000000016e103Initial program 89.2%
sub-neg89.2%
distribute-rgt-in82.9%
fma-def85.0%
distribute-neg-frac85.0%
Applied egg-rr85.0%
Taylor expanded in y around inf 70.4%
associate-*r/71.7%
Simplified71.7%
if 2.85000000000000016e103 < z Initial program 95.6%
Taylor expanded in z around inf 83.4%
*-commutative83.4%
associate-/l*95.7%
neg-mul-195.7%
Simplified95.7%
Taylor expanded in y around 0 69.5%
Final simplification70.2%
(FPCore (x y z t) :precision binary64 (* y (/ x z)))
double code(double x, double y, double z, double t) {
return y * (x / z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * (x / z)
end function
public static double code(double x, double y, double z, double t) {
return y * (x / z);
}
def code(x, y, z, t): return y * (x / z)
function code(x, y, z, t) return Float64(y * Float64(x / z)) end
function tmp = code(x, y, z, t) tmp = y * (x / z); end
code[x_, y_, z_, t_] := N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{x}{z}
\end{array}
Initial program 90.8%
sub-neg90.8%
distribute-rgt-in87.2%
fma-def88.4%
distribute-neg-frac88.4%
Applied egg-rr88.4%
Taylor expanded in y around inf 60.1%
associate-*r/60.9%
Simplified60.9%
Final simplification60.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))))
(t_2 (* x (- (/ y z) (/ t (- 1.0 z))))))
(if (< t_2 -7.623226303312042e-196)
t_1
(if (< t_2 1.4133944927702302e-211)
(+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z))))
t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * ((y / z) - (t * (1.0d0 / (1.0d0 - z))))
t_2 = x * ((y / z) - (t / (1.0d0 - z)))
if (t_2 < (-7.623226303312042d-196)) then
tmp = t_1
else if (t_2 < 1.4133944927702302d-211) then
tmp = ((y * x) / z) + -((t * x) / (1.0d0 - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))) t_2 = x * ((y / z) - (t / (1.0 - z))) tmp = 0 if t_2 < -7.623226303312042e-196: tmp = t_1 elif t_2 < 1.4133944927702302e-211: tmp = ((y * x) / z) + -((t * x) / (1.0 - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - Float64(t * Float64(1.0 / Float64(1.0 - z))))) t_2 = Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) tmp = 0.0 if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = Float64(Float64(Float64(y * x) / z) + Float64(-Float64(Float64(t * x) / Float64(1.0 - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))); t_2 = x * ((y / z) - (t / (1.0 - z))); tmp = 0.0; if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = ((y * x) / z) + -((t * x) / (1.0 - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t * N[(1.0 / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -7.623226303312042e-196], t$95$1, If[Less[t$95$2, 1.4133944927702302e-211], N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] + (-N[(N[(t * x), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\
t_2 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\
\mathbf{if}\;t_2 < -7.623226303312042 \cdot 10^{-196}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 < 1.4133944927702302 \cdot 10^{-211}:\\
\;\;\;\;\frac{y \cdot x}{z} + \left(-\frac{t \cdot x}{1 - z}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023216
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:herbie-target
(if (< (* x (- (/ y z) (/ t (- 1.0 z)))) -7.623226303312042e-196) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))) (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) 1.4133944927702302e-211) (+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z)))) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))