
(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 (+ (/ y z) (/ t (+ z -1.0))))) (if (<= t_1 (- INFINITY)) (/ (* y x) z) (* t_1 x))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) + (t / (z + -1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (y * x) / z;
} else {
tmp = t_1 * x;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y / z) + (t / (z + -1.0));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (y * x) / z;
} else {
tmp = t_1 * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) + (t / (z + -1.0)) tmp = 0 if t_1 <= -math.inf: tmp = (y * x) / z else: tmp = t_1 * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) + Float64(t / Float64(z + -1.0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y * x) / z); else tmp = Float64(t_1 * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) + (t / (z + -1.0)); tmp = 0.0; if (t_1 <= -Inf) tmp = (y * x) / z; else tmp = t_1 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], N[(t$95$1 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} + \frac{t}{z + -1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot x\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < -inf.0Initial program 70.3%
Taylor expanded in y around inf 100.0%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) Initial program 96.8%
Final simplification97.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* y x) z)) (t_2 (* x (/ t z))))
(if (<= y -2.25e-91)
t_1
(if (<= y 7.1e-168)
t_2
(if (<= y 4.2e-104)
(/ x (/ z y))
(if (or (<= y 1.3e-54) (and (not (<= y 2.8e+43)) (<= y 1.3e+73)))
t_2
t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * x) / z;
double t_2 = x * (t / z);
double tmp;
if (y <= -2.25e-91) {
tmp = t_1;
} else if (y <= 7.1e-168) {
tmp = t_2;
} else if (y <= 4.2e-104) {
tmp = x / (z / y);
} else if ((y <= 1.3e-54) || (!(y <= 2.8e+43) && (y <= 1.3e+73))) {
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 = (y * x) / z
t_2 = x * (t / z)
if (y <= (-2.25d-91)) then
tmp = t_1
else if (y <= 7.1d-168) then
tmp = t_2
else if (y <= 4.2d-104) then
tmp = x / (z / y)
else if ((y <= 1.3d-54) .or. (.not. (y <= 2.8d+43)) .and. (y <= 1.3d+73)) 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 = (y * x) / z;
double t_2 = x * (t / z);
double tmp;
if (y <= -2.25e-91) {
tmp = t_1;
} else if (y <= 7.1e-168) {
tmp = t_2;
} else if (y <= 4.2e-104) {
tmp = x / (z / y);
} else if ((y <= 1.3e-54) || (!(y <= 2.8e+43) && (y <= 1.3e+73))) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * x) / z t_2 = x * (t / z) tmp = 0 if y <= -2.25e-91: tmp = t_1 elif y <= 7.1e-168: tmp = t_2 elif y <= 4.2e-104: tmp = x / (z / y) elif (y <= 1.3e-54) or (not (y <= 2.8e+43) and (y <= 1.3e+73)): tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * x) / z) t_2 = Float64(x * Float64(t / z)) tmp = 0.0 if (y <= -2.25e-91) tmp = t_1; elseif (y <= 7.1e-168) tmp = t_2; elseif (y <= 4.2e-104) tmp = Float64(x / Float64(z / y)); elseif ((y <= 1.3e-54) || (!(y <= 2.8e+43) && (y <= 1.3e+73))) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * x) / z; t_2 = x * (t / z); tmp = 0.0; if (y <= -2.25e-91) tmp = t_1; elseif (y <= 7.1e-168) tmp = t_2; elseif (y <= 4.2e-104) tmp = x / (z / y); elseif ((y <= 1.3e-54) || (~((y <= 2.8e+43)) && (y <= 1.3e+73))) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.25e-91], t$95$1, If[LessEqual[y, 7.1e-168], t$95$2, If[LessEqual[y, 4.2e-104], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 1.3e-54], And[N[Not[LessEqual[y, 2.8e+43]], $MachinePrecision], LessEqual[y, 1.3e+73]]], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot x}{z}\\
t_2 := x \cdot \frac{t}{z}\\
\mathbf{if}\;y \leq -2.25 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.1 \cdot 10^{-168}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-104}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-54} \lor \neg \left(y \leq 2.8 \cdot 10^{+43}\right) \land y \leq 1.3 \cdot 10^{+73}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.24999999999999988e-91 or 1.30000000000000001e-54 < y < 2.80000000000000019e43 or 1.3e73 < y Initial program 92.8%
Taylor expanded in y around inf 83.8%
if -2.24999999999999988e-91 < y < 7.10000000000000019e-168 or 4.19999999999999997e-104 < y < 1.30000000000000001e-54 or 2.80000000000000019e43 < y < 1.3e73Initial program 97.9%
Taylor expanded in y around 0 82.2%
mul-1-neg82.2%
*-commutative82.2%
associate-/l*87.0%
distribute-rgt-neg-out87.0%
distribute-neg-frac287.0%
neg-sub087.0%
associate--r-87.0%
metadata-eval87.0%
Simplified87.0%
Taylor expanded in z around inf 56.8%
associate-*l/61.6%
*-commutative61.6%
Simplified61.6%
if 7.10000000000000019e-168 < y < 4.19999999999999997e-104Initial program 99.7%
Taylor expanded in y around inf 58.4%
associate-*r/64.9%
Simplified64.9%
clear-num64.8%
un-div-inv64.9%
Applied egg-rr64.9%
Final simplification74.2%
(FPCore (x y z t)
:precision binary64
(if (or (<= y -1.02e-89)
(not (or (<= y 7.8e-168) (and (not (<= y 4e+43)) (<= y 1.3e+73)))))
(* (/ y z) x)
(* x (/ t z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.02e-89) || !((y <= 7.8e-168) || (!(y <= 4e+43) && (y <= 1.3e+73)))) {
tmp = (y / z) * x;
} else {
tmp = x * (t / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.02d-89)) .or. (.not. (y <= 7.8d-168) .or. (.not. (y <= 4d+43)) .and. (y <= 1.3d+73))) then
tmp = (y / z) * x
else
tmp = x * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.02e-89) || !((y <= 7.8e-168) || (!(y <= 4e+43) && (y <= 1.3e+73)))) {
tmp = (y / z) * x;
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.02e-89) or not ((y <= 7.8e-168) or (not (y <= 4e+43) and (y <= 1.3e+73))): tmp = (y / z) * x else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.02e-89) || !((y <= 7.8e-168) || (!(y <= 4e+43) && (y <= 1.3e+73)))) tmp = Float64(Float64(y / z) * x); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.02e-89) || ~(((y <= 7.8e-168) || (~((y <= 4e+43)) && (y <= 1.3e+73))))) tmp = (y / z) * x; else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.02e-89], N[Not[Or[LessEqual[y, 7.8e-168], And[N[Not[LessEqual[y, 4e+43]], $MachinePrecision], LessEqual[y, 1.3e+73]]]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{-89} \lor \neg \left(y \leq 7.8 \cdot 10^{-168} \lor \neg \left(y \leq 4 \cdot 10^{+43}\right) \land y \leq 1.3 \cdot 10^{+73}\right):\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if y < -1.0199999999999999e-89 or 7.80000000000000025e-168 < y < 4.00000000000000006e43 or 1.3e73 < y Initial program 93.9%
Taylor expanded in y around inf 77.4%
associate-*r/73.1%
Simplified73.1%
if -1.0199999999999999e-89 < y < 7.80000000000000025e-168 or 4.00000000000000006e43 < y < 1.3e73Initial program 97.7%
Taylor expanded in y around 0 85.0%
mul-1-neg85.0%
*-commutative85.0%
associate-/l*88.3%
distribute-rgt-neg-out88.3%
distribute-neg-frac288.3%
neg-sub088.3%
associate--r-88.3%
metadata-eval88.3%
Simplified88.3%
Taylor expanded in z around inf 58.3%
associate-*l/61.5%
*-commutative61.5%
Simplified61.5%
Final simplification69.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -7.2e-88)
(* (/ y z) x)
(if (or (<= y 6.4e-168) (and (not (<= y 4e+43)) (<= y 1.3e+73)))
(* x (/ t z))
(* y (/ x z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.2e-88) {
tmp = (y / z) * x;
} else if ((y <= 6.4e-168) || (!(y <= 4e+43) && (y <= 1.3e+73))) {
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 (y <= (-7.2d-88)) then
tmp = (y / z) * x
else if ((y <= 6.4d-168) .or. (.not. (y <= 4d+43)) .and. (y <= 1.3d+73)) 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 (y <= -7.2e-88) {
tmp = (y / z) * x;
} else if ((y <= 6.4e-168) || (!(y <= 4e+43) && (y <= 1.3e+73))) {
tmp = x * (t / z);
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.2e-88: tmp = (y / z) * x elif (y <= 6.4e-168) or (not (y <= 4e+43) and (y <= 1.3e+73)): tmp = x * (t / z) else: tmp = y * (x / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.2e-88) tmp = Float64(Float64(y / z) * x); elseif ((y <= 6.4e-168) || (!(y <= 4e+43) && (y <= 1.3e+73))) 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 (y <= -7.2e-88) tmp = (y / z) * x; elseif ((y <= 6.4e-168) || (~((y <= 4e+43)) && (y <= 1.3e+73))) tmp = x * (t / z); else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.2e-88], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[Or[LessEqual[y, 6.4e-168], And[N[Not[LessEqual[y, 4e+43]], $MachinePrecision], LessEqual[y, 1.3e+73]]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-88}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{-168} \lor \neg \left(y \leq 4 \cdot 10^{+43}\right) \land y \leq 1.3 \cdot 10^{+73}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -7.1999999999999999e-88Initial program 97.1%
Taylor expanded in y around inf 80.1%
associate-*r/78.6%
Simplified78.6%
if -7.1999999999999999e-88 < y < 6.40000000000000013e-168 or 4.00000000000000006e43 < y < 1.3e73Initial program 97.7%
Taylor expanded in y around 0 85.0%
mul-1-neg85.0%
*-commutative85.0%
associate-/l*88.3%
distribute-rgt-neg-out88.3%
distribute-neg-frac288.3%
neg-sub088.3%
associate--r-88.3%
metadata-eval88.3%
Simplified88.3%
Taylor expanded in z around inf 58.3%
associate-*l/61.5%
*-commutative61.5%
Simplified61.5%
if 6.40000000000000013e-168 < y < 4.00000000000000006e43 or 1.3e73 < y Initial program 90.3%
Taylor expanded in y around inf 74.4%
*-commutative74.4%
associate-/l*72.5%
Simplified72.5%
Final simplification70.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -5.2e-91)
(/ x (/ z y))
(if (or (<= y 5e-168) (and (not (<= y 4e+43)) (<= y 1.3e+73)))
(* x (/ t z))
(* y (/ x z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.2e-91) {
tmp = x / (z / y);
} else if ((y <= 5e-168) || (!(y <= 4e+43) && (y <= 1.3e+73))) {
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 (y <= (-5.2d-91)) then
tmp = x / (z / y)
else if ((y <= 5d-168) .or. (.not. (y <= 4d+43)) .and. (y <= 1.3d+73)) 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 (y <= -5.2e-91) {
tmp = x / (z / y);
} else if ((y <= 5e-168) || (!(y <= 4e+43) && (y <= 1.3e+73))) {
tmp = x * (t / z);
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.2e-91: tmp = x / (z / y) elif (y <= 5e-168) or (not (y <= 4e+43) and (y <= 1.3e+73)): tmp = x * (t / z) else: tmp = y * (x / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.2e-91) tmp = Float64(x / Float64(z / y)); elseif ((y <= 5e-168) || (!(y <= 4e+43) && (y <= 1.3e+73))) 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 (y <= -5.2e-91) tmp = x / (z / y); elseif ((y <= 5e-168) || (~((y <= 4e+43)) && (y <= 1.3e+73))) tmp = x * (t / z); else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.2e-91], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 5e-168], And[N[Not[LessEqual[y, 4e+43]], $MachinePrecision], LessEqual[y, 1.3e+73]]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{-91}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-168} \lor \neg \left(y \leq 4 \cdot 10^{+43}\right) \land y \leq 1.3 \cdot 10^{+73}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if y < -5.20000000000000028e-91Initial program 97.1%
Taylor expanded in y around inf 80.1%
associate-*r/78.6%
Simplified78.6%
clear-num78.1%
un-div-inv78.8%
Applied egg-rr78.8%
if -5.20000000000000028e-91 < y < 5.00000000000000001e-168 or 4.00000000000000006e43 < y < 1.3e73Initial program 97.7%
Taylor expanded in y around 0 85.0%
mul-1-neg85.0%
*-commutative85.0%
associate-/l*88.3%
distribute-rgt-neg-out88.3%
distribute-neg-frac288.3%
neg-sub088.3%
associate--r-88.3%
metadata-eval88.3%
Simplified88.3%
Taylor expanded in z around inf 58.3%
associate-*l/61.5%
*-commutative61.5%
Simplified61.5%
if 5.00000000000000001e-168 < y < 4.00000000000000006e43 or 1.3e73 < y Initial program 90.3%
Taylor expanded in y around inf 74.4%
*-commutative74.4%
associate-/l*72.5%
Simplified72.5%
Final simplification71.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* y x) z)))
(if (<= y -1e-30)
t_1
(if (<= y 2.25e-54)
(* x (/ t (+ z -1.0)))
(if (or (<= y 4e+43) (not (<= y 1.7e+73))) t_1 (* x (/ t z)))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * x) / z;
double tmp;
if (y <= -1e-30) {
tmp = t_1;
} else if (y <= 2.25e-54) {
tmp = x * (t / (z + -1.0));
} else if ((y <= 4e+43) || !(y <= 1.7e+73)) {
tmp = t_1;
} else {
tmp = x * (t / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y * x) / z
if (y <= (-1d-30)) then
tmp = t_1
else if (y <= 2.25d-54) then
tmp = x * (t / (z + (-1.0d0)))
else if ((y <= 4d+43) .or. (.not. (y <= 1.7d+73))) then
tmp = t_1
else
tmp = x * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y * x) / z;
double tmp;
if (y <= -1e-30) {
tmp = t_1;
} else if (y <= 2.25e-54) {
tmp = x * (t / (z + -1.0));
} else if ((y <= 4e+43) || !(y <= 1.7e+73)) {
tmp = t_1;
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * x) / z tmp = 0 if y <= -1e-30: tmp = t_1 elif y <= 2.25e-54: tmp = x * (t / (z + -1.0)) elif (y <= 4e+43) or not (y <= 1.7e+73): tmp = t_1 else: tmp = x * (t / z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * x) / z) tmp = 0.0 if (y <= -1e-30) tmp = t_1; elseif (y <= 2.25e-54) tmp = Float64(x * Float64(t / Float64(z + -1.0))); elseif ((y <= 4e+43) || !(y <= 1.7e+73)) tmp = t_1; else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * x) / z; tmp = 0.0; if (y <= -1e-30) tmp = t_1; elseif (y <= 2.25e-54) tmp = x * (t / (z + -1.0)); elseif ((y <= 4e+43) || ~((y <= 1.7e+73))) tmp = t_1; else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -1e-30], t$95$1, If[LessEqual[y, 2.25e-54], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 4e+43], N[Not[LessEqual[y, 1.7e+73]], $MachinePrecision]], t$95$1, N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot x}{z}\\
\mathbf{if}\;y \leq -1 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{-54}:\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+43} \lor \neg \left(y \leq 1.7 \cdot 10^{+73}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if y < -1e-30 or 2.2499999999999999e-54 < y < 4.00000000000000006e43 or 1.7000000000000001e73 < y Initial program 92.0%
Taylor expanded in y around inf 88.0%
if -1e-30 < y < 2.2499999999999999e-54Initial program 98.2%
Taylor expanded in y around 0 73.2%
mul-1-neg73.2%
*-commutative73.2%
associate-/l*77.9%
distribute-rgt-neg-out77.9%
distribute-neg-frac277.9%
neg-sub077.9%
associate--r-77.9%
metadata-eval77.9%
Simplified77.9%
if 4.00000000000000006e43 < y < 1.7000000000000001e73Initial program 100.0%
Taylor expanded in y around 0 100.0%
mul-1-neg100.0%
*-commutative100.0%
associate-/l*100.0%
distribute-rgt-neg-out100.0%
distribute-neg-frac2100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Final simplification83.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -26000.0) (not (<= z 1.0))) (* x (/ (+ y t) z)) (* x (- (/ y z) (+ t (* z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -26000.0) || !(z <= 1.0)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - (t + (z * t)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-26000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * ((y + t) / z)
else
tmp = x * ((y / z) - (t + (z * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -26000.0) || !(z <= 1.0)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - (t + (z * t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -26000.0) or not (z <= 1.0): tmp = x * ((y + t) / z) else: tmp = x * ((y / z) - (t + (z * t))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -26000.0) || !(z <= 1.0)) tmp = Float64(x * Float64(Float64(y + t) / z)); else tmp = Float64(x * Float64(Float64(y / z) - Float64(t + Float64(z * t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -26000.0) || ~((z <= 1.0))) tmp = x * ((y + t) / z); else tmp = x * ((y / z) - (t + (z * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -26000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - N[(t + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -26000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - \left(t + z \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -26000 or 1 < z Initial program 97.1%
Taylor expanded in z around inf 93.1%
*-commutative93.1%
remove-double-neg93.1%
cancel-sign-sub-inv93.1%
metadata-eval93.1%
*-lft-identity93.1%
distribute-neg-out93.1%
neg-mul-193.1%
sub-neg93.1%
mul-1-neg93.1%
associate-*r*93.1%
*-commutative93.1%
associate-*r/93.1%
*-commutative93.1%
associate-/l*97.1%
associate-*l*97.1%
*-commutative97.1%
associate-*r/97.1%
Simplified97.1%
if -26000 < z < 1Initial program 93.2%
Taylor expanded in z around 0 92.2%
Final simplification94.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.4e+161) (not (<= z 6.5e+18))) (* x (/ t z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.4e+161) || !(z <= 6.5e+18)) {
tmp = x * (t / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.4d+161)) .or. (.not. (z <= 6.5d+18))) then
tmp = x * (t / z)
else
tmp = x * ((y / z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.4e+161) || !(z <= 6.5e+18)) {
tmp = x * (t / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.4e+161) or not (z <= 6.5e+18): tmp = x * (t / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.4e+161) || !(z <= 6.5e+18)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(x * Float64(Float64(y / z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.4e+161) || ~((z <= 6.5e+18))) tmp = x * (t / z); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.4e+161], N[Not[LessEqual[z, 6.5e+18]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+161} \lor \neg \left(z \leq 6.5 \cdot 10^{+18}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -2.3999999999999999e161 or 6.5e18 < z Initial program 96.5%
Taylor expanded in y around 0 61.9%
mul-1-neg61.9%
*-commutative61.9%
associate-/l*65.7%
distribute-rgt-neg-out65.7%
distribute-neg-frac265.7%
neg-sub065.7%
associate--r-65.7%
metadata-eval65.7%
Simplified65.7%
Taylor expanded in z around inf 61.9%
associate-*l/65.7%
*-commutative65.7%
Simplified65.7%
if -2.3999999999999999e161 < z < 6.5e18Initial program 94.3%
Taylor expanded in z around 0 80.1%
+-commutative80.1%
associate-*r/78.0%
*-commutative78.0%
associate-*r*78.0%
neg-mul-178.0%
distribute-rgt-out85.9%
unsub-neg85.9%
Simplified85.9%
Final simplification77.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -26000.0) (not (<= z 1.0))) (* x (/ (+ y t) z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -26000.0) || !(z <= 1.0)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-26000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * ((y + t) / z)
else
tmp = x * ((y / z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -26000.0) || !(z <= 1.0)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -26000.0) or not (z <= 1.0): tmp = x * ((y + t) / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -26000.0) || !(z <= 1.0)) tmp = Float64(x * Float64(Float64(y + t) / z)); else tmp = Float64(x * Float64(Float64(y / z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -26000.0) || ~((z <= 1.0))) tmp = x * ((y + t) / z); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -26000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -26000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -26000 or 1 < z Initial program 97.1%
Taylor expanded in z around inf 93.1%
*-commutative93.1%
remove-double-neg93.1%
cancel-sign-sub-inv93.1%
metadata-eval93.1%
*-lft-identity93.1%
distribute-neg-out93.1%
neg-mul-193.1%
sub-neg93.1%
mul-1-neg93.1%
associate-*r*93.1%
*-commutative93.1%
associate-*r/93.1%
*-commutative93.1%
associate-/l*97.1%
associate-*l*97.1%
*-commutative97.1%
associate-*r/97.1%
Simplified97.1%
if -26000 < z < 1Initial program 93.2%
Taylor expanded in z around 0 84.9%
+-commutative84.9%
associate-*r/82.5%
*-commutative82.5%
associate-*r*82.5%
neg-mul-182.5%
distribute-rgt-out91.9%
unsub-neg91.9%
Simplified91.9%
Final simplification94.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -26000.0) (not (<= z 1.0))) (* t (/ x z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -26000.0) || !(z <= 1.0)) {
tmp = t * (x / z);
} else {
tmp = t * -x;
}
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 <= (-26000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = t * (x / z)
else
tmp = t * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -26000.0) || !(z <= 1.0)) {
tmp = t * (x / z);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -26000.0) or not (z <= 1.0): tmp = t * (x / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -26000.0) || !(z <= 1.0)) tmp = Float64(t * Float64(x / z)); else tmp = Float64(t * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -26000.0) || ~((z <= 1.0))) tmp = t * (x / z); else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -26000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -26000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -26000 or 1 < z Initial program 97.1%
Taylor expanded in z around inf 93.1%
*-commutative93.1%
associate-/l*83.3%
cancel-sign-sub-inv83.3%
metadata-eval83.3%
*-lft-identity83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in t around inf 58.2%
associate-*r/54.5%
Simplified54.5%
if -26000 < z < 1Initial program 93.2%
Taylor expanded in z around 0 84.9%
+-commutative84.9%
associate-*r/82.5%
*-commutative82.5%
associate-*r*82.5%
neg-mul-182.5%
distribute-rgt-out91.9%
unsub-neg91.9%
Simplified91.9%
Taylor expanded in y around 0 36.3%
mul-1-neg36.3%
*-commutative36.3%
distribute-rgt-neg-in36.3%
Simplified36.3%
Final simplification45.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -26000.0) (not (<= z 1.0))) (* x (/ t z)) (* t (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -26000.0) || !(z <= 1.0)) {
tmp = x * (t / z);
} else {
tmp = t * -x;
}
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 <= (-26000.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = x * (t / z)
else
tmp = t * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -26000.0) || !(z <= 1.0)) {
tmp = x * (t / z);
} else {
tmp = t * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -26000.0) or not (z <= 1.0): tmp = x * (t / z) else: tmp = t * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -26000.0) || !(z <= 1.0)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(t * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -26000.0) || ~((z <= 1.0))) tmp = x * (t / z); else tmp = t * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -26000.0], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(t * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -26000 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-x\right)\\
\end{array}
\end{array}
if z < -26000 or 1 < z Initial program 97.1%
Taylor expanded in y around 0 58.2%
mul-1-neg58.2%
*-commutative58.2%
associate-/l*61.2%
distribute-rgt-neg-out61.2%
distribute-neg-frac261.2%
neg-sub061.2%
associate--r-61.2%
metadata-eval61.2%
Simplified61.2%
Taylor expanded in z around inf 58.2%
associate-*l/61.2%
*-commutative61.2%
Simplified61.2%
if -26000 < z < 1Initial program 93.2%
Taylor expanded in z around 0 84.9%
+-commutative84.9%
associate-*r/82.5%
*-commutative82.5%
associate-*r*82.5%
neg-mul-182.5%
distribute-rgt-out91.9%
unsub-neg91.9%
Simplified91.9%
Taylor expanded in y around 0 36.3%
mul-1-neg36.3%
*-commutative36.3%
distribute-rgt-neg-in36.3%
Simplified36.3%
Final simplification48.7%
(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 95.2%
Taylor expanded in z around 0 60.1%
+-commutative60.1%
associate-*r/59.2%
*-commutative59.2%
associate-*r*59.2%
neg-mul-159.2%
distribute-rgt-out64.3%
unsub-neg64.3%
Simplified64.3%
Taylor expanded in y around 0 26.4%
mul-1-neg26.4%
*-commutative26.4%
distribute-rgt-neg-in26.4%
Simplified26.4%
Final simplification26.4%
(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 2024039
(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)))))