
(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 (* 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}
Initial program 95.3%
Final simplification95.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ z t))))
(if (<= t -1.5e+153)
t_1
(if (<= t -1.7e+136)
(/ (* x y) z)
(if (<= t -1.7e+44)
t_1
(if (<= t 2.6e+118)
(/ x (/ z y))
(if (or (<= t 3.4e+146) (not (<= t 3.3e+253)))
(* x (/ t z))
(- (* x t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z / t);
double tmp;
if (t <= -1.5e+153) {
tmp = t_1;
} else if (t <= -1.7e+136) {
tmp = (x * y) / z;
} else if (t <= -1.7e+44) {
tmp = t_1;
} else if (t <= 2.6e+118) {
tmp = x / (z / y);
} else if ((t <= 3.4e+146) || !(t <= 3.3e+253)) {
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) :: t_1
real(8) :: tmp
t_1 = x / (z / t)
if (t <= (-1.5d+153)) then
tmp = t_1
else if (t <= (-1.7d+136)) then
tmp = (x * y) / z
else if (t <= (-1.7d+44)) then
tmp = t_1
else if (t <= 2.6d+118) then
tmp = x / (z / y)
else if ((t <= 3.4d+146) .or. (.not. (t <= 3.3d+253))) 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 t_1 = x / (z / t);
double tmp;
if (t <= -1.5e+153) {
tmp = t_1;
} else if (t <= -1.7e+136) {
tmp = (x * y) / z;
} else if (t <= -1.7e+44) {
tmp = t_1;
} else if (t <= 2.6e+118) {
tmp = x / (z / y);
} else if ((t <= 3.4e+146) || !(t <= 3.3e+253)) {
tmp = x * (t / z);
} else {
tmp = -(x * t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z / t) tmp = 0 if t <= -1.5e+153: tmp = t_1 elif t <= -1.7e+136: tmp = (x * y) / z elif t <= -1.7e+44: tmp = t_1 elif t <= 2.6e+118: tmp = x / (z / y) elif (t <= 3.4e+146) or not (t <= 3.3e+253): tmp = x * (t / z) else: tmp = -(x * t) return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z / t)) tmp = 0.0 if (t <= -1.5e+153) tmp = t_1; elseif (t <= -1.7e+136) tmp = Float64(Float64(x * y) / z); elseif (t <= -1.7e+44) tmp = t_1; elseif (t <= 2.6e+118) tmp = Float64(x / Float64(z / y)); elseif ((t <= 3.4e+146) || !(t <= 3.3e+253)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(-Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z / t); tmp = 0.0; if (t <= -1.5e+153) tmp = t_1; elseif (t <= -1.7e+136) tmp = (x * y) / z; elseif (t <= -1.7e+44) tmp = t_1; elseif (t <= 2.6e+118) tmp = x / (z / y); elseif ((t <= 3.4e+146) || ~((t <= 3.3e+253))) tmp = x * (t / z); else tmp = -(x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.5e+153], t$95$1, If[LessEqual[t, -1.7e+136], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, -1.7e+44], t$95$1, If[LessEqual[t, 2.6e+118], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 3.4e+146], N[Not[LessEqual[t, 3.3e+253]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], (-N[(x * t), $MachinePrecision])]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{z}{t}}\\
\mathbf{if}\;t \leq -1.5 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{+136}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{+44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+118}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+146} \lor \neg \left(t \leq 3.3 \cdot 10^{+253}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;-x \cdot t\\
\end{array}
\end{array}
if t < -1.50000000000000009e153 or -1.69999999999999998e136 < t < -1.7e44Initial program 99.7%
Taylor expanded in z around inf 76.4%
cancel-sign-sub-inv76.4%
metadata-eval76.4%
*-lft-identity76.4%
+-commutative76.4%
Simplified76.4%
clear-num76.3%
un-div-inv76.5%
+-commutative76.5%
Applied egg-rr76.5%
Taylor expanded in y around 0 62.0%
if -1.50000000000000009e153 < t < -1.69999999999999998e136Initial program 100.0%
Taylor expanded in y around inf 75.7%
if -1.7e44 < t < 2.60000000000000016e118Initial program 93.4%
Taylor expanded in y around inf 79.6%
associate-/l*80.8%
Simplified80.8%
if 2.60000000000000016e118 < t < 3.39999999999999991e146 or 3.2999999999999999e253 < t Initial program 99.6%
Taylor expanded in z around inf 90.2%
cancel-sign-sub-inv90.2%
metadata-eval90.2%
*-lft-identity90.2%
+-commutative90.2%
Simplified90.2%
Taylor expanded in t around inf 83.2%
if 3.39999999999999991e146 < t < 3.2999999999999999e253Initial program 94.0%
Taylor expanded in y around 0 83.3%
associate-*r/83.3%
associate-*r*83.3%
neg-mul-183.3%
Simplified83.3%
Taylor expanded in z around 0 72.0%
associate-*r*72.0%
mul-1-neg72.0%
Simplified72.0%
Final simplification76.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ z t))))
(if (<= t -7.8e+153)
t_1
(if (<= t -2.4e+138)
(/ (* x y) z)
(if (<= t -1.05e+38)
t_1
(if (<= t 1.7e+119)
(/ x (/ z y))
(if (<= t 3.2e+146)
(* x (* t (/ 1.0 z)))
(if (<= t 9.5e+253) (- (* x t)) (* x (/ t z))))))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z / t);
double tmp;
if (t <= -7.8e+153) {
tmp = t_1;
} else if (t <= -2.4e+138) {
tmp = (x * y) / z;
} else if (t <= -1.05e+38) {
tmp = t_1;
} else if (t <= 1.7e+119) {
tmp = x / (z / y);
} else if (t <= 3.2e+146) {
tmp = x * (t * (1.0 / z));
} else if (t <= 9.5e+253) {
tmp = -(x * t);
} else {
tmp = x * (t / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (z / t)
if (t <= (-7.8d+153)) then
tmp = t_1
else if (t <= (-2.4d+138)) then
tmp = (x * y) / z
else if (t <= (-1.05d+38)) then
tmp = t_1
else if (t <= 1.7d+119) then
tmp = x / (z / y)
else if (t <= 3.2d+146) then
tmp = x * (t * (1.0d0 / z))
else if (t <= 9.5d+253) then
tmp = -(x * t)
else
tmp = x * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z / t);
double tmp;
if (t <= -7.8e+153) {
tmp = t_1;
} else if (t <= -2.4e+138) {
tmp = (x * y) / z;
} else if (t <= -1.05e+38) {
tmp = t_1;
} else if (t <= 1.7e+119) {
tmp = x / (z / y);
} else if (t <= 3.2e+146) {
tmp = x * (t * (1.0 / z));
} else if (t <= 9.5e+253) {
tmp = -(x * t);
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z / t) tmp = 0 if t <= -7.8e+153: tmp = t_1 elif t <= -2.4e+138: tmp = (x * y) / z elif t <= -1.05e+38: tmp = t_1 elif t <= 1.7e+119: tmp = x / (z / y) elif t <= 3.2e+146: tmp = x * (t * (1.0 / z)) elif t <= 9.5e+253: tmp = -(x * t) else: tmp = x * (t / z) return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z / t)) tmp = 0.0 if (t <= -7.8e+153) tmp = t_1; elseif (t <= -2.4e+138) tmp = Float64(Float64(x * y) / z); elseif (t <= -1.05e+38) tmp = t_1; elseif (t <= 1.7e+119) tmp = Float64(x / Float64(z / y)); elseif (t <= 3.2e+146) tmp = Float64(x * Float64(t * Float64(1.0 / z))); elseif (t <= 9.5e+253) tmp = Float64(-Float64(x * t)); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z / t); tmp = 0.0; if (t <= -7.8e+153) tmp = t_1; elseif (t <= -2.4e+138) tmp = (x * y) / z; elseif (t <= -1.05e+38) tmp = t_1; elseif (t <= 1.7e+119) tmp = x / (z / y); elseif (t <= 3.2e+146) tmp = x * (t * (1.0 / z)); elseif (t <= 9.5e+253) tmp = -(x * t); else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.8e+153], t$95$1, If[LessEqual[t, -2.4e+138], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, -1.05e+38], t$95$1, If[LessEqual[t, 1.7e+119], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e+146], N[(x * N[(t * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e+253], (-N[(x * t), $MachinePrecision]), N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{z}{t}}\\
\mathbf{if}\;t \leq -7.8 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.4 \cdot 10^{+138}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;t \leq -1.05 \cdot 10^{+38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+119}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+146}:\\
\;\;\;\;x \cdot \left(t \cdot \frac{1}{z}\right)\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+253}:\\
\;\;\;\;-x \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if t < -7.79999999999999966e153 or -2.4000000000000001e138 < t < -1.05e38Initial program 99.7%
Taylor expanded in z around inf 76.4%
cancel-sign-sub-inv76.4%
metadata-eval76.4%
*-lft-identity76.4%
+-commutative76.4%
Simplified76.4%
clear-num76.3%
un-div-inv76.5%
+-commutative76.5%
Applied egg-rr76.5%
Taylor expanded in y around 0 62.0%
if -7.79999999999999966e153 < t < -2.4000000000000001e138Initial program 100.0%
Taylor expanded in y around inf 75.7%
if -1.05e38 < t < 1.70000000000000007e119Initial program 93.4%
Taylor expanded in y around inf 79.6%
associate-/l*80.8%
Simplified80.8%
if 1.70000000000000007e119 < t < 3.2e146Initial program 99.5%
Taylor expanded in z around inf 99.5%
cancel-sign-sub-inv99.5%
metadata-eval99.5%
*-lft-identity99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in t around inf 67.8%
associate-/l*85.0%
Simplified85.0%
associate-/l*67.8%
*-commutative67.8%
associate-*l/84.7%
div-inv84.7%
associate-*l*99.7%
Applied egg-rr99.7%
if 3.2e146 < t < 9.50000000000000005e253Initial program 94.0%
Taylor expanded in y around 0 83.3%
associate-*r/83.3%
associate-*r*83.3%
neg-mul-183.3%
Simplified83.3%
Taylor expanded in z around 0 72.0%
associate-*r*72.0%
mul-1-neg72.0%
Simplified72.0%
if 9.50000000000000005e253 < t Initial program 99.7%
Taylor expanded in z around inf 86.2%
cancel-sign-sub-inv86.2%
metadata-eval86.2%
*-lft-identity86.2%
+-commutative86.2%
Simplified86.2%
Taylor expanded in t around inf 76.2%
Final simplification76.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -1.5e+153)
t_1
(if (<= t 2.2e+118)
(* x (/ y z))
(if (or (<= t 3.4e+146) (not (<= t 2.6e+253))) 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.5e+153) {
tmp = t_1;
} else if (t <= 2.2e+118) {
tmp = x * (y / z);
} else if ((t <= 3.4e+146) || !(t <= 2.6e+253)) {
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.5d+153)) then
tmp = t_1
else if (t <= 2.2d+118) then
tmp = x * (y / z)
else if ((t <= 3.4d+146) .or. (.not. (t <= 2.6d+253))) 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.5e+153) {
tmp = t_1;
} else if (t <= 2.2e+118) {
tmp = x * (y / z);
} else if ((t <= 3.4e+146) || !(t <= 2.6e+253)) {
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.5e+153: tmp = t_1 elif t <= 2.2e+118: tmp = x * (y / z) elif (t <= 3.4e+146) or not (t <= 2.6e+253): 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.5e+153) tmp = t_1; elseif (t <= 2.2e+118) tmp = Float64(x * Float64(y / z)); elseif ((t <= 3.4e+146) || !(t <= 2.6e+253)) tmp = t_1; else tmp = Float64(-Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (t <= -1.5e+153) tmp = t_1; elseif (t <= 2.2e+118) tmp = x * (y / z); elseif ((t <= 3.4e+146) || ~((t <= 2.6e+253))) 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.5e+153], t$95$1, If[LessEqual[t, 2.2e+118], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 3.4e+146], N[Not[LessEqual[t, 2.6e+253]], $MachinePrecision]], 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.5 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+118}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+146} \lor \neg \left(t \leq 2.6 \cdot 10^{+253}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-x \cdot t\\
\end{array}
\end{array}
if t < -1.50000000000000009e153 or 2.19999999999999986e118 < t < 3.39999999999999991e146 or 2.6e253 < t Initial program 99.7%
Taylor expanded in z around inf 82.7%
cancel-sign-sub-inv82.7%
metadata-eval82.7%
*-lft-identity82.7%
+-commutative82.7%
Simplified82.7%
Taylor expanded in t around inf 75.7%
if -1.50000000000000009e153 < t < 2.19999999999999986e118Initial program 94.4%
Taylor expanded in y around inf 74.5%
associate-*r/74.4%
Simplified74.4%
if 3.39999999999999991e146 < t < 2.6e253Initial program 94.0%
Taylor expanded in y around 0 83.3%
associate-*r/83.3%
associate-*r*83.3%
neg-mul-183.3%
Simplified83.3%
Taylor expanded in z around 0 72.0%
associate-*r*72.0%
mul-1-neg72.0%
Simplified72.0%
Final simplification74.5%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.5e+152)
(/ x (/ z t))
(if (<= t 3.2e+118)
(* x (/ y z))
(if (or (<= t 1.15e+146) (not (<= t 2.35e+253)))
(* x (/ t z))
(- (* x t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.5e+152) {
tmp = x / (z / t);
} else if (t <= 3.2e+118) {
tmp = x * (y / z);
} else if ((t <= 1.15e+146) || !(t <= 2.35e+253)) {
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 <= (-1.5d+152)) then
tmp = x / (z / t)
else if (t <= 3.2d+118) then
tmp = x * (y / z)
else if ((t <= 1.15d+146) .or. (.not. (t <= 2.35d+253))) 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 <= -1.5e+152) {
tmp = x / (z / t);
} else if (t <= 3.2e+118) {
tmp = x * (y / z);
} else if ((t <= 1.15e+146) || !(t <= 2.35e+253)) {
tmp = x * (t / z);
} else {
tmp = -(x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.5e+152: tmp = x / (z / t) elif t <= 3.2e+118: tmp = x * (y / z) elif (t <= 1.15e+146) or not (t <= 2.35e+253): tmp = x * (t / z) else: tmp = -(x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.5e+152) tmp = Float64(x / Float64(z / t)); elseif (t <= 3.2e+118) tmp = Float64(x * Float64(y / z)); elseif ((t <= 1.15e+146) || !(t <= 2.35e+253)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(-Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.5e+152) tmp = x / (z / t); elseif (t <= 3.2e+118) tmp = x * (y / z); elseif ((t <= 1.15e+146) || ~((t <= 2.35e+253))) tmp = x * (t / z); else tmp = -(x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.5e+152], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e+118], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 1.15e+146], N[Not[LessEqual[t, 2.35e+253]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], (-N[(x * t), $MachinePrecision])]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+152}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+118}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+146} \lor \neg \left(t \leq 2.35 \cdot 10^{+253}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;-x \cdot t\\
\end{array}
\end{array}
if t < -1.49999999999999995e152Initial program 99.8%
Taylor expanded in z around inf 76.9%
cancel-sign-sub-inv76.9%
metadata-eval76.9%
*-lft-identity76.9%
+-commutative76.9%
Simplified76.9%
clear-num76.9%
un-div-inv77.0%
+-commutative77.0%
Applied egg-rr77.0%
Taylor expanded in y around 0 70.0%
if -1.49999999999999995e152 < t < 3.20000000000000016e118Initial program 94.4%
Taylor expanded in y around inf 74.5%
associate-*r/74.4%
Simplified74.4%
if 3.20000000000000016e118 < t < 1.15e146 or 2.35000000000000011e253 < t Initial program 99.6%
Taylor expanded in z around inf 90.2%
cancel-sign-sub-inv90.2%
metadata-eval90.2%
*-lft-identity90.2%
+-commutative90.2%
Simplified90.2%
Taylor expanded in t around inf 83.2%
if 1.15e146 < t < 2.35000000000000011e253Initial program 94.0%
Taylor expanded in y around 0 83.3%
associate-*r/83.3%
associate-*r*83.3%
neg-mul-183.3%
Simplified83.3%
Taylor expanded in z around 0 72.0%
associate-*r*72.0%
mul-1-neg72.0%
Simplified72.0%
Final simplification74.5%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.45e+152)
(/ x (/ z t))
(if (<= t 6.8e+118)
(/ x (/ z y))
(if (or (<= t 3.4e+146) (not (<= t 3e+253))) (* x (/ t z)) (- (* x t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.45e+152) {
tmp = x / (z / t);
} else if (t <= 6.8e+118) {
tmp = x / (z / y);
} else if ((t <= 3.4e+146) || !(t <= 3e+253)) {
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 <= (-1.45d+152)) then
tmp = x / (z / t)
else if (t <= 6.8d+118) then
tmp = x / (z / y)
else if ((t <= 3.4d+146) .or. (.not. (t <= 3d+253))) 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 <= -1.45e+152) {
tmp = x / (z / t);
} else if (t <= 6.8e+118) {
tmp = x / (z / y);
} else if ((t <= 3.4e+146) || !(t <= 3e+253)) {
tmp = x * (t / z);
} else {
tmp = -(x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.45e+152: tmp = x / (z / t) elif t <= 6.8e+118: tmp = x / (z / y) elif (t <= 3.4e+146) or not (t <= 3e+253): tmp = x * (t / z) else: tmp = -(x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.45e+152) tmp = Float64(x / Float64(z / t)); elseif (t <= 6.8e+118) tmp = Float64(x / Float64(z / y)); elseif ((t <= 3.4e+146) || !(t <= 3e+253)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(-Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.45e+152) tmp = x / (z / t); elseif (t <= 6.8e+118) tmp = x / (z / y); elseif ((t <= 3.4e+146) || ~((t <= 3e+253))) tmp = x * (t / z); else tmp = -(x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.45e+152], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.8e+118], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 3.4e+146], N[Not[LessEqual[t, 3e+253]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], (-N[(x * t), $MachinePrecision])]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{+152}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{+118}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+146} \lor \neg \left(t \leq 3 \cdot 10^{+253}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;-x \cdot t\\
\end{array}
\end{array}
if t < -1.4499999999999999e152Initial program 99.8%
Taylor expanded in z around inf 76.9%
cancel-sign-sub-inv76.9%
metadata-eval76.9%
*-lft-identity76.9%
+-commutative76.9%
Simplified76.9%
clear-num76.9%
un-div-inv77.0%
+-commutative77.0%
Applied egg-rr77.0%
Taylor expanded in y around 0 70.0%
if -1.4499999999999999e152 < t < 6.79999999999999973e118Initial program 94.4%
Taylor expanded in y around inf 74.5%
associate-/l*75.1%
Simplified75.1%
if 6.79999999999999973e118 < t < 3.39999999999999991e146 or 2.9999999999999998e253 < t Initial program 99.6%
Taylor expanded in z around inf 90.2%
cancel-sign-sub-inv90.2%
metadata-eval90.2%
*-lft-identity90.2%
+-commutative90.2%
Simplified90.2%
Taylor expanded in t around inf 83.2%
if 3.39999999999999991e146 < t < 2.9999999999999998e253Initial program 94.0%
Taylor expanded in y around 0 83.3%
associate-*r/83.3%
associate-*r*83.3%
neg-mul-183.3%
Simplified83.3%
Taylor expanded in z around 0 72.0%
associate-*r*72.0%
mul-1-neg72.0%
Simplified72.0%
Final simplification75.0%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.1e+242)
(/ x (/ z y))
(if (or (<= z -1.58e+91) (not (<= z 2.35e+29)))
(/ x (/ z t))
(* x (- (/ y z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.1e+242) {
tmp = x / (z / y);
} else if ((z <= -1.58e+91) || !(z <= 2.35e+29)) {
tmp = x / (z / t);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.1d+242)) then
tmp = x / (z / y)
else if ((z <= (-1.58d+91)) .or. (.not. (z <= 2.35d+29))) then
tmp = x / (z / t)
else
tmp = x * ((y / z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.1e+242) {
tmp = x / (z / y);
} else if ((z <= -1.58e+91) || !(z <= 2.35e+29)) {
tmp = x / (z / t);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.1e+242: tmp = x / (z / y) elif (z <= -1.58e+91) or not (z <= 2.35e+29): tmp = x / (z / t) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.1e+242) tmp = Float64(x / Float64(z / y)); elseif ((z <= -1.58e+91) || !(z <= 2.35e+29)) tmp = Float64(x / Float64(z / t)); else tmp = Float64(x * Float64(Float64(y / z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.1e+242) tmp = x / (z / y); elseif ((z <= -1.58e+91) || ~((z <= 2.35e+29))) tmp = x / (z / t); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.1e+242], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.58e+91], N[Not[LessEqual[z, 2.35e+29]], $MachinePrecision]], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+242}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;z \leq -1.58 \cdot 10^{+91} \lor \neg \left(z \leq 2.35 \cdot 10^{+29}\right):\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -1.1e242Initial program 88.5%
Taylor expanded in y around inf 68.8%
associate-/l*68.8%
Simplified68.8%
if -1.1e242 < z < -1.5799999999999999e91 or 2.3500000000000001e29 < z Initial program 95.4%
Taylor expanded in z around inf 95.4%
cancel-sign-sub-inv95.4%
metadata-eval95.4%
*-lft-identity95.4%
+-commutative95.4%
Simplified95.4%
clear-num95.4%
un-div-inv95.6%
+-commutative95.6%
Applied egg-rr95.6%
Taylor expanded in y around 0 64.8%
if -1.5799999999999999e91 < z < 2.3500000000000001e29Initial program 96.0%
Taylor expanded in z around 0 87.3%
+-commutative87.3%
associate-*r/86.0%
*-commutative86.0%
associate-*r*86.0%
neg-mul-186.0%
distribute-rgt-out88.7%
unsub-neg88.7%
Simplified88.7%
Final simplification79.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.25e+44) (not (<= t 7.5e+108))) (* x (/ t (+ z -1.0))) (/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.25e+44) || !(t <= 7.5e+108)) {
tmp = x * (t / (z + -1.0));
} else {
tmp = x / (z / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-1.25d+44)) .or. (.not. (t <= 7.5d+108))) then
tmp = x * (t / (z + (-1.0d0)))
else
tmp = x / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.25e+44) || !(t <= 7.5e+108)) {
tmp = x * (t / (z + -1.0));
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.25e+44) or not (t <= 7.5e+108): tmp = x * (t / (z + -1.0)) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.25e+44) || !(t <= 7.5e+108)) tmp = Float64(x * Float64(t / Float64(z + -1.0))); else tmp = Float64(x / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.25e+44) || ~((t <= 7.5e+108))) tmp = x * (t / (z + -1.0)); else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.25e+44], N[Not[LessEqual[t, 7.5e+108]], $MachinePrecision]], N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+44} \lor \neg \left(t \leq 7.5 \cdot 10^{+108}\right):\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -1.2499999999999999e44 or 7.50000000000000039e108 < t Initial program 98.8%
Taylor expanded in y around 0 69.6%
associate-*r/69.6%
mul-1-neg69.6%
*-commutative69.6%
distribute-rgt-neg-in69.6%
associate-*r/78.8%
neg-mul-178.8%
*-commutative78.8%
associate-*r/78.7%
metadata-eval78.7%
associate-/r*78.7%
neg-mul-178.7%
associate-*r/78.8%
*-rgt-identity78.8%
neg-sub078.8%
associate--r-78.8%
metadata-eval78.8%
Simplified78.8%
if -1.2499999999999999e44 < t < 7.50000000000000039e108Initial program 93.4%
Taylor expanded in y around inf 80.1%
associate-/l*81.3%
Simplified81.3%
Final simplification80.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 0.0038))) (* x (/ (+ y t) z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 0.0038)) {
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 <= (-1.0d0)) .or. (.not. (z <= 0.0038d0))) 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 <= -1.0) || !(z <= 0.0038)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 0.0038): tmp = x * ((y + t) / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 0.0038)) 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 <= -1.0) || ~((z <= 0.0038))) 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, -1.0], N[Not[LessEqual[z, 0.0038]], $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 -1 \lor \neg \left(z \leq 0.0038\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -1 or 0.00379999999999999999 < z Initial program 95.6%
Taylor expanded in z around inf 94.5%
cancel-sign-sub-inv94.5%
metadata-eval94.5%
*-lft-identity94.5%
+-commutative94.5%
Simplified94.5%
if -1 < z < 0.00379999999999999999Initial program 95.0%
Taylor expanded in z around 0 92.5%
+-commutative92.5%
associate-*r/90.8%
*-commutative90.8%
associate-*r*90.8%
neg-mul-190.8%
distribute-rgt-out93.3%
unsub-neg93.3%
Simplified93.3%
Final simplification94.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.1) (not (<= z 1550000.0))) (/ x (/ z (+ y t))) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.1) || !(z <= 1550000.0)) {
tmp = x / (z / (y + t));
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.1d0)) .or. (.not. (z <= 1550000.0d0))) then
tmp = x / (z / (y + t))
else
tmp = x * ((y / z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.1) || !(z <= 1550000.0)) {
tmp = x / (z / (y + t));
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.1) or not (z <= 1550000.0): tmp = x / (z / (y + t)) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.1) || !(z <= 1550000.0)) tmp = Float64(x / Float64(z / Float64(y + t))); else tmp = Float64(x * Float64(Float64(y / z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.1) || ~((z <= 1550000.0))) tmp = x / (z / (y + t)); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.1], N[Not[LessEqual[z, 1550000.0]], $MachinePrecision]], N[(x / N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \lor \neg \left(z \leq 1550000\right):\\
\;\;\;\;\frac{x}{\frac{z}{y + t}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -1.1000000000000001 or 1.55e6 < z Initial program 95.4%
Taylor expanded in z around inf 88.9%
associate-/l*94.4%
cancel-sign-sub-inv94.4%
metadata-eval94.4%
*-lft-identity94.4%
+-commutative94.4%
Simplified94.4%
if -1.1000000000000001 < z < 1.55e6Initial program 95.2%
Taylor expanded in z around 0 92.7%
+-commutative92.7%
associate-*r/91.1%
*-commutative91.1%
associate-*r*91.1%
neg-mul-191.1%
distribute-rgt-out93.6%
unsub-neg93.6%
Simplified93.6%
Final simplification94.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 0.0038))) (* x (/ t z)) (- (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 0.0038)) {
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 ((z <= (-1.0d0)) .or. (.not. (z <= 0.0038d0))) 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 ((z <= -1.0) || !(z <= 0.0038)) {
tmp = x * (t / z);
} else {
tmp = -(x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 0.0038): tmp = x * (t / z) else: tmp = -(x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 0.0038)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(-Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 0.0038))) tmp = x * (t / z); else tmp = -(x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 0.0038]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], (-N[(x * t), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 0.0038\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;-x \cdot t\\
\end{array}
\end{array}
if z < -1 or 0.00379999999999999999 < z Initial program 95.6%
Taylor expanded in z around inf 94.5%
cancel-sign-sub-inv94.5%
metadata-eval94.5%
*-lft-identity94.5%
+-commutative94.5%
Simplified94.5%
Taylor expanded in t around inf 57.1%
if -1 < z < 0.00379999999999999999Initial program 95.0%
Taylor expanded in y around 0 37.3%
associate-*r/37.3%
associate-*r*37.3%
neg-mul-137.3%
Simplified37.3%
Taylor expanded in z around 0 35.6%
associate-*r*35.6%
mul-1-neg35.6%
Simplified35.6%
Final simplification47.2%
(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(-Float64(x * 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 t
\end{array}
Initial program 95.3%
Taylor expanded in y around 0 46.6%
associate-*r/46.6%
associate-*r*46.6%
neg-mul-146.6%
Simplified46.6%
Taylor expanded in z around 0 24.8%
associate-*r*24.8%
mul-1-neg24.8%
Simplified24.8%
Final simplification24.8%
(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 2024010
(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)))))