
(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 12 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 (* x (- (/ y z) (/ t (- 1.0 z))))))
(if (<= t_1 (- INFINITY))
(/ (- (* y (- 1.0 z)) (* z t)) (/ (* z (- 1.0 z)) x))
(if (or (<= t_1 -1e-240) (not (<= t_1 0.0))) t_1 (/ (* x (+ y t)) z)))))
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 = ((y * (1.0 - z)) - (z * t)) / ((z * (1.0 - z)) / x);
} else if ((t_1 <= -1e-240) || !(t_1 <= 0.0)) {
tmp = t_1;
} else {
tmp = (x * (y + t)) / z;
}
return tmp;
}
public static 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.POSITIVE_INFINITY) {
tmp = ((y * (1.0 - z)) - (z * t)) / ((z * (1.0 - z)) / x);
} else if ((t_1 <= -1e-240) || !(t_1 <= 0.0)) {
tmp = t_1;
} else {
tmp = (x * (y + t)) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - (t / (1.0 - z))) tmp = 0 if t_1 <= -math.inf: tmp = ((y * (1.0 - z)) - (z * t)) / ((z * (1.0 - z)) / x) elif (t_1 <= -1e-240) or not (t_1 <= 0.0): tmp = t_1 else: tmp = (x * (y + t)) / z 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(Float64(y * Float64(1.0 - z)) - Float64(z * t)) / Float64(Float64(z * Float64(1.0 - z)) / x)); elseif ((t_1 <= -1e-240) || !(t_1 <= 0.0)) tmp = t_1; else tmp = Float64(Float64(x * Float64(y + t)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - (t / (1.0 - z))); tmp = 0.0; if (t_1 <= -Inf) tmp = ((y * (1.0 - z)) - (z * t)) / ((z * (1.0 - z)) / x); elseif ((t_1 <= -1e-240) || ~((t_1 <= 0.0))) tmp = t_1; else tmp = (x * (y + t)) / z; 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 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -1e-240], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], t$95$1, N[(N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]
\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{y \cdot \left(1 - z\right) - z \cdot t}{\frac{z \cdot \left(1 - z\right)}{x}}\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{-240} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y + t\right)}{z}\\
\end{array}
\end{array}
if (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) < -inf.0Initial program 75.1%
*-commutative75.1%
frac-sub75.1%
associate-*l/100.0%
associate-/l*100.0%
Applied egg-rr100.0%
if -inf.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) < -9.9999999999999997e-241 or -0.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) Initial program 98.3%
if -9.9999999999999997e-241 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) < -0.0Initial program 78.4%
Taylor expanded in z around inf 99.9%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) (/ t (- 1.0 z))))))
(if (<= t_1 -5e+301)
(/ (+ y t) (/ z x))
(if (or (<= t_1 -1e-240) (not (<= t_1 0.0))) t_1 (/ (* x (+ y t)) z)))))
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 <= -5e+301) {
tmp = (y + t) / (z / x);
} else if ((t_1 <= -1e-240) || !(t_1 <= 0.0)) {
tmp = t_1;
} else {
tmp = (x * (y + 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 / (1.0d0 - z)))
if (t_1 <= (-5d+301)) then
tmp = (y + t) / (z / x)
else if ((t_1 <= (-1d-240)) .or. (.not. (t_1 <= 0.0d0))) then
tmp = t_1
else
tmp = (x * (y + 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 / (1.0 - z)));
double tmp;
if (t_1 <= -5e+301) {
tmp = (y + t) / (z / x);
} else if ((t_1 <= -1e-240) || !(t_1 <= 0.0)) {
tmp = t_1;
} else {
tmp = (x * (y + t)) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - (t / (1.0 - z))) tmp = 0 if t_1 <= -5e+301: tmp = (y + t) / (z / x) elif (t_1 <= -1e-240) or not (t_1 <= 0.0): tmp = t_1 else: tmp = (x * (y + t)) / z 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 <= -5e+301) tmp = Float64(Float64(y + t) / Float64(z / x)); elseif ((t_1 <= -1e-240) || !(t_1 <= 0.0)) tmp = t_1; else tmp = Float64(Float64(x * Float64(y + t)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - (t / (1.0 - z))); tmp = 0.0; if (t_1 <= -5e+301) tmp = (y + t) / (z / x); elseif ((t_1 <= -1e-240) || ~((t_1 <= 0.0))) tmp = t_1; else tmp = (x * (y + t)) / z; 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 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+301], N[(N[(y + t), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -1e-240], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], t$95$1, N[(N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+301}:\\
\;\;\;\;\frac{y + t}{\frac{z}{x}}\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{-240} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y + t\right)}{z}\\
\end{array}
\end{array}
if (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) < -5.0000000000000004e301Initial program 77.1%
add-cube-cbrt76.9%
pow377.0%
Applied egg-rr77.0%
rem-cube-cbrt77.1%
frac-sub69.8%
associate-*r/92.6%
Applied egg-rr92.6%
*-commutative92.6%
associate-/l*92.7%
*-commutative92.7%
*-commutative92.7%
*-commutative92.7%
associate-/l*93.0%
Simplified93.0%
Taylor expanded in z around -inf 90.3%
*-commutative90.3%
associate-/l*97.3%
mul-1-neg97.3%
sub-neg97.3%
remove-double-neg97.3%
Simplified97.3%
if -5.0000000000000004e301 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) < -9.9999999999999997e-241 or -0.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) Initial program 98.3%
if -9.9999999999999997e-241 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) < -0.0Initial program 78.4%
Taylor expanded in z around inf 99.9%
Final simplification98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) (/ t (- 1.0 z))))))
(if (<= t_1 (- INFINITY))
(/ (* x (- (* y (- 1.0 z)) (* z t))) (* z (- 1.0 z)))
(if (or (<= t_1 -1e-240) (not (<= t_1 0.0))) t_1 (/ (* x (+ y t)) z)))))
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 * ((y * (1.0 - z)) - (z * t))) / (z * (1.0 - z));
} else if ((t_1 <= -1e-240) || !(t_1 <= 0.0)) {
tmp = t_1;
} else {
tmp = (x * (y + t)) / z;
}
return tmp;
}
public static 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.POSITIVE_INFINITY) {
tmp = (x * ((y * (1.0 - z)) - (z * t))) / (z * (1.0 - z));
} else if ((t_1 <= -1e-240) || !(t_1 <= 0.0)) {
tmp = t_1;
} else {
tmp = (x * (y + t)) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - (t / (1.0 - z))) tmp = 0 if t_1 <= -math.inf: tmp = (x * ((y * (1.0 - z)) - (z * t))) / (z * (1.0 - z)) elif (t_1 <= -1e-240) or not (t_1 <= 0.0): tmp = t_1 else: tmp = (x * (y + t)) / z 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 * Float64(Float64(y * Float64(1.0 - z)) - Float64(z * t))) / Float64(z * Float64(1.0 - z))); elseif ((t_1 <= -1e-240) || !(t_1 <= 0.0)) tmp = t_1; else tmp = Float64(Float64(x * Float64(y + t)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - (t / (1.0 - z))); tmp = 0.0; if (t_1 <= -Inf) tmp = (x * ((y * (1.0 - z)) - (z * t))) / (z * (1.0 - z)); elseif ((t_1 <= -1e-240) || ~((t_1 <= 0.0))) tmp = t_1; else tmp = (x * (y + t)) / z; 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 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x * N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -1e-240], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], t$95$1, N[(N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]
\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 \left(y \cdot \left(1 - z\right) - z \cdot t\right)}{z \cdot \left(1 - z\right)}\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{-240} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y + t\right)}{z}\\
\end{array}
\end{array}
if (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) < -inf.0Initial program 75.1%
*-commutative75.1%
frac-sub75.1%
associate-*l/100.0%
Applied egg-rr100.0%
if -inf.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) < -9.9999999999999997e-241 or -0.0 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) Initial program 98.3%
if -9.9999999999999997e-241 < (*.f64 x (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z)))) < -0.0Initial program 78.4%
Taylor expanded in z around inf 99.9%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) t))))
(if (<= z -2e+42)
(/ x (/ z t))
(if (<= z -7.5e-198)
t_1
(if (<= z 2.15e-259)
(/ (* x y) z)
(if (<= z 820000000000.0)
t_1
(if (<= z 5e+90) (* x (/ t z)) (/ x (/ z y)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - t);
double tmp;
if (z <= -2e+42) {
tmp = x / (z / t);
} else if (z <= -7.5e-198) {
tmp = t_1;
} else if (z <= 2.15e-259) {
tmp = (x * y) / z;
} else if (z <= 820000000000.0) {
tmp = t_1;
} else if (z <= 5e+90) {
tmp = x * (t / z);
} 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) :: t_1
real(8) :: tmp
t_1 = x * ((y / z) - t)
if (z <= (-2d+42)) then
tmp = x / (z / t)
else if (z <= (-7.5d-198)) then
tmp = t_1
else if (z <= 2.15d-259) then
tmp = (x * y) / z
else if (z <= 820000000000.0d0) then
tmp = t_1
else if (z <= 5d+90) then
tmp = x * (t / z)
else
tmp = x / (z / y)
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 <= -2e+42) {
tmp = x / (z / t);
} else if (z <= -7.5e-198) {
tmp = t_1;
} else if (z <= 2.15e-259) {
tmp = (x * y) / z;
} else if (z <= 820000000000.0) {
tmp = t_1;
} else if (z <= 5e+90) {
tmp = x * (t / z);
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - t) tmp = 0 if z <= -2e+42: tmp = x / (z / t) elif z <= -7.5e-198: tmp = t_1 elif z <= 2.15e-259: tmp = (x * y) / z elif z <= 820000000000.0: tmp = t_1 elif z <= 5e+90: tmp = x * (t / z) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - t)) tmp = 0.0 if (z <= -2e+42) tmp = Float64(x / Float64(z / t)); elseif (z <= -7.5e-198) tmp = t_1; elseif (z <= 2.15e-259) tmp = Float64(Float64(x * y) / z); elseif (z <= 820000000000.0) tmp = t_1; elseif (z <= 5e+90) tmp = Float64(x * Float64(t / z)); else tmp = Float64(x / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - t); tmp = 0.0; if (z <= -2e+42) tmp = x / (z / t); elseif (z <= -7.5e-198) tmp = t_1; elseif (z <= 2.15e-259) tmp = (x * y) / z; elseif (z <= 820000000000.0) tmp = t_1; elseif (z <= 5e+90) tmp = x * (t / z); else tmp = x / (z / y); 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, -2e+42], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.5e-198], t$95$1, If[LessEqual[z, 2.15e-259], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 820000000000.0], t$95$1, If[LessEqual[z, 5e+90], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{+42}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-198}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-259}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq 820000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+90}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if z < -2.00000000000000009e42Initial program 92.5%
flip--75.2%
associate-*r/67.9%
associate-/l*75.2%
*-un-lft-identity75.2%
associate-/l*75.2%
flip--91.7%
Applied egg-rr91.7%
Taylor expanded in y around 0 69.7%
associate-*r/69.7%
neg-mul-169.7%
neg-sub069.7%
associate--r-69.7%
metadata-eval69.7%
Simplified69.7%
Taylor expanded in z around inf 69.7%
if -2.00000000000000009e42 < z < -7.50000000000000064e-198 or 2.15e-259 < z < 8.2e11Initial program 95.0%
Taylor expanded in z around 0 91.1%
if -7.50000000000000064e-198 < z < 2.15e-259Initial program 83.1%
Taylor expanded in y around inf 96.9%
if 8.2e11 < z < 5.0000000000000004e90Initial program 99.7%
Taylor expanded in y around 0 75.7%
associate-*r/75.7%
associate-*r*75.7%
mul-1-neg75.7%
associate-*l/75.8%
*-commutative75.8%
Simplified75.8%
Taylor expanded in z around inf 75.8%
if 5.0000000000000004e90 < z Initial program 92.1%
flip--68.4%
associate-*r/60.6%
associate-/l*68.3%
*-un-lft-identity68.3%
associate-/l*68.4%
flip--91.5%
Applied egg-rr91.5%
Taylor expanded in y around inf 59.0%
associate-/l*68.9%
Simplified68.9%
Final simplification83.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) t))) (t_2 (* (+ y t) (/ x z))))
(if (<= z -4.15e+21)
t_2
(if (<= z -6.5e-198)
t_1
(if (<= z 1.9e-259) (/ (* x y) z) (if (<= z 1.45e-14) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - t);
double t_2 = (y + t) * (x / z);
double tmp;
if (z <= -4.15e+21) {
tmp = t_2;
} else if (z <= -6.5e-198) {
tmp = t_1;
} else if (z <= 1.9e-259) {
tmp = (x * y) / z;
} else if (z <= 1.45e-14) {
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 = (y + t) * (x / z)
if (z <= (-4.15d+21)) then
tmp = t_2
else if (z <= (-6.5d-198)) then
tmp = t_1
else if (z <= 1.9d-259) then
tmp = (x * y) / z
else if (z <= 1.45d-14) 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 = (y + t) * (x / z);
double tmp;
if (z <= -4.15e+21) {
tmp = t_2;
} else if (z <= -6.5e-198) {
tmp = t_1;
} else if (z <= 1.9e-259) {
tmp = (x * y) / z;
} else if (z <= 1.45e-14) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - t) t_2 = (y + t) * (x / z) tmp = 0 if z <= -4.15e+21: tmp = t_2 elif z <= -6.5e-198: tmp = t_1 elif z <= 1.9e-259: tmp = (x * y) / z elif z <= 1.45e-14: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - t)) t_2 = Float64(Float64(y + t) * Float64(x / z)) tmp = 0.0 if (z <= -4.15e+21) tmp = t_2; elseif (z <= -6.5e-198) tmp = t_1; elseif (z <= 1.9e-259) tmp = Float64(Float64(x * y) / z); elseif (z <= 1.45e-14) 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 = (y + t) * (x / z); tmp = 0.0; if (z <= -4.15e+21) tmp = t_2; elseif (z <= -6.5e-198) tmp = t_1; elseif (z <= 1.9e-259) tmp = (x * y) / z; elseif (z <= 1.45e-14) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y + t), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.15e+21], t$95$2, If[LessEqual[z, -6.5e-198], t$95$1, If[LessEqual[z, 1.9e-259], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.45e-14], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t\right)\\
t_2 := \left(y + t\right) \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -4.15 \cdot 10^{+21}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-198}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-259}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-14}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -4.15e21 or 1.4500000000000001e-14 < z Initial program 93.9%
add-cube-cbrt92.4%
pow392.5%
Applied egg-rr92.5%
Taylor expanded in z around inf 86.0%
associate-/l*92.3%
associate-/r/87.3%
cancel-sign-sub-inv87.3%
metadata-eval87.3%
*-lft-identity87.3%
+-commutative87.3%
Simplified87.3%
if -4.15e21 < z < -6.5000000000000004e-198 or 1.9e-259 < z < 1.4500000000000001e-14Initial program 94.5%
Taylor expanded in z around 0 93.8%
if -6.5000000000000004e-198 < z < 1.9e-259Initial program 83.1%
Taylor expanded in y around inf 96.9%
Final simplification91.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) t))) (t_2 (/ x (/ z (+ y t)))))
(if (<= z -4.15e+21)
t_2
(if (<= z -7e-198)
t_1
(if (<= z 1.9e-259) (/ (* x y) z) (if (<= z 1.45e-14) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - t);
double t_2 = x / (z / (y + t));
double tmp;
if (z <= -4.15e+21) {
tmp = t_2;
} else if (z <= -7e-198) {
tmp = t_1;
} else if (z <= 1.9e-259) {
tmp = (x * y) / z;
} else if (z <= 1.45e-14) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * ((y / z) - t)
t_2 = x / (z / (y + t))
if (z <= (-4.15d+21)) then
tmp = t_2
else if (z <= (-7d-198)) then
tmp = t_1
else if (z <= 1.9d-259) then
tmp = (x * y) / z
else if (z <= 1.45d-14) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - t);
double t_2 = x / (z / (y + t));
double tmp;
if (z <= -4.15e+21) {
tmp = t_2;
} else if (z <= -7e-198) {
tmp = t_1;
} else if (z <= 1.9e-259) {
tmp = (x * y) / z;
} else if (z <= 1.45e-14) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - t) t_2 = x / (z / (y + t)) tmp = 0 if z <= -4.15e+21: tmp = t_2 elif z <= -7e-198: tmp = t_1 elif z <= 1.9e-259: tmp = (x * y) / z elif z <= 1.45e-14: 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(z / Float64(y + t))) tmp = 0.0 if (z <= -4.15e+21) tmp = t_2; elseif (z <= -7e-198) tmp = t_1; elseif (z <= 1.9e-259) tmp = Float64(Float64(x * y) / z); elseif (z <= 1.45e-14) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - t); t_2 = x / (z / (y + t)); tmp = 0.0; if (z <= -4.15e+21) tmp = t_2; elseif (z <= -7e-198) tmp = t_1; elseif (z <= 1.9e-259) tmp = (x * y) / z; elseif (z <= 1.45e-14) 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[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.15e+21], t$95$2, If[LessEqual[z, -7e-198], t$95$1, If[LessEqual[z, 1.9e-259], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.45e-14], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t\right)\\
t_2 := \frac{x}{\frac{z}{y + t}}\\
\mathbf{if}\;z \leq -4.15 \cdot 10^{+21}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-198}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-259}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-14}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -4.15e21 or 1.4500000000000001e-14 < z Initial program 93.9%
add-cube-cbrt92.4%
pow392.5%
Applied egg-rr92.5%
Taylor expanded in z around inf 86.0%
associate-/l*92.3%
cancel-sign-sub-inv92.3%
metadata-eval92.3%
*-lft-identity92.3%
Simplified92.3%
if -4.15e21 < z < -7.0000000000000005e-198 or 1.9e-259 < z < 1.4500000000000001e-14Initial program 94.5%
Taylor expanded in z around 0 93.8%
if -7.0000000000000005e-198 < z < 1.9e-259Initial program 83.1%
Taylor expanded in y around inf 96.9%
Final simplification93.5%
(FPCore (x y z t)
:precision binary64
(if (or (<= z -4.15e+21)
(and (not (<= z -7.5e-187)) (or (<= z 8.5e-280) (not (<= z 7e-11)))))
(* t (/ x z))
(* x (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.15e+21) || (!(z <= -7.5e-187) && ((z <= 8.5e-280) || !(z <= 7e-11)))) {
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 <= (-4.15d+21)) .or. (.not. (z <= (-7.5d-187))) .and. (z <= 8.5d-280) .or. (.not. (z <= 7d-11))) 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 <= -4.15e+21) || (!(z <= -7.5e-187) && ((z <= 8.5e-280) || !(z <= 7e-11)))) {
tmp = t * (x / z);
} else {
tmp = x * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.15e+21) or (not (z <= -7.5e-187) and ((z <= 8.5e-280) or not (z <= 7e-11))): tmp = t * (x / z) else: tmp = x * -t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.15e+21) || (!(z <= -7.5e-187) && ((z <= 8.5e-280) || !(z <= 7e-11)))) 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 <= -4.15e+21) || (~((z <= -7.5e-187)) && ((z <= 8.5e-280) || ~((z <= 7e-11))))) tmp = t * (x / z); else tmp = x * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.15e+21], And[N[Not[LessEqual[z, -7.5e-187]], $MachinePrecision], Or[LessEqual[z, 8.5e-280], N[Not[LessEqual[z, 7e-11]], $MachinePrecision]]]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.15 \cdot 10^{+21} \lor \neg \left(z \leq -7.5 \cdot 10^{-187}\right) \land \left(z \leq 8.5 \cdot 10^{-280} \lor \neg \left(z \leq 7 \cdot 10^{-11}\right)\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\end{array}
\end{array}
if z < -4.15e21 or -7.5000000000000004e-187 < z < 8.50000000000000037e-280 or 7.00000000000000038e-11 < z Initial program 92.6%
flip--63.2%
associate-*r/56.5%
associate-/l*63.0%
*-un-lft-identity63.0%
associate-/l*63.1%
flip--92.1%
Applied egg-rr92.1%
Taylor expanded in y around 0 48.3%
associate-*r/48.3%
neg-mul-148.3%
neg-sub048.3%
associate--r-48.3%
metadata-eval48.3%
Simplified48.3%
Taylor expanded in z around inf 48.3%
associate-*r/49.3%
Simplified49.3%
if -4.15e21 < z < -7.5000000000000004e-187 or 8.50000000000000037e-280 < z < 7.00000000000000038e-11Initial program 92.9%
Taylor expanded in y around 0 34.3%
associate-*r/34.3%
associate-*r*34.3%
mul-1-neg34.3%
associate-*l/34.3%
*-commutative34.3%
Simplified34.3%
Taylor expanded in z around 0 33.6%
associate-*r*33.6%
mul-1-neg33.6%
Simplified33.6%
Final simplification42.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))) (t_2 (* x (- t))))
(if (<= z -4.15e+21)
t_1
(if (<= z -1.95e-185)
t_2
(if (<= z 2.4e-279) (* t (/ x z)) (if (<= z 7e-11) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double t_2 = x * -t;
double tmp;
if (z <= -4.15e+21) {
tmp = t_1;
} else if (z <= -1.95e-185) {
tmp = t_2;
} else if (z <= 2.4e-279) {
tmp = t * (x / z);
} else if (z <= 7e-11) {
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 = x * -t
if (z <= (-4.15d+21)) then
tmp = t_1
else if (z <= (-1.95d-185)) then
tmp = t_2
else if (z <= 2.4d-279) then
tmp = t * (x / z)
else if (z <= 7d-11) 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 = x * -t;
double tmp;
if (z <= -4.15e+21) {
tmp = t_1;
} else if (z <= -1.95e-185) {
tmp = t_2;
} else if (z <= 2.4e-279) {
tmp = t * (x / z);
} else if (z <= 7e-11) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) t_2 = x * -t tmp = 0 if z <= -4.15e+21: tmp = t_1 elif z <= -1.95e-185: tmp = t_2 elif z <= 2.4e-279: tmp = t * (x / z) elif z <= 7e-11: 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(x * Float64(-t)) tmp = 0.0 if (z <= -4.15e+21) tmp = t_1; elseif (z <= -1.95e-185) tmp = t_2; elseif (z <= 2.4e-279) tmp = Float64(t * Float64(x / z)); elseif (z <= 7e-11) 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 = x * -t; tmp = 0.0; if (z <= -4.15e+21) tmp = t_1; elseif (z <= -1.95e-185) tmp = t_2; elseif (z <= 2.4e-279) tmp = t * (x / z); elseif (z <= 7e-11) 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[(x * (-t)), $MachinePrecision]}, If[LessEqual[z, -4.15e+21], t$95$1, If[LessEqual[z, -1.95e-185], t$95$2, If[LessEqual[z, 2.4e-279], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e-11], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
t_2 := x \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -4.15 \cdot 10^{+21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-185}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-279}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-11}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.15e21 or 7.00000000000000038e-11 < z Initial program 93.8%
Taylor expanded in y around 0 56.7%
associate-*r/56.7%
associate-*r*56.7%
mul-1-neg56.7%
associate-*l/59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in z around inf 58.2%
if -4.15e21 < z < -1.95e-185 or 2.3999999999999999e-279 < z < 7.00000000000000038e-11Initial program 92.9%
Taylor expanded in y around 0 34.3%
associate-*r/34.3%
associate-*r*34.3%
mul-1-neg34.3%
associate-*l/34.3%
*-commutative34.3%
Simplified34.3%
Taylor expanded in z around 0 33.6%
associate-*r*33.6%
mul-1-neg33.6%
Simplified33.6%
if -1.95e-185 < z < 2.3999999999999999e-279Initial program 88.2%
flip--28.9%
associate-*r/26.0%
associate-/l*28.7%
*-un-lft-identity28.7%
associate-/l*28.8%
flip--87.9%
Applied egg-rr87.9%
Taylor expanded in y around 0 8.7%
associate-*r/8.7%
neg-mul-18.7%
neg-sub08.7%
associate--r-8.7%
metadata-eval8.7%
Simplified8.7%
Taylor expanded in z around inf 21.8%
associate-*r/27.7%
Simplified27.7%
Final simplification44.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -3.8e+154)
t_1
(if (<= t 1.62e+31) (* x (/ y z)) (if (<= t 5.4e+231) t_1 (* x (- t)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -3.8e+154) {
tmp = t_1;
} else if (t <= 1.62e+31) {
tmp = x * (y / z);
} else if (t <= 5.4e+231) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (t / z)
if (t <= (-3.8d+154)) then
tmp = t_1
else if (t <= 1.62d+31) then
tmp = x * (y / z)
else if (t <= 5.4d+231) then
tmp = t_1
else
tmp = x * -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -3.8e+154) {
tmp = t_1;
} else if (t <= 1.62e+31) {
tmp = x * (y / z);
} else if (t <= 5.4e+231) {
tmp = t_1;
} else {
tmp = x * -t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -3.8e+154: tmp = t_1 elif t <= 1.62e+31: tmp = x * (y / z) elif t <= 5.4e+231: tmp = t_1 else: tmp = x * -t return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -3.8e+154) tmp = t_1; elseif (t <= 1.62e+31) tmp = Float64(x * Float64(y / z)); elseif (t <= 5.4e+231) tmp = t_1; else tmp = Float64(x * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (t <= -3.8e+154) tmp = t_1; elseif (t <= 1.62e+31) tmp = x * (y / z); elseif (t <= 5.4e+231) tmp = t_1; else tmp = x * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.8e+154], t$95$1, If[LessEqual[t, 1.62e+31], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.4e+231], t$95$1, N[(x * (-t)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -3.8 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.62 \cdot 10^{+31}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{+231}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\end{array}
\end{array}
if t < -3.7999999999999998e154 or 1.6199999999999999e31 < t < 5.3999999999999999e231Initial program 97.9%
Taylor expanded in y around 0 71.3%
associate-*r/71.3%
associate-*r*71.3%
mul-1-neg71.3%
associate-*l/80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in z around inf 60.1%
if -3.7999999999999998e154 < t < 1.6199999999999999e31Initial program 91.3%
Taylor expanded in y around inf 77.2%
associate-*r/76.4%
Simplified76.4%
if 5.3999999999999999e231 < t Initial program 94.6%
Taylor expanded in y around 0 75.9%
associate-*r/75.9%
associate-*r*75.9%
mul-1-neg75.9%
associate-*l/87.7%
*-commutative87.7%
Simplified87.7%
Taylor expanded in z around 0 69.9%
associate-*r*69.9%
mul-1-neg69.9%
Simplified69.9%
Final simplification72.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -1.16e+159)
t_1
(if (<= t 1.62e+31) (* y (/ x z)) (if (<= t 8.5e+230) t_1 (* x (- t)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -1.16e+159) {
tmp = t_1;
} else if (t <= 1.62e+31) {
tmp = y * (x / z);
} else if (t <= 8.5e+230) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (t / z)
if (t <= (-1.16d+159)) then
tmp = t_1
else if (t <= 1.62d+31) then
tmp = y * (x / z)
else if (t <= 8.5d+230) then
tmp = t_1
else
tmp = x * -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -1.16e+159) {
tmp = t_1;
} else if (t <= 1.62e+31) {
tmp = y * (x / z);
} else if (t <= 8.5e+230) {
tmp = t_1;
} else {
tmp = x * -t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -1.16e+159: tmp = t_1 elif t <= 1.62e+31: tmp = y * (x / z) elif t <= 8.5e+230: tmp = t_1 else: tmp = x * -t return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -1.16e+159) tmp = t_1; elseif (t <= 1.62e+31) tmp = Float64(y * Float64(x / z)); elseif (t <= 8.5e+230) tmp = t_1; else tmp = Float64(x * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (t <= -1.16e+159) tmp = t_1; elseif (t <= 1.62e+31) tmp = y * (x / z); elseif (t <= 8.5e+230) tmp = t_1; else tmp = x * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.16e+159], t$95$1, If[LessEqual[t, 1.62e+31], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e+230], t$95$1, N[(x * (-t)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -1.16 \cdot 10^{+159}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.62 \cdot 10^{+31}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+230}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\end{array}
\end{array}
if t < -1.1600000000000001e159 or 1.6199999999999999e31 < t < 8.499999999999999e230Initial program 97.9%
Taylor expanded in y around 0 71.3%
associate-*r/71.3%
associate-*r*71.3%
mul-1-neg71.3%
associate-*l/80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in z around inf 60.1%
if -1.1600000000000001e159 < t < 1.6199999999999999e31Initial program 91.3%
add-cube-cbrt90.3%
pow390.3%
Applied egg-rr90.3%
Taylor expanded in y around inf 77.2%
associate-/l*76.2%
associate-/r/78.5%
Simplified78.5%
if 8.499999999999999e230 < t Initial program 94.6%
Taylor expanded in y around 0 75.9%
associate-*r/75.9%
associate-*r*75.9%
mul-1-neg75.9%
associate-*l/87.7%
*-commutative87.7%
Simplified87.7%
Taylor expanded in z around 0 69.9%
associate-*r*69.9%
mul-1-neg69.9%
Simplified69.9%
Final simplification74.4%
(FPCore (x y z t)
:precision binary64
(if (<= t -5.1e+157)
(/ x (/ z t))
(if (<= t 4.3e+30)
(* y (/ x z))
(if (<= t 7.2e+230) (* x (/ t z)) (* x (- t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.1e+157) {
tmp = x / (z / t);
} else if (t <= 4.3e+30) {
tmp = y * (x / z);
} else if (t <= 7.2e+230) {
tmp = x * (t / 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 (t <= (-5.1d+157)) then
tmp = x / (z / t)
else if (t <= 4.3d+30) then
tmp = y * (x / z)
else if (t <= 7.2d+230) then
tmp = x * (t / 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 (t <= -5.1e+157) {
tmp = x / (z / t);
} else if (t <= 4.3e+30) {
tmp = y * (x / z);
} else if (t <= 7.2e+230) {
tmp = x * (t / z);
} else {
tmp = x * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.1e+157: tmp = x / (z / t) elif t <= 4.3e+30: tmp = y * (x / z) elif t <= 7.2e+230: tmp = x * (t / z) else: tmp = x * -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.1e+157) tmp = Float64(x / Float64(z / t)); elseif (t <= 4.3e+30) tmp = Float64(y * Float64(x / z)); elseif (t <= 7.2e+230) tmp = Float64(x * Float64(t / z)); else tmp = Float64(x * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5.1e+157) tmp = x / (z / t); elseif (t <= 4.3e+30) tmp = y * (x / z); elseif (t <= 7.2e+230) tmp = x * (t / z); else tmp = x * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.1e+157], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.3e+30], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e+230], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x * (-t)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.1 \cdot 10^{+157}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{+30}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+230}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\end{array}
\end{array}
if t < -5.09999999999999999e157Initial program 99.9%
flip--64.5%
associate-*r/56.4%
associate-/l*64.5%
*-un-lft-identity64.5%
associate-/l*64.5%
flip--99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 92.0%
associate-*r/92.0%
neg-mul-192.0%
neg-sub092.0%
associate--r-92.0%
metadata-eval92.0%
Simplified92.0%
Taylor expanded in z around inf 60.7%
if -5.09999999999999999e157 < t < 4.3e30Initial program 91.3%
add-cube-cbrt90.3%
pow390.3%
Applied egg-rr90.3%
Taylor expanded in y around inf 77.2%
associate-/l*76.2%
associate-/r/78.5%
Simplified78.5%
if 4.3e30 < t < 7.20000000000000037e230Initial program 96.3%
Taylor expanded in y around 0 61.0%
associate-*r/61.0%
associate-*r*61.0%
mul-1-neg61.0%
associate-*l/71.5%
*-commutative71.5%
Simplified71.5%
Taylor expanded in z around inf 59.7%
if 7.20000000000000037e230 < t Initial program 94.6%
Taylor expanded in y around 0 75.9%
associate-*r/75.9%
associate-*r*75.9%
mul-1-neg75.9%
associate-*l/87.7%
*-commutative87.7%
Simplified87.7%
Taylor expanded in z around 0 69.9%
associate-*r*69.9%
mul-1-neg69.9%
Simplified69.9%
Final simplification74.4%
(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 92.7%
Taylor expanded in y around 0 41.3%
associate-*r/41.3%
associate-*r*41.3%
mul-1-neg41.3%
associate-*l/42.5%
*-commutative42.5%
Simplified42.5%
Taylor expanded in z around 0 23.0%
associate-*r*23.0%
mul-1-neg23.0%
Simplified23.0%
Final simplification23.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 2023301
(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)))))