
(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 15 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 (/ t (+ z -1.0))) (t_2 (* x (+ (/ y z) t_1))))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 1e+308)))
(* (* x y) (+ (/ 1.0 z) (/ t (* y (+ z -1.0)))))
(+ (* x t_1) (* x (/ y z))))))
double code(double x, double y, double z, double t) {
double t_1 = t / (z + -1.0);
double t_2 = x * ((y / z) + t_1);
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 1e+308)) {
tmp = (x * y) * ((1.0 / z) + (t / (y * (z + -1.0))));
} else {
tmp = (x * t_1) + (x * (y / z));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = t / (z + -1.0);
double t_2 = x * ((y / z) + t_1);
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 1e+308)) {
tmp = (x * y) * ((1.0 / z) + (t / (y * (z + -1.0))));
} else {
tmp = (x * t_1) + (x * (y / z));
}
return tmp;
}
def code(x, y, z, t): t_1 = t / (z + -1.0) t_2 = x * ((y / z) + t_1) tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 1e+308): tmp = (x * y) * ((1.0 / z) + (t / (y * (z + -1.0)))) else: tmp = (x * t_1) + (x * (y / z)) return tmp
function code(x, y, z, t) t_1 = Float64(t / Float64(z + -1.0)) t_2 = Float64(x * Float64(Float64(y / z) + t_1)) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 1e+308)) tmp = Float64(Float64(x * y) * Float64(Float64(1.0 / z) + Float64(t / Float64(y * Float64(z + -1.0))))); else tmp = Float64(Float64(x * t_1) + Float64(x * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t / (z + -1.0); t_2 = x * ((y / z) + t_1); tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 1e+308))) tmp = (x * y) * ((1.0 / z) + (t / (y * (z + -1.0)))); else tmp = (x * t_1) + (x * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / z), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 1e+308]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * N[(N[(1.0 / z), $MachinePrecision] + N[(t / N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * t$95$1), $MachinePrecision] + N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{z + -1}\\
t_2 := x \cdot \left(\frac{y}{z} + t\_1\right)\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 10^{+308}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot \left(\frac{1}{z} + \frac{t}{y \cdot \left(z + -1\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\_1 + x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) < -inf.0 or 1e308 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) Initial program 78.5%
Taylor expanded in y around inf 92.7%
associate-*r/92.7%
associate-*r*92.7%
neg-mul-192.7%
*-commutative92.7%
times-frac92.7%
distribute-frac-neg92.7%
distribute-neg-frac292.7%
neg-sub092.7%
associate--r-92.7%
metadata-eval92.7%
Simplified92.7%
Taylor expanded in x around 0 78.5%
associate-*r*99.8%
sub-neg99.8%
metadata-eval99.8%
associate-/r*99.8%
metadata-eval99.8%
remove-double-neg99.8%
neg-mul-199.8%
lft-mult-inverse99.8%
distribute-rgt-neg-out99.8%
distribute-rgt-in99.8%
+-commutative99.8%
distribute-lft-neg-in99.8%
distribute-neg-frac299.8%
metadata-eval99.8%
sub-neg99.8%
associate-/r*99.8%
Simplified99.8%
if -inf.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) < 1e308Initial program 97.3%
sub-neg97.3%
distribute-rgt-in97.3%
distribute-neg-frac97.3%
Applied egg-rr97.3%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ t (+ z -1.0))) (t_2 (* x (+ (/ y z) t_1))))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 5e+302)))
(/ (* x (- y (* z t))) z)
(+ (* x t_1) (* x (/ y z))))))
double code(double x, double y, double z, double t) {
double t_1 = t / (z + -1.0);
double t_2 = x * ((y / z) + t_1);
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 5e+302)) {
tmp = (x * (y - (z * t))) / z;
} else {
tmp = (x * t_1) + (x * (y / z));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = t / (z + -1.0);
double t_2 = x * ((y / z) + t_1);
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 5e+302)) {
tmp = (x * (y - (z * t))) / z;
} else {
tmp = (x * t_1) + (x * (y / z));
}
return tmp;
}
def code(x, y, z, t): t_1 = t / (z + -1.0) t_2 = x * ((y / z) + t_1) tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 5e+302): tmp = (x * (y - (z * t))) / z else: tmp = (x * t_1) + (x * (y / z)) return tmp
function code(x, y, z, t) t_1 = Float64(t / Float64(z + -1.0)) t_2 = Float64(x * Float64(Float64(y / z) + t_1)) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 5e+302)) tmp = Float64(Float64(x * Float64(y - Float64(z * t))) / z); else tmp = Float64(Float64(x * t_1) + Float64(x * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t / (z + -1.0); t_2 = x * ((y / z) + t_1); tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 5e+302))) tmp = (x * (y - (z * t))) / z; else tmp = (x * t_1) + (x * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / z), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 5e+302]], $MachinePrecision]], N[(N[(x * N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(x * t$95$1), $MachinePrecision] + N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{z + -1}\\
t_2 := x \cdot \left(\frac{y}{z} + t\_1\right)\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 5 \cdot 10^{+302}\right):\\
\;\;\;\;\frac{x \cdot \left(y - z \cdot t\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\_1 + x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) < -inf.0 or 5e302 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) Initial program 78.5%
Taylor expanded in z around 0 97.0%
+-commutative97.0%
mul-1-neg97.0%
unsub-neg97.0%
Simplified97.0%
Taylor expanded in x around 0 97.0%
*-commutative97.0%
Simplified97.0%
if -inf.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) < 5e302Initial program 97.3%
sub-neg97.3%
distribute-rgt-in97.3%
distribute-neg-frac97.3%
Applied egg-rr97.3%
Final simplification97.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ (/ y z) (/ t (+ z -1.0))))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+302)))
(/ (* x (- y (* z t))) z)
t_1)))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) + (t / (z + -1.0)));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+302)) {
tmp = (x * (y - (z * t))) / z;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) + (t / (z + -1.0)));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+302)) {
tmp = (x * (y - (z * t))) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) + (t / (z + -1.0))) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+302): tmp = (x * (y - (z * t))) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) + Float64(t / Float64(z + -1.0)))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+302)) tmp = Float64(Float64(x * Float64(y - Float64(z * t))) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) + (t / (z + -1.0))); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e+302))) tmp = (x * (y - (z * t))) / 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[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+302]], $MachinePrecision]], N[(N[(x * N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} + \frac{t}{z + -1}\right)\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+302}\right):\\
\;\;\;\;\frac{x \cdot \left(y - z \cdot t\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) < -inf.0 or 5e302 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) Initial program 78.5%
Taylor expanded in z around 0 97.0%
+-commutative97.0%
mul-1-neg97.0%
unsub-neg97.0%
Simplified97.0%
Taylor expanded in x around 0 97.0%
*-commutative97.0%
Simplified97.0%
if -inf.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))) < 5e302Initial program 97.3%
Final simplification97.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) t))))
(if (<= z -320000000.0)
(* x (/ (+ y t) z))
(if (<= z -8.4e-286)
t_1
(if (<= z 6e-191)
(/ (* x y) z)
(if (<= z 1.0) t_1 (* x (+ (/ y z) (/ t z)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - t);
double tmp;
if (z <= -320000000.0) {
tmp = x * ((y + t) / z);
} else if (z <= -8.4e-286) {
tmp = t_1;
} else if (z <= 6e-191) {
tmp = (x * y) / z;
} else if (z <= 1.0) {
tmp = t_1;
} else {
tmp = x * ((y / z) + (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) - t)
if (z <= (-320000000.0d0)) then
tmp = x * ((y + t) / z)
else if (z <= (-8.4d-286)) then
tmp = t_1
else if (z <= 6d-191) then
tmp = (x * y) / z
else if (z <= 1.0d0) then
tmp = t_1
else
tmp = x * ((y / z) + (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) - t);
double tmp;
if (z <= -320000000.0) {
tmp = x * ((y + t) / z);
} else if (z <= -8.4e-286) {
tmp = t_1;
} else if (z <= 6e-191) {
tmp = (x * y) / z;
} else if (z <= 1.0) {
tmp = t_1;
} else {
tmp = x * ((y / z) + (t / z));
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - t) tmp = 0 if z <= -320000000.0: tmp = x * ((y + t) / z) elif z <= -8.4e-286: tmp = t_1 elif z <= 6e-191: tmp = (x * y) / z elif z <= 1.0: tmp = t_1 else: tmp = x * ((y / z) + (t / z)) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - t)) tmp = 0.0 if (z <= -320000000.0) tmp = Float64(x * Float64(Float64(y + t) / z)); elseif (z <= -8.4e-286) tmp = t_1; elseif (z <= 6e-191) tmp = Float64(Float64(x * y) / z); elseif (z <= 1.0) tmp = t_1; else tmp = Float64(x * Float64(Float64(y / z) + Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - t); tmp = 0.0; if (z <= -320000000.0) tmp = x * ((y + t) / z); elseif (z <= -8.4e-286) tmp = t_1; elseif (z <= 6e-191) tmp = (x * y) / z; elseif (z <= 1.0) tmp = t_1; else tmp = x * ((y / z) + (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -320000000.0], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.4e-286], t$95$1, If[LessEqual[z, 6e-191], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.0], t$95$1, N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{if}\;z \leq -320000000:\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{elif}\;z \leq -8.4 \cdot 10^{-286}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-191}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\
\end{array}
\end{array}
if z < -3.2e8Initial program 96.0%
Taylor expanded in z around inf 95.6%
associate-/l*95.9%
neg-mul-195.9%
sub-neg95.9%
remove-double-neg95.9%
neg-mul-195.9%
neg-mul-195.9%
distribute-lft-in95.9%
neg-mul-195.9%
sub-neg95.9%
*-commutative95.9%
associate-*l/95.9%
*-commutative95.9%
associate-*r/95.9%
sub-neg95.9%
neg-mul-195.9%
distribute-lft-in95.9%
neg-mul-195.9%
remove-double-neg95.9%
neg-mul-195.9%
remove-double-neg95.9%
+-commutative95.9%
Simplified95.9%
if -3.2e8 < z < -8.39999999999999954e-286 or 6.0000000000000001e-191 < z < 1Initial program 92.8%
Taylor expanded in z around 0 91.6%
if -8.39999999999999954e-286 < z < 6.0000000000000001e-191Initial program 75.1%
Taylor expanded in y around inf 93.6%
if 1 < z Initial program 96.1%
Taylor expanded in z around inf 96.1%
associate-*r/96.1%
neg-mul-196.1%
Simplified96.1%
sub-neg96.1%
add-sqr-sqrt48.1%
sqrt-unprod58.7%
sqr-neg58.7%
sqrt-unprod24.4%
add-sqr-sqrt51.0%
distribute-frac-neg51.0%
add-sqr-sqrt26.6%
sqrt-unprod53.3%
sqr-neg53.3%
sqrt-unprod47.8%
add-sqr-sqrt96.1%
Applied egg-rr96.1%
Final simplification93.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) t))) (t_2 (* x (/ (+ y t) z))))
(if (<= z -320000000.0)
t_2
(if (<= z -7.5e-285)
t_1
(if (<= z 8.7e-191) (/ (* x y) z) (if (<= z 1.0) 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 <= -320000000.0) {
tmp = t_2;
} else if (z <= -7.5e-285) {
tmp = t_1;
} else if (z <= 8.7e-191) {
tmp = (x * y) / z;
} else if (z <= 1.0) {
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 <= (-320000000.0d0)) then
tmp = t_2
else if (z <= (-7.5d-285)) then
tmp = t_1
else if (z <= 8.7d-191) then
tmp = (x * y) / z
else if (z <= 1.0d0) 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 <= -320000000.0) {
tmp = t_2;
} else if (z <= -7.5e-285) {
tmp = t_1;
} else if (z <= 8.7e-191) {
tmp = (x * y) / z;
} else if (z <= 1.0) {
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 <= -320000000.0: tmp = t_2 elif z <= -7.5e-285: tmp = t_1 elif z <= 8.7e-191: tmp = (x * y) / z elif z <= 1.0: 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 <= -320000000.0) tmp = t_2; elseif (z <= -7.5e-285) tmp = t_1; elseif (z <= 8.7e-191) tmp = Float64(Float64(x * y) / z); elseif (z <= 1.0) 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 <= -320000000.0) tmp = t_2; elseif (z <= -7.5e-285) tmp = t_1; elseif (z <= 8.7e-191) tmp = (x * y) / z; elseif (z <= 1.0) 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, -320000000.0], t$95$2, If[LessEqual[z, -7.5e-285], t$95$1, If[LessEqual[z, 8.7e-191], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.0], 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 -320000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-285}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.7 \cdot 10^{-191}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -3.2e8 or 1 < z Initial program 96.1%
Taylor expanded in z around inf 90.2%
associate-/l*96.0%
neg-mul-196.0%
sub-neg96.0%
remove-double-neg96.0%
neg-mul-196.0%
neg-mul-196.0%
distribute-lft-in96.0%
neg-mul-196.0%
sub-neg96.0%
*-commutative96.0%
associate-*l/96.0%
*-commutative96.0%
associate-*r/96.0%
sub-neg96.0%
neg-mul-196.0%
distribute-lft-in96.0%
neg-mul-196.0%
remove-double-neg96.0%
neg-mul-196.0%
remove-double-neg96.0%
+-commutative96.0%
Simplified96.0%
if -3.2e8 < z < -7.4999999999999999e-285 or 8.69999999999999979e-191 < z < 1Initial program 92.8%
Taylor expanded in z around 0 91.6%
if -7.4999999999999999e-285 < z < 8.69999999999999979e-191Initial program 75.1%
Taylor expanded in y around inf 93.6%
Final simplification93.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ x (+ z -1.0)))))
(if (<= t -1.25e+70)
t_1
(if (<= t 1.05e+20)
(/ (* x y) z)
(if (<= t 6e+162)
(* x (- (/ y z) t))
(if (<= t 1.5e+286) (* x (/ t z)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (x / (z + -1.0));
double tmp;
if (t <= -1.25e+70) {
tmp = t_1;
} else if (t <= 1.05e+20) {
tmp = (x * y) / z;
} else if (t <= 6e+162) {
tmp = x * ((y / z) - t);
} else if (t <= 1.5e+286) {
tmp = x * (t / 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 = t * (x / (z + (-1.0d0)))
if (t <= (-1.25d+70)) then
tmp = t_1
else if (t <= 1.05d+20) then
tmp = (x * y) / z
else if (t <= 6d+162) then
tmp = x * ((y / z) - t)
else if (t <= 1.5d+286) then
tmp = x * (t / 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 = t * (x / (z + -1.0));
double tmp;
if (t <= -1.25e+70) {
tmp = t_1;
} else if (t <= 1.05e+20) {
tmp = (x * y) / z;
} else if (t <= 6e+162) {
tmp = x * ((y / z) - t);
} else if (t <= 1.5e+286) {
tmp = x * (t / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (x / (z + -1.0)) tmp = 0 if t <= -1.25e+70: tmp = t_1 elif t <= 1.05e+20: tmp = (x * y) / z elif t <= 6e+162: tmp = x * ((y / z) - t) elif t <= 1.5e+286: tmp = x * (t / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(x / Float64(z + -1.0))) tmp = 0.0 if (t <= -1.25e+70) tmp = t_1; elseif (t <= 1.05e+20) tmp = Float64(Float64(x * y) / z); elseif (t <= 6e+162) tmp = Float64(x * Float64(Float64(y / z) - t)); elseif (t <= 1.5e+286) tmp = Float64(x * Float64(t / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (x / (z + -1.0)); tmp = 0.0; if (t <= -1.25e+70) tmp = t_1; elseif (t <= 1.05e+20) tmp = (x * y) / z; elseif (t <= 6e+162) tmp = x * ((y / z) - t); elseif (t <= 1.5e+286) tmp = x * (t / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.25e+70], t$95$1, If[LessEqual[t, 1.05e+20], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 6e+162], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e+286], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{x}{z + -1}\\
\mathbf{if}\;t \leq -1.25 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+20}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+162}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{+286}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.2500000000000001e70 or 1.4999999999999999e286 < t Initial program 94.9%
Taylor expanded in y around 0 82.4%
mul-1-neg82.4%
associate-/l*82.4%
distribute-rgt-neg-in82.4%
distribute-neg-frac282.4%
neg-sub082.4%
associate--r-82.4%
metadata-eval82.4%
Simplified82.4%
if -1.2500000000000001e70 < t < 1.05e20Initial program 91.3%
Taylor expanded in y around inf 85.0%
if 1.05e20 < t < 5.9999999999999996e162Initial program 97.0%
Taylor expanded in z around 0 66.3%
if 5.9999999999999996e162 < t < 1.4999999999999999e286Initial program 86.3%
Taylor expanded in y around 0 72.1%
mul-1-neg72.1%
distribute-neg-frac272.1%
neg-sub072.1%
associate--r-72.1%
metadata-eval72.1%
Simplified72.1%
Taylor expanded in z around inf 65.6%
Final simplification80.0%
(FPCore (x y z t)
:precision binary64
(if (or (<= z -1.0)
(and (not (<= z -4.2e-285)) (or (<= z 1.35e-245) (not (<= z 1.25)))))
(* t (/ x z))
(* x (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || (!(z <= -4.2e-285) && ((z <= 1.35e-245) || !(z <= 1.25)))) {
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 <= (-1.0d0)) .or. (.not. (z <= (-4.2d-285))) .and. (z <= 1.35d-245) .or. (.not. (z <= 1.25d0))) 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 <= -1.0) || (!(z <= -4.2e-285) && ((z <= 1.35e-245) || !(z <= 1.25)))) {
tmp = t * (x / z);
} else {
tmp = x * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or (not (z <= -4.2e-285) and ((z <= 1.35e-245) or not (z <= 1.25))): tmp = t * (x / z) else: tmp = x * -t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || (!(z <= -4.2e-285) && ((z <= 1.35e-245) || !(z <= 1.25)))) 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 <= -1.0) || (~((z <= -4.2e-285)) && ((z <= 1.35e-245) || ~((z <= 1.25))))) tmp = t * (x / z); else tmp = x * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], And[N[Not[LessEqual[z, -4.2e-285]], $MachinePrecision], Or[LessEqual[z, 1.35e-245], N[Not[LessEqual[z, 1.25]], $MachinePrecision]]]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq -4.2 \cdot 10^{-285}\right) \land \left(z \leq 1.35 \cdot 10^{-245} \lor \neg \left(z \leq 1.25\right)\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\end{array}
\end{array}
if z < -1 or -4.19999999999999968e-285 < z < 1.34999999999999995e-245 or 1.25 < z Initial program 93.1%
Taylor expanded in y around 0 55.1%
mul-1-neg55.1%
distribute-neg-frac255.1%
neg-sub055.1%
associate--r-55.1%
metadata-eval55.1%
Simplified55.1%
Taylor expanded in z around inf 54.0%
associate-/l*51.8%
Simplified51.8%
if -1 < z < -4.19999999999999968e-285 or 1.34999999999999995e-245 < z < 1.25Initial program 91.2%
Taylor expanded in y around 0 37.0%
mul-1-neg37.0%
distribute-neg-frac237.0%
neg-sub037.0%
associate--r-37.0%
metadata-eval37.0%
Simplified37.0%
Taylor expanded in z around 0 35.9%
mul-1-neg35.9%
Simplified35.9%
Final simplification44.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))) (t_2 (* t (- x))))
(if (<= z -1.0)
t_1
(if (<= z -7.2e-285)
t_2
(if (<= z 1.5e-248) (* t (/ x z)) (if (<= z 1.0) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double t_2 = t * -x;
double tmp;
if (z <= -1.0) {
tmp = t_1;
} else if (z <= -7.2e-285) {
tmp = t_2;
} else if (z <= 1.5e-248) {
tmp = t * (x / z);
} else if (z <= 1.0) {
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 = t * -x
if (z <= (-1.0d0)) then
tmp = t_1
else if (z <= (-7.2d-285)) then
tmp = t_2
else if (z <= 1.5d-248) then
tmp = t * (x / z)
else if (z <= 1.0d0) 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 = t * -x;
double tmp;
if (z <= -1.0) {
tmp = t_1;
} else if (z <= -7.2e-285) {
tmp = t_2;
} else if (z <= 1.5e-248) {
tmp = t * (x / z);
} else if (z <= 1.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) t_2 = t * -x tmp = 0 if z <= -1.0: tmp = t_1 elif z <= -7.2e-285: tmp = t_2 elif z <= 1.5e-248: tmp = t * (x / z) elif z <= 1.0: 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(t * Float64(-x)) tmp = 0.0 if (z <= -1.0) tmp = t_1; elseif (z <= -7.2e-285) tmp = t_2; elseif (z <= 1.5e-248) tmp = Float64(t * Float64(x / z)); elseif (z <= 1.0) 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 = t * -x; tmp = 0.0; if (z <= -1.0) tmp = t_1; elseif (z <= -7.2e-285) tmp = t_2; elseif (z <= 1.5e-248) tmp = t * (x / z); elseif (z <= 1.0) 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[(t * (-x)), $MachinePrecision]}, If[LessEqual[z, -1.0], t$95$1, If[LessEqual[z, -7.2e-285], t$95$2, If[LessEqual[z, 1.5e-248], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
t_2 := t \cdot \left(-x\right)\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-285}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-248}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 96.1%
Taylor expanded in y around 0 61.4%
mul-1-neg61.4%
distribute-neg-frac261.4%
neg-sub061.4%
associate--r-61.4%
metadata-eval61.4%
Simplified61.4%
Taylor expanded in z around inf 61.4%
if -1 < z < -7.20000000000000008e-285 or 1.50000000000000007e-248 < z < 1Initial program 91.2%
Taylor expanded in y around 0 37.0%
mul-1-neg37.0%
distribute-neg-frac237.0%
neg-sub037.0%
associate--r-37.0%
metadata-eval37.0%
Simplified37.0%
Taylor expanded in z around 0 35.9%
mul-1-neg35.9%
Simplified35.9%
if -7.20000000000000008e-285 < z < 1.50000000000000007e-248Initial program 71.1%
Taylor expanded in y around 0 7.8%
mul-1-neg7.8%
distribute-neg-frac27.8%
neg-sub07.8%
associate--r-7.8%
metadata-eval7.8%
Simplified7.8%
Taylor expanded in z around inf 33.8%
associate-/l*39.7%
Simplified39.7%
Final simplification48.0%
(FPCore (x y z t) :precision binary64 (if (<= z -320000000.0) (* x (/ (+ y t) z)) (if (<= z 1.0) (/ (* x (- y (* z t))) z) (* x (+ (/ y z) (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -320000000.0) {
tmp = x * ((y + t) / z);
} else if (z <= 1.0) {
tmp = (x * (y - (z * t))) / z;
} else {
tmp = x * ((y / z) + (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) :: tmp
if (z <= (-320000000.0d0)) then
tmp = x * ((y + t) / z)
else if (z <= 1.0d0) then
tmp = (x * (y - (z * t))) / z
else
tmp = x * ((y / z) + (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -320000000.0) {
tmp = x * ((y + t) / z);
} else if (z <= 1.0) {
tmp = (x * (y - (z * t))) / z;
} else {
tmp = x * ((y / z) + (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -320000000.0: tmp = x * ((y + t) / z) elif z <= 1.0: tmp = (x * (y - (z * t))) / z else: tmp = x * ((y / z) + (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -320000000.0) tmp = Float64(x * Float64(Float64(y + t) / z)); elseif (z <= 1.0) tmp = Float64(Float64(x * Float64(y - Float64(z * t))) / z); else tmp = Float64(x * Float64(Float64(y / z) + Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -320000000.0) tmp = x * ((y + t) / z); elseif (z <= 1.0) tmp = (x * (y - (z * t))) / z; else tmp = x * ((y / z) + (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -320000000.0], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x * N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -320000000:\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{x \cdot \left(y - z \cdot t\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\
\end{array}
\end{array}
if z < -3.2e8Initial program 96.0%
Taylor expanded in z around inf 95.6%
associate-/l*95.9%
neg-mul-195.9%
sub-neg95.9%
remove-double-neg95.9%
neg-mul-195.9%
neg-mul-195.9%
distribute-lft-in95.9%
neg-mul-195.9%
sub-neg95.9%
*-commutative95.9%
associate-*l/95.9%
*-commutative95.9%
associate-*r/95.9%
sub-neg95.9%
neg-mul-195.9%
distribute-lft-in95.9%
neg-mul-195.9%
remove-double-neg95.9%
neg-mul-195.9%
remove-double-neg95.9%
+-commutative95.9%
Simplified95.9%
if -3.2e8 < z < 1Initial program 89.0%
Taylor expanded in z around 0 88.8%
+-commutative88.8%
mul-1-neg88.8%
unsub-neg88.8%
Simplified88.8%
Taylor expanded in x around 0 94.0%
*-commutative94.0%
Simplified94.0%
if 1 < z Initial program 96.1%
Taylor expanded in z around inf 96.1%
associate-*r/96.1%
neg-mul-196.1%
Simplified96.1%
sub-neg96.1%
add-sqr-sqrt48.1%
sqrt-unprod58.7%
sqr-neg58.7%
sqrt-unprod24.4%
add-sqr-sqrt51.0%
distribute-frac-neg51.0%
add-sqr-sqrt26.6%
sqrt-unprod53.3%
sqr-neg53.3%
sqrt-unprod47.8%
add-sqr-sqrt96.1%
Applied egg-rr96.1%
Final simplification94.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.1e+70) (not (<= t 4.8e+43))) (* x (/ t (+ z -1.0))) (/ (* x y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.1e+70) || !(t <= 4.8e+43)) {
tmp = x * (t / (z + -1.0));
} 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 <= (-4.1d+70)) .or. (.not. (t <= 4.8d+43))) then
tmp = x * (t / (z + (-1.0d0)))
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 <= -4.1e+70) || !(t <= 4.8e+43)) {
tmp = x * (t / (z + -1.0));
} else {
tmp = (x * y) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.1e+70) or not (t <= 4.8e+43): tmp = x * (t / (z + -1.0)) else: tmp = (x * y) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.1e+70) || !(t <= 4.8e+43)) tmp = Float64(x * Float64(t / Float64(z + -1.0))); else tmp = Float64(Float64(x * y) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.1e+70) || ~((t <= 4.8e+43))) tmp = x * (t / (z + -1.0)); else tmp = (x * y) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.1e+70], N[Not[LessEqual[t, 4.8e+43]], $MachinePrecision]], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{+70} \lor \neg \left(t \leq 4.8 \cdot 10^{+43}\right):\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}
\end{array}
if t < -4.1000000000000002e70 or 4.80000000000000046e43 < t Initial program 93.0%
Taylor expanded in y around 0 79.2%
mul-1-neg79.2%
distribute-neg-frac279.2%
neg-sub079.2%
associate--r-79.2%
metadata-eval79.2%
Simplified79.2%
if -4.1000000000000002e70 < t < 4.80000000000000046e43Initial program 91.7%
Taylor expanded in y around inf 84.3%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.65e+70) (not (<= t 2.4e+43))) (* t (/ x (+ z -1.0))) (/ (* x y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.65e+70) || !(t <= 2.4e+43)) {
tmp = t * (x / (z + -1.0));
} 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 <= (-1.65d+70)) .or. (.not. (t <= 2.4d+43))) then
tmp = t * (x / (z + (-1.0d0)))
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 <= -1.65e+70) || !(t <= 2.4e+43)) {
tmp = t * (x / (z + -1.0));
} else {
tmp = (x * y) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.65e+70) or not (t <= 2.4e+43): tmp = t * (x / (z + -1.0)) else: tmp = (x * y) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.65e+70) || !(t <= 2.4e+43)) tmp = Float64(t * Float64(x / Float64(z + -1.0))); else tmp = Float64(Float64(x * y) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.65e+70) || ~((t <= 2.4e+43))) tmp = t * (x / (z + -1.0)); else tmp = (x * y) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.65e+70], N[Not[LessEqual[t, 2.4e+43]], $MachinePrecision]], N[(t * N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{+70} \lor \neg \left(t \leq 2.4 \cdot 10^{+43}\right):\\
\;\;\;\;t \cdot \frac{x}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}
\end{array}
if t < -1.65000000000000008e70 or 2.40000000000000023e43 < t Initial program 93.0%
Taylor expanded in y around 0 74.0%
mul-1-neg74.0%
associate-/l*70.5%
distribute-rgt-neg-in70.5%
distribute-neg-frac270.5%
neg-sub070.5%
associate--r-70.5%
metadata-eval70.5%
Simplified70.5%
if -1.65000000000000008e70 < t < 2.40000000000000023e43Initial program 91.7%
Taylor expanded in y around inf 84.3%
Final simplification78.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5e+71) (not (<= t 4.2e+145))) (* x (/ t z)) (/ (* x y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5e+71) || !(t <= 4.2e+145)) {
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 <= (-5d+71)) .or. (.not. (t <= 4.2d+145))) 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 <= -5e+71) || !(t <= 4.2e+145)) {
tmp = x * (t / z);
} else {
tmp = (x * y) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5e+71) or not (t <= 4.2e+145): tmp = x * (t / z) else: tmp = (x * y) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5e+71) || !(t <= 4.2e+145)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(Float64(x * y) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -5e+71) || ~((t <= 4.2e+145))) tmp = x * (t / z); else tmp = (x * y) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5e+71], N[Not[LessEqual[t, 4.2e+145]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+71} \lor \neg \left(t \leq 4.2 \cdot 10^{+145}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\end{array}
\end{array}
if t < -4.99999999999999972e71 or 4.19999999999999979e145 < t Initial program 92.4%
Taylor expanded in y around 0 82.0%
mul-1-neg82.0%
distribute-neg-frac282.0%
neg-sub082.0%
associate--r-82.0%
metadata-eval82.0%
Simplified82.0%
Taylor expanded in z around inf 62.6%
if -4.99999999999999972e71 < t < 4.19999999999999979e145Initial program 92.2%
Taylor expanded in y around inf 78.8%
Final simplification73.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.38e+72) (not (<= t 2.2e+144))) (* x (/ t z)) (* y (/ x z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.38e+72) || !(t <= 2.2e+144)) {
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 <= (-1.38d+72)) .or. (.not. (t <= 2.2d+144))) 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 <= -1.38e+72) || !(t <= 2.2e+144)) {
tmp = x * (t / z);
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.38e+72) or not (t <= 2.2e+144): tmp = x * (t / z) else: tmp = y * (x / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.38e+72) || !(t <= 2.2e+144)) 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 <= -1.38e+72) || ~((t <= 2.2e+144))) tmp = x * (t / z); else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.38e+72], N[Not[LessEqual[t, 2.2e+144]], $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 -1.38 \cdot 10^{+72} \lor \neg \left(t \leq 2.2 \cdot 10^{+144}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if t < -1.37999999999999995e72 or 2.19999999999999988e144 < t Initial program 92.4%
Taylor expanded in y around 0 82.0%
mul-1-neg82.0%
distribute-neg-frac282.0%
neg-sub082.0%
associate--r-82.0%
metadata-eval82.0%
Simplified82.0%
Taylor expanded in z around inf 62.6%
if -1.37999999999999995e72 < t < 2.19999999999999988e144Initial program 92.2%
Taylor expanded in y around inf 90.5%
associate-*r/90.5%
associate-*r*90.5%
neg-mul-190.5%
*-commutative90.5%
times-frac84.5%
distribute-frac-neg84.5%
distribute-neg-frac284.5%
neg-sub084.5%
associate--r-84.5%
metadata-eval84.5%
Simplified84.5%
Taylor expanded in t around 0 78.7%
Final simplification73.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8.6e+71) (not (<= t 4.8e+139))) (* x (/ t z)) (* x (/ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.6e+71) || !(t <= 4.8e+139)) {
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 <= (-8.6d+71)) .or. (.not. (t <= 4.8d+139))) 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 <= -8.6e+71) || !(t <= 4.8e+139)) {
tmp = x * (t / z);
} else {
tmp = x * (y / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -8.6e+71) or not (t <= 4.8e+139): tmp = x * (t / z) else: tmp = x * (y / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -8.6e+71) || !(t <= 4.8e+139)) 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 <= -8.6e+71) || ~((t <= 4.8e+139))) tmp = x * (t / z); else tmp = x * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -8.6e+71], N[Not[LessEqual[t, 4.8e+139]], $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 -8.6 \cdot 10^{+71} \lor \neg \left(t \leq 4.8 \cdot 10^{+139}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if t < -8.59999999999999967e71 or 4.80000000000000016e139 < t Initial program 91.4%
Taylor expanded in y around 0 81.1%
mul-1-neg81.1%
distribute-neg-frac281.1%
neg-sub081.1%
associate--r-81.1%
metadata-eval81.1%
Simplified81.1%
Taylor expanded in z around inf 62.0%
if -8.59999999999999967e71 < t < 4.80000000000000016e139Initial program 92.7%
Taylor expanded in y around inf 78.7%
associate-*r/77.3%
Simplified77.3%
Final simplification72.0%
(FPCore (x y z t) :precision binary64 (* t (- x)))
double code(double x, double y, double z, double t) {
return t * -x;
}
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 = t * -x
end function
public static double code(double x, double y, double z, double t) {
return t * -x;
}
def code(x, y, z, t): return t * -x
function code(x, y, z, t) return Float64(t * Float64(-x)) end
function tmp = code(x, y, z, t) tmp = t * -x; end
code[x_, y_, z_, t_] := N[(t * (-x)), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(-x\right)
\end{array}
Initial program 92.2%
Taylor expanded in y around 0 46.6%
mul-1-neg46.6%
distribute-neg-frac246.6%
neg-sub046.6%
associate--r-46.6%
metadata-eval46.6%
Simplified46.6%
Taylor expanded in z around 0 22.9%
mul-1-neg22.9%
Simplified22.9%
Final simplification22.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 2024110
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:alt
(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)))))