
(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 13 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)))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+306)))
(* y (/ x z))
(* x t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+306)) {
tmp = y * (x / z);
} else {
tmp = x * t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+306)) {
tmp = y * (x / z);
} else {
tmp = x * t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) - (t / (1.0 - z)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+306): tmp = y * (x / z) else: tmp = x * t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+306)) tmp = Float64(y * Float64(x / z)); else tmp = Float64(x * t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) - (t / (1.0 - z)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e+306))) tmp = y * (x / z); else tmp = x * t_1; 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]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+306]], $MachinePrecision]], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 5 \cdot 10^{+306}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot t_1\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < -inf.0 or 4.99999999999999993e306 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) Initial program 61.8%
Taylor expanded in y around inf 99.7%
associate-/l*69.1%
associate-/r/99.9%
Simplified99.9%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < 4.99999999999999993e306Initial program 99.4%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) (/ t (- 1.0 z))))))
(if (<= t_1 (- INFINITY))
(/ (* x (fma y (- 1.0 z) (- (* z t)))) (* z (- 1.0 z)))
t_1)))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x * fma(y, (1.0 - z), -(z * t))) / (z * (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 - z)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x * fma(y, Float64(1.0 - z), Float64(-Float64(z * t)))) / Float64(z * Float64(1.0 - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x * N[(y * N[(1.0 - z), $MachinePrecision] + (-N[(z * t), $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / N[(z * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{x \cdot \mathsf{fma}\left(y, 1 - z, -z \cdot t\right)}{z \cdot \left(1 - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) < -inf.0Initial program 80.8%
*-commutative80.8%
frac-sub80.8%
associate-*l/99.8%
cancel-sign-sub-inv99.8%
fma-def99.8%
Applied egg-rr99.8%
if -inf.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) Initial program 97.7%
Final simplification97.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y z))) (t_2 (* t (/ x z))))
(if (<= z -7.5e+97)
t_1
(if (<= z -10000000.0)
t_2
(if (<= z 1.1e+18)
(* y (/ x z))
(if (<= z 2.4e+114) t_2 (if (<= z 1.05e+192) t_1 (* x (/ t z)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / z);
double t_2 = t * (x / z);
double tmp;
if (z <= -7.5e+97) {
tmp = t_1;
} else if (z <= -10000000.0) {
tmp = t_2;
} else if (z <= 1.1e+18) {
tmp = y * (x / z);
} else if (z <= 2.4e+114) {
tmp = t_2;
} else if (z <= 1.05e+192) {
tmp = t_1;
} else {
tmp = x * (t / 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) :: t_2
real(8) :: tmp
t_1 = x * (y / z)
t_2 = t * (x / z)
if (z <= (-7.5d+97)) then
tmp = t_1
else if (z <= (-10000000.0d0)) then
tmp = t_2
else if (z <= 1.1d+18) then
tmp = y * (x / z)
else if (z <= 2.4d+114) then
tmp = t_2
else if (z <= 1.05d+192) then
tmp = t_1
else
tmp = x * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (y / z);
double t_2 = t * (x / z);
double tmp;
if (z <= -7.5e+97) {
tmp = t_1;
} else if (z <= -10000000.0) {
tmp = t_2;
} else if (z <= 1.1e+18) {
tmp = y * (x / z);
} else if (z <= 2.4e+114) {
tmp = t_2;
} else if (z <= 1.05e+192) {
tmp = t_1;
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / z) t_2 = t * (x / z) tmp = 0 if z <= -7.5e+97: tmp = t_1 elif z <= -10000000.0: tmp = t_2 elif z <= 1.1e+18: tmp = y * (x / z) elif z <= 2.4e+114: tmp = t_2 elif z <= 1.05e+192: tmp = t_1 else: tmp = x * (t / z) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / z)) t_2 = Float64(t * Float64(x / z)) tmp = 0.0 if (z <= -7.5e+97) tmp = t_1; elseif (z <= -10000000.0) tmp = t_2; elseif (z <= 1.1e+18) tmp = Float64(y * Float64(x / z)); elseif (z <= 2.4e+114) tmp = t_2; elseif (z <= 1.05e+192) tmp = t_1; else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / z); t_2 = t * (x / z); tmp = 0.0; if (z <= -7.5e+97) tmp = t_1; elseif (z <= -10000000.0) tmp = t_2; elseif (z <= 1.1e+18) tmp = y * (x / z); elseif (z <= 2.4e+114) tmp = t_2; elseif (z <= 1.05e+192) tmp = t_1; else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.5e+97], t$95$1, If[LessEqual[z, -10000000.0], t$95$2, If[LessEqual[z, 1.1e+18], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e+114], t$95$2, If[LessEqual[z, 1.05e+192], t$95$1, N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{z}\\
t_2 := t \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -10000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+18}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+114}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+192}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if z < -7.5000000000000004e97 or 2.4e114 < z < 1.04999999999999997e192Initial program 98.0%
Taylor expanded in y around inf 59.9%
associate-*r/74.2%
Simplified74.2%
if -7.5000000000000004e97 < z < -1e7 or 1.1e18 < z < 2.4e114Initial program 99.6%
Taylor expanded in z around inf 90.6%
associate-/l*97.1%
associate-/r/92.7%
cancel-sign-sub-inv92.7%
metadata-eval92.7%
*-lft-identity92.7%
+-commutative92.7%
Simplified92.7%
Taylor expanded in t around inf 70.5%
associate-*r/77.0%
Simplified77.0%
if -1e7 < z < 1.1e18Initial program 92.1%
Taylor expanded in y around inf 67.2%
associate-/l*66.0%
associate-/r/71.7%
Simplified71.7%
if 1.04999999999999997e192 < z Initial program 99.8%
Taylor expanded in z around inf 84.8%
associate-/l*100.0%
associate-/r/62.9%
cancel-sign-sub-inv62.9%
metadata-eval62.9%
*-lft-identity62.9%
+-commutative62.9%
Simplified62.9%
*-commutative62.9%
clear-num62.8%
un-div-inv62.9%
+-commutative62.9%
Applied egg-rr62.9%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around 0 70.0%
Final simplification73.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y z))))
(if (<= z -9.2e+96)
t_1
(if (<= z -7000000.0)
(/ t (/ z x))
(if (<= z 7e+17)
(* y (/ x z))
(if (<= z 1.7e+118)
(* t (/ x z))
(if (<= z 4.2e+192) t_1 (* x (/ t z)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / z);
double tmp;
if (z <= -9.2e+96) {
tmp = t_1;
} else if (z <= -7000000.0) {
tmp = t / (z / x);
} else if (z <= 7e+17) {
tmp = y * (x / z);
} else if (z <= 1.7e+118) {
tmp = t * (x / z);
} else if (z <= 4.2e+192) {
tmp = t_1;
} else {
tmp = x * (t / 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 * (y / z)
if (z <= (-9.2d+96)) then
tmp = t_1
else if (z <= (-7000000.0d0)) then
tmp = t / (z / x)
else if (z <= 7d+17) then
tmp = y * (x / z)
else if (z <= 1.7d+118) then
tmp = t * (x / z)
else if (z <= 4.2d+192) then
tmp = t_1
else
tmp = x * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (y / z);
double tmp;
if (z <= -9.2e+96) {
tmp = t_1;
} else if (z <= -7000000.0) {
tmp = t / (z / x);
} else if (z <= 7e+17) {
tmp = y * (x / z);
} else if (z <= 1.7e+118) {
tmp = t * (x / z);
} else if (z <= 4.2e+192) {
tmp = t_1;
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / z) tmp = 0 if z <= -9.2e+96: tmp = t_1 elif z <= -7000000.0: tmp = t / (z / x) elif z <= 7e+17: tmp = y * (x / z) elif z <= 1.7e+118: tmp = t * (x / z) elif z <= 4.2e+192: tmp = t_1 else: tmp = x * (t / z) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / z)) tmp = 0.0 if (z <= -9.2e+96) tmp = t_1; elseif (z <= -7000000.0) tmp = Float64(t / Float64(z / x)); elseif (z <= 7e+17) tmp = Float64(y * Float64(x / z)); elseif (z <= 1.7e+118) tmp = Float64(t * Float64(x / z)); elseif (z <= 4.2e+192) tmp = t_1; else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / z); tmp = 0.0; if (z <= -9.2e+96) tmp = t_1; elseif (z <= -7000000.0) tmp = t / (z / x); elseif (z <= 7e+17) tmp = y * (x / z); elseif (z <= 1.7e+118) tmp = t * (x / z); elseif (z <= 4.2e+192) tmp = t_1; else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.2e+96], t$95$1, If[LessEqual[z, -7000000.0], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e+17], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+118], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e+192], t$95$1, N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -9.2 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7000000:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+17}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+118}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+192}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if z < -9.2000000000000006e96 or 1.69999999999999993e118 < z < 4.19999999999999989e192Initial program 98.0%
Taylor expanded in y around inf 59.9%
associate-*r/74.2%
Simplified74.2%
if -9.2000000000000006e96 < z < -7e6Initial program 99.5%
Taylor expanded in z around inf 88.1%
associate-/l*93.4%
associate-/r/88.0%
cancel-sign-sub-inv88.0%
metadata-eval88.0%
*-lft-identity88.0%
+-commutative88.0%
Simplified88.0%
Taylor expanded in t around inf 73.2%
associate-/l*78.2%
Simplified78.2%
if -7e6 < z < 7e17Initial program 92.1%
Taylor expanded in y around inf 67.2%
associate-/l*66.0%
associate-/r/71.7%
Simplified71.7%
if 7e17 < z < 1.69999999999999993e118Initial program 99.8%
Taylor expanded in z around inf 92.4%
associate-/l*99.8%
associate-/r/96.1%
cancel-sign-sub-inv96.1%
metadata-eval96.1%
*-lft-identity96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in t around inf 68.7%
associate-*r/76.0%
Simplified76.0%
if 4.19999999999999989e192 < z Initial program 99.8%
Taylor expanded in z around inf 84.8%
associate-/l*100.0%
associate-/r/62.9%
cancel-sign-sub-inv62.9%
metadata-eval62.9%
*-lft-identity62.9%
+-commutative62.9%
Simplified62.9%
*-commutative62.9%
clear-num62.8%
un-div-inv62.9%
+-commutative62.9%
Applied egg-rr62.9%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around 0 70.0%
Final simplification73.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y z))) (t_2 (/ x (/ z t))))
(if (<= z -1.9e+98)
t_1
(if (<= z -11200000.0)
t_2
(if (<= z 1.25e+18)
(* y (/ x z))
(if (<= z 2.1e+114) (* t (/ x z)) (if (<= z 8e+191) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / z);
double t_2 = x / (z / t);
double tmp;
if (z <= -1.9e+98) {
tmp = t_1;
} else if (z <= -11200000.0) {
tmp = t_2;
} else if (z <= 1.25e+18) {
tmp = y * (x / z);
} else if (z <= 2.1e+114) {
tmp = t * (x / z);
} else if (z <= 8e+191) {
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_2 = x / (z / t)
if (z <= (-1.9d+98)) then
tmp = t_1
else if (z <= (-11200000.0d0)) then
tmp = t_2
else if (z <= 1.25d+18) then
tmp = y * (x / z)
else if (z <= 2.1d+114) then
tmp = t * (x / z)
else if (z <= 8d+191) 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);
double t_2 = x / (z / t);
double tmp;
if (z <= -1.9e+98) {
tmp = t_1;
} else if (z <= -11200000.0) {
tmp = t_2;
} else if (z <= 1.25e+18) {
tmp = y * (x / z);
} else if (z <= 2.1e+114) {
tmp = t * (x / z);
} else if (z <= 8e+191) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / z) t_2 = x / (z / t) tmp = 0 if z <= -1.9e+98: tmp = t_1 elif z <= -11200000.0: tmp = t_2 elif z <= 1.25e+18: tmp = y * (x / z) elif z <= 2.1e+114: tmp = t * (x / z) elif z <= 8e+191: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / z)) t_2 = Float64(x / Float64(z / t)) tmp = 0.0 if (z <= -1.9e+98) tmp = t_1; elseif (z <= -11200000.0) tmp = t_2; elseif (z <= 1.25e+18) tmp = Float64(y * Float64(x / z)); elseif (z <= 2.1e+114) tmp = Float64(t * Float64(x / z)); elseif (z <= 8e+191) 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_2 = x / (z / t); tmp = 0.0; if (z <= -1.9e+98) tmp = t_1; elseif (z <= -11200000.0) tmp = t_2; elseif (z <= 1.25e+18) tmp = y * (x / z); elseif (z <= 2.1e+114) tmp = t * (x / z); elseif (z <= 8e+191) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+98], t$95$1, If[LessEqual[z, -11200000.0], t$95$2, If[LessEqual[z, 1.25e+18], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e+114], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+191], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{z}\\
t_2 := \frac{x}{\frac{z}{t}}\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+98}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -11200000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+18}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+114}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+191}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.89999999999999995e98 or 2.1e114 < z < 8.00000000000000058e191Initial program 98.0%
Taylor expanded in y around inf 59.9%
associate-*r/74.2%
Simplified74.2%
if -1.89999999999999995e98 < z < -1.12e7 or 8.00000000000000058e191 < z Initial program 99.6%
Taylor expanded in z around inf 86.2%
associate-/l*97.2%
associate-/r/73.4%
cancel-sign-sub-inv73.4%
metadata-eval73.4%
*-lft-identity73.4%
+-commutative73.4%
Simplified73.4%
*-commutative73.4%
clear-num73.3%
un-div-inv73.4%
+-commutative73.4%
Applied egg-rr73.4%
associate-/r/97.0%
Simplified97.0%
*-commutative97.0%
clear-num97.0%
un-div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in y around 0 73.6%
if -1.12e7 < z < 1.25e18Initial program 92.1%
Taylor expanded in y around inf 67.2%
associate-/l*66.0%
associate-/r/71.7%
Simplified71.7%
if 1.25e18 < z < 2.1e114Initial program 99.8%
Taylor expanded in z around inf 92.4%
associate-/l*99.8%
associate-/r/96.1%
cancel-sign-sub-inv96.1%
metadata-eval96.1%
*-lft-identity96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in t around inf 68.7%
associate-*r/76.0%
Simplified76.0%
Final simplification73.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y z))) (t_2 (/ x (/ z t))))
(if (<= z -2.02e+96)
t_1
(if (<= z -3700000.0)
t_2
(if (<= z 2.9e+17)
(* x (- (/ y z) t))
(if (<= z 7.6e+113) (* t (/ x z)) (if (<= z 4.2e+192) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / z);
double t_2 = x / (z / t);
double tmp;
if (z <= -2.02e+96) {
tmp = t_1;
} else if (z <= -3700000.0) {
tmp = t_2;
} else if (z <= 2.9e+17) {
tmp = x * ((y / z) - t);
} else if (z <= 7.6e+113) {
tmp = t * (x / z);
} else if (z <= 4.2e+192) {
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_2 = x / (z / t)
if (z <= (-2.02d+96)) then
tmp = t_1
else if (z <= (-3700000.0d0)) then
tmp = t_2
else if (z <= 2.9d+17) then
tmp = x * ((y / z) - t)
else if (z <= 7.6d+113) then
tmp = t * (x / z)
else if (z <= 4.2d+192) 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);
double t_2 = x / (z / t);
double tmp;
if (z <= -2.02e+96) {
tmp = t_1;
} else if (z <= -3700000.0) {
tmp = t_2;
} else if (z <= 2.9e+17) {
tmp = x * ((y / z) - t);
} else if (z <= 7.6e+113) {
tmp = t * (x / z);
} else if (z <= 4.2e+192) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / z) t_2 = x / (z / t) tmp = 0 if z <= -2.02e+96: tmp = t_1 elif z <= -3700000.0: tmp = t_2 elif z <= 2.9e+17: tmp = x * ((y / z) - t) elif z <= 7.6e+113: tmp = t * (x / z) elif z <= 4.2e+192: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / z)) t_2 = Float64(x / Float64(z / t)) tmp = 0.0 if (z <= -2.02e+96) tmp = t_1; elseif (z <= -3700000.0) tmp = t_2; elseif (z <= 2.9e+17) tmp = Float64(x * Float64(Float64(y / z) - t)); elseif (z <= 7.6e+113) tmp = Float64(t * Float64(x / z)); elseif (z <= 4.2e+192) 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_2 = x / (z / t); tmp = 0.0; if (z <= -2.02e+96) tmp = t_1; elseif (z <= -3700000.0) tmp = t_2; elseif (z <= 2.9e+17) tmp = x * ((y / z) - t); elseif (z <= 7.6e+113) tmp = t * (x / z); elseif (z <= 4.2e+192) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.02e+96], t$95$1, If[LessEqual[z, -3700000.0], t$95$2, If[LessEqual[z, 2.9e+17], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.6e+113], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e+192], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{z}\\
t_2 := \frac{x}{\frac{z}{t}}\\
\mathbf{if}\;z \leq -2.02 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3700000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+17}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{+113}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+192}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -2.02000000000000006e96 or 7.6000000000000007e113 < z < 4.19999999999999989e192Initial program 98.0%
Taylor expanded in y around inf 59.9%
associate-*r/74.2%
Simplified74.2%
if -2.02000000000000006e96 < z < -3.7e6 or 4.19999999999999989e192 < z Initial program 99.6%
Taylor expanded in z around inf 86.2%
associate-/l*97.2%
associate-/r/73.4%
cancel-sign-sub-inv73.4%
metadata-eval73.4%
*-lft-identity73.4%
+-commutative73.4%
Simplified73.4%
*-commutative73.4%
clear-num73.3%
un-div-inv73.4%
+-commutative73.4%
Applied egg-rr73.4%
associate-/r/97.0%
Simplified97.0%
*-commutative97.0%
clear-num97.0%
un-div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in y around 0 73.6%
if -3.7e6 < z < 2.9e17Initial program 92.1%
Taylor expanded in z around 0 89.8%
+-commutative89.8%
associate-*r/87.4%
*-commutative87.4%
associate-*r*87.4%
neg-mul-187.4%
distribute-rgt-out90.4%
unsub-neg90.4%
Simplified90.4%
if 2.9e17 < z < 7.6000000000000007e113Initial program 99.8%
Taylor expanded in z around inf 92.4%
associate-/l*99.8%
associate-/r/96.1%
cancel-sign-sub-inv96.1%
metadata-eval96.1%
*-lft-identity96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in t around inf 68.7%
associate-*r/76.0%
Simplified76.0%
Final simplification82.6%
(FPCore (x y z t)
:precision binary64
(if (or (<= t -5.3e+160)
(and (not (<= t -9.6e+105))
(or (<= t -3.3e+51) (not (<= t 4.8e+53)))))
(* x (/ t (+ z -1.0)))
(/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.3e+160) || (!(t <= -9.6e+105) && ((t <= -3.3e+51) || !(t <= 4.8e+53)))) {
tmp = x * (t / (z + -1.0));
} else {
tmp = x / (z / y);
}
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 <= (-5.3d+160)) .or. (.not. (t <= (-9.6d+105))) .and. (t <= (-3.3d+51)) .or. (.not. (t <= 4.8d+53))) then
tmp = x * (t / (z + (-1.0d0)))
else
tmp = x / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.3e+160) || (!(t <= -9.6e+105) && ((t <= -3.3e+51) || !(t <= 4.8e+53)))) {
tmp = x * (t / (z + -1.0));
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5.3e+160) or (not (t <= -9.6e+105) and ((t <= -3.3e+51) or not (t <= 4.8e+53))): tmp = x * (t / (z + -1.0)) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5.3e+160) || (!(t <= -9.6e+105) && ((t <= -3.3e+51) || !(t <= 4.8e+53)))) tmp = Float64(x * Float64(t / Float64(z + -1.0))); else tmp = Float64(x / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -5.3e+160) || (~((t <= -9.6e+105)) && ((t <= -3.3e+51) || ~((t <= 4.8e+53))))) tmp = x * (t / (z + -1.0)); else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5.3e+160], And[N[Not[LessEqual[t, -9.6e+105]], $MachinePrecision], Or[LessEqual[t, -3.3e+51], N[Not[LessEqual[t, 4.8e+53]], $MachinePrecision]]]], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.3 \cdot 10^{+160} \lor \neg \left(t \leq -9.6 \cdot 10^{+105}\right) \land \left(t \leq -3.3 \cdot 10^{+51} \lor \neg \left(t \leq 4.8 \cdot 10^{+53}\right)\right):\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -5.3000000000000001e160 or -9.599999999999999e105 < t < -3.2999999999999997e51 or 4.8e53 < t Initial program 95.4%
Taylor expanded in y around 0 73.4%
associate-*r/73.4%
mul-1-neg73.4%
*-commutative73.4%
distribute-rgt-neg-in73.4%
associate-*r/77.6%
distribute-frac-neg77.6%
mul-1-neg77.6%
*-commutative77.6%
associate-*l/77.6%
associate-*r/77.6%
metadata-eval77.6%
associate-/r*77.6%
neg-mul-177.6%
associate-*r/77.6%
*-rgt-identity77.6%
neg-sub077.6%
associate--r-77.6%
metadata-eval77.6%
Simplified77.6%
if -5.3000000000000001e160 < t < -9.599999999999999e105 or -3.2999999999999997e51 < t < 4.8e53Initial program 95.4%
Taylor expanded in y around inf 79.3%
associate-*r/86.2%
Simplified86.2%
clear-num86.1%
un-div-inv87.5%
Applied egg-rr87.5%
Final simplification83.3%
(FPCore (x y z t)
:precision binary64
(if (or (<= t -3.3e+263)
(and (not (<= t -3.45e+106))
(or (<= t -7.8e+51) (not (<= t 7.5e+54)))))
(* x (/ t z))
(* x (/ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.3e+263) || (!(t <= -3.45e+106) && ((t <= -7.8e+51) || !(t <= 7.5e+54)))) {
tmp = x * (t / z);
} else {
tmp = x * (y / 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 <= (-3.3d+263)) .or. (.not. (t <= (-3.45d+106))) .and. (t <= (-7.8d+51)) .or. (.not. (t <= 7.5d+54))) then
tmp = x * (t / z)
else
tmp = x * (y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.3e+263) || (!(t <= -3.45e+106) && ((t <= -7.8e+51) || !(t <= 7.5e+54)))) {
tmp = x * (t / z);
} else {
tmp = x * (y / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.3e+263) or (not (t <= -3.45e+106) and ((t <= -7.8e+51) or not (t <= 7.5e+54))): tmp = x * (t / z) else: tmp = x * (y / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.3e+263) || (!(t <= -3.45e+106) && ((t <= -7.8e+51) || !(t <= 7.5e+54)))) tmp = Float64(x * Float64(t / z)); else tmp = Float64(x * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.3e+263) || (~((t <= -3.45e+106)) && ((t <= -7.8e+51) || ~((t <= 7.5e+54))))) tmp = x * (t / z); else tmp = x * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.3e+263], And[N[Not[LessEqual[t, -3.45e+106]], $MachinePrecision], Or[LessEqual[t, -7.8e+51], N[Not[LessEqual[t, 7.5e+54]], $MachinePrecision]]]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+263} \lor \neg \left(t \leq -3.45 \cdot 10^{+106}\right) \land \left(t \leq -7.8 \cdot 10^{+51} \lor \neg \left(t \leq 7.5 \cdot 10^{+54}\right)\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if t < -3.3e263 or -3.4499999999999999e106 < t < -7.79999999999999968e51 or 7.50000000000000042e54 < t Initial program 95.7%
Taylor expanded in z around inf 65.6%
associate-/l*69.6%
associate-/r/55.7%
cancel-sign-sub-inv55.7%
metadata-eval55.7%
*-lft-identity55.7%
+-commutative55.7%
Simplified55.7%
*-commutative55.7%
clear-num54.9%
un-div-inv54.9%
+-commutative54.9%
Applied egg-rr54.9%
associate-/r/69.5%
Simplified69.5%
Taylor expanded in y around 0 54.8%
if -3.3e263 < t < -3.4499999999999999e106 or -7.79999999999999968e51 < t < 7.50000000000000042e54Initial program 95.3%
Taylor expanded in y around inf 76.1%
associate-*r/82.3%
Simplified82.3%
Final simplification72.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- t))) (t_2 (* x (/ y z))))
(if (<= t -2.7e+229)
t_1
(if (<= t 9.8e+54)
t_2
(if (<= t 3.45e+106) (* t (/ x z)) (if (<= t 1.15e+171) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * -t;
double t_2 = x * (y / z);
double tmp;
if (t <= -2.7e+229) {
tmp = t_1;
} else if (t <= 9.8e+54) {
tmp = t_2;
} else if (t <= 3.45e+106) {
tmp = t * (x / z);
} else if (t <= 1.15e+171) {
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
t_2 = x * (y / z)
if (t <= (-2.7d+229)) then
tmp = t_1
else if (t <= 9.8d+54) then
tmp = t_2
else if (t <= 3.45d+106) then
tmp = t * (x / z)
else if (t <= 1.15d+171) 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;
double t_2 = x * (y / z);
double tmp;
if (t <= -2.7e+229) {
tmp = t_1;
} else if (t <= 9.8e+54) {
tmp = t_2;
} else if (t <= 3.45e+106) {
tmp = t * (x / z);
} else if (t <= 1.15e+171) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * -t t_2 = x * (y / z) tmp = 0 if t <= -2.7e+229: tmp = t_1 elif t <= 9.8e+54: tmp = t_2 elif t <= 3.45e+106: tmp = t * (x / z) elif t <= 1.15e+171: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(-t)) t_2 = Float64(x * Float64(y / z)) tmp = 0.0 if (t <= -2.7e+229) tmp = t_1; elseif (t <= 9.8e+54) tmp = t_2; elseif (t <= 3.45e+106) tmp = Float64(t * Float64(x / z)); elseif (t <= 1.15e+171) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * -t; t_2 = x * (y / z); tmp = 0.0; if (t <= -2.7e+229) tmp = t_1; elseif (t <= 9.8e+54) tmp = t_2; elseif (t <= 3.45e+106) tmp = t * (x / z); elseif (t <= 1.15e+171) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.7e+229], t$95$1, If[LessEqual[t, 9.8e+54], t$95$2, If[LessEqual[t, 3.45e+106], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e+171], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(-t\right)\\
t_2 := x \cdot \frac{y}{z}\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{+229}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9.8 \cdot 10^{+54}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.45 \cdot 10^{+106}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+171}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -2.7e229 or 1.15000000000000009e171 < t Initial program 93.7%
Taylor expanded in z around 0 54.4%
+-commutative54.4%
associate-*r/48.3%
*-commutative48.3%
associate-*r*48.3%
neg-mul-148.3%
distribute-rgt-out50.0%
unsub-neg50.0%
Simplified50.0%
Taylor expanded in y around 0 43.3%
associate-*r*43.3%
neg-mul-143.3%
*-commutative43.3%
Simplified43.3%
if -2.7e229 < t < 9.80000000000000002e54 or 3.4499999999999999e106 < t < 1.15000000000000009e171Initial program 95.6%
Taylor expanded in y around inf 74.3%
associate-*r/80.1%
Simplified80.1%
if 9.80000000000000002e54 < t < 3.4499999999999999e106Initial program 99.5%
Taylor expanded in z around inf 84.6%
associate-/l*89.5%
associate-/r/78.1%
cancel-sign-sub-inv78.1%
metadata-eval78.1%
*-lft-identity78.1%
+-commutative78.1%
Simplified78.1%
Taylor expanded in t around inf 54.4%
associate-*r/57.7%
Simplified57.7%
Final simplification69.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -440.0) (not (<= z 1.0))) (* x (/ (+ y t) z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -440.0) || !(z <= 1.0)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / 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 <= (-440.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * ((y + t) / z)
else
tmp = x * ((y / z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -440.0) || !(z <= 1.0)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -440.0) or not (z <= 1.0): tmp = x * ((y + t) / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -440.0) || !(z <= 1.0)) tmp = Float64(x * Float64(Float64(y + t) / z)); else tmp = Float64(x * Float64(Float64(y / z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -440.0) || ~((z <= 1.0))) tmp = x * ((y + t) / z); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -440.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -440 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -440 or 1 < z Initial program 99.0%
Taylor expanded in z around inf 97.8%
cancel-sign-sub-inv97.8%
metadata-eval97.8%
*-lft-identity97.8%
+-commutative97.8%
Simplified97.8%
if -440 < z < 1Initial program 91.8%
Taylor expanded in z around 0 90.1%
+-commutative90.1%
associate-*r/87.6%
*-commutative87.6%
associate-*r*87.6%
neg-mul-187.6%
distribute-rgt-out90.7%
unsub-neg90.7%
Simplified90.7%
Final simplification94.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.8e-27) (not (<= z 1.0))) (/ x (/ z (+ y t))) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.8e-27) || !(z <= 1.0)) {
tmp = x / (z / (y + t));
} else {
tmp = x * ((y / 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.8d-27)) .or. (.not. (z <= 1.0d0))) then
tmp = x / (z / (y + t))
else
tmp = x * ((y / 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.8e-27) || !(z <= 1.0)) {
tmp = x / (z / (y + t));
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.8e-27) or not (z <= 1.0): tmp = x / (z / (y + t)) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.8e-27) || !(z <= 1.0)) tmp = Float64(x / Float64(z / Float64(y + t))); else tmp = Float64(x * Float64(Float64(y / z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.8e-27) || ~((z <= 1.0))) tmp = x / (z / (y + t)); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.8e-27], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x / N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-27} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;\frac{x}{\frac{z}{y + t}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -2.8e-27 or 1 < z Initial program 98.4%
Taylor expanded in z around inf 85.5%
associate-/l*96.7%
associate-/r/80.6%
cancel-sign-sub-inv80.6%
metadata-eval80.6%
*-lft-identity80.6%
+-commutative80.6%
Simplified80.6%
*-commutative80.6%
clear-num80.0%
un-div-inv80.1%
+-commutative80.1%
Applied egg-rr80.1%
associate-/r/96.1%
Simplified96.1%
*-commutative96.1%
clear-num96.0%
un-div-inv96.7%
Applied egg-rr96.7%
if -2.8e-27 < z < 1Initial program 91.7%
Taylor expanded in z around 0 90.8%
+-commutative90.8%
associate-*r/88.7%
*-commutative88.7%
associate-*r*88.7%
neg-mul-188.7%
distribute-rgt-out91.4%
unsub-neg91.4%
Simplified91.4%
Final simplification94.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -0.00031) (not (<= z 0.001))) (* t (/ x z)) (* x (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.00031) || !(z <= 0.001)) {
tmp = t * (x / z);
} else {
tmp = x * -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 <= (-0.00031d0)) .or. (.not. (z <= 0.001d0))) then
tmp = t * (x / z)
else
tmp = x * -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.00031) || !(z <= 0.001)) {
tmp = t * (x / z);
} else {
tmp = x * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -0.00031) or not (z <= 0.001): tmp = t * (x / z) else: tmp = x * -t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -0.00031) || !(z <= 0.001)) tmp = Float64(t * Float64(x / z)); else tmp = Float64(x * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -0.00031) || ~((z <= 0.001))) tmp = t * (x / z); else tmp = x * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.00031], N[Not[LessEqual[z, 0.001]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00031 \lor \neg \left(z \leq 0.001\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\end{array}
\end{array}
if z < -3.1e-4 or 1e-3 < z Initial program 99.0%
Taylor expanded in z around inf 85.9%
associate-/l*97.7%
associate-/r/80.7%
cancel-sign-sub-inv80.7%
metadata-eval80.7%
*-lft-identity80.7%
+-commutative80.7%
Simplified80.7%
Taylor expanded in t around inf 55.1%
associate-*r/50.3%
Simplified50.3%
if -3.1e-4 < z < 1e-3Initial program 91.4%
Taylor expanded in z around 0 89.8%
+-commutative89.8%
associate-*r/87.1%
*-commutative87.1%
associate-*r*87.1%
neg-mul-187.1%
distribute-rgt-out90.5%
unsub-neg90.5%
Simplified90.5%
Taylor expanded in y around 0 38.4%
associate-*r*38.4%
neg-mul-138.4%
*-commutative38.4%
Simplified38.4%
Final simplification44.7%
(FPCore (x y z t) :precision binary64 (* x (- t)))
double code(double x, double y, double z, double t) {
return x * -t;
}
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 * -t
end function
public static double code(double x, double y, double z, double t) {
return x * -t;
}
def code(x, y, z, t): return x * -t
function code(x, y, z, t) return Float64(x * Float64(-t)) end
function tmp = code(x, y, z, t) tmp = x * -t; end
code[x_, y_, z_, t_] := N[(x * (-t)), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(-t\right)
\end{array}
Initial program 95.4%
Taylor expanded in z around 0 60.5%
+-commutative60.5%
associate-*r/61.4%
*-commutative61.4%
associate-*r*61.4%
neg-mul-161.4%
distribute-rgt-out63.0%
unsub-neg63.0%
Simplified63.0%
Taylor expanded in y around 0 26.0%
associate-*r*26.0%
neg-mul-126.0%
*-commutative26.0%
Simplified26.0%
Final simplification26.0%
(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 2023275
(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)))))