
(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)) (* (/ 1.0 z) (/ x (/ 1.0 y))) (* 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 = (1.0 / z) * (x / (1.0 / y));
} 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 = (1.0 / z) * (x / (1.0 / y));
} 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 = (1.0 / z) * (x / (1.0 / y)) 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(1.0 / z) * Float64(x / Float64(1.0 / y))); 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 = (1.0 / z) * (x / (1.0 / y)); 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[(1.0 / z), $MachinePrecision] * N[(x / N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $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{1}{z} \cdot \frac{x}{\frac{1}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot x\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) < -inf.0Initial program 58.7%
Taylor expanded in y around inf 99.6%
associate-*r/58.7%
Simplified58.7%
clear-num58.7%
un-div-inv64.3%
Applied egg-rr64.3%
*-un-lft-identity64.3%
div-inv64.3%
times-frac99.9%
Applied egg-rr99.9%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 1 z))) Initial program 97.1%
Final simplification97.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) t))))
(if (<= z -8.2e+77)
(* (/ y z) x)
(if (<= z -3.2e-269)
t_1
(if (<= z 5.8e-267)
(* y (/ x z))
(if (<= z 6e+109)
t_1
(if (or (<= z 8e+224) (not (<= z 1.2e+256)))
(* x (/ t z))
(/ (* y x) z))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - t);
double tmp;
if (z <= -8.2e+77) {
tmp = (y / z) * x;
} else if (z <= -3.2e-269) {
tmp = t_1;
} else if (z <= 5.8e-267) {
tmp = y * (x / z);
} else if (z <= 6e+109) {
tmp = t_1;
} else if ((z <= 8e+224) || !(z <= 1.2e+256)) {
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) :: t_1
real(8) :: tmp
t_1 = x * ((y / z) - t)
if (z <= (-8.2d+77)) then
tmp = (y / z) * x
else if (z <= (-3.2d-269)) then
tmp = t_1
else if (z <= 5.8d-267) then
tmp = y * (x / z)
else if (z <= 6d+109) then
tmp = t_1
else if ((z <= 8d+224) .or. (.not. (z <= 1.2d+256))) 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 t_1 = x * ((y / z) - t);
double tmp;
if (z <= -8.2e+77) {
tmp = (y / z) * x;
} else if (z <= -3.2e-269) {
tmp = t_1;
} else if (z <= 5.8e-267) {
tmp = y * (x / z);
} else if (z <= 6e+109) {
tmp = t_1;
} else if ((z <= 8e+224) || !(z <= 1.2e+256)) {
tmp = x * (t / z);
} else {
tmp = (y * x) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - t) tmp = 0 if z <= -8.2e+77: tmp = (y / z) * x elif z <= -3.2e-269: tmp = t_1 elif z <= 5.8e-267: tmp = y * (x / z) elif z <= 6e+109: tmp = t_1 elif (z <= 8e+224) or not (z <= 1.2e+256): tmp = x * (t / z) else: tmp = (y * x) / z return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - t)) tmp = 0.0 if (z <= -8.2e+77) tmp = Float64(Float64(y / z) * x); elseif (z <= -3.2e-269) tmp = t_1; elseif (z <= 5.8e-267) tmp = Float64(y * Float64(x / z)); elseif (z <= 6e+109) tmp = t_1; elseif ((z <= 8e+224) || !(z <= 1.2e+256)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(Float64(y * x) / z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - t); tmp = 0.0; if (z <= -8.2e+77) tmp = (y / z) * x; elseif (z <= -3.2e-269) tmp = t_1; elseif (z <= 5.8e-267) tmp = y * (x / z); elseif (z <= 6e+109) tmp = t_1; elseif ((z <= 8e+224) || ~((z <= 1.2e+256))) tmp = x * (t / z); else tmp = (y * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+77], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, -3.2e-269], t$95$1, If[LessEqual[z, 5.8e-267], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+109], t$95$1, If[Or[LessEqual[z, 8e+224], N[Not[LessEqual[z, 1.2e+256]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{+77}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-269}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-267}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+224} \lor \neg \left(z \leq 1.2 \cdot 10^{+256}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}
\end{array}
if z < -8.2000000000000002e77Initial program 95.7%
Taylor expanded in y around inf 59.2%
associate-*r/65.0%
Simplified65.0%
if -8.2000000000000002e77 < z < -3.2000000000000001e-269 or 5.80000000000000043e-267 < z < 6.00000000000000031e109Initial program 98.0%
Taylor expanded in z around 0 82.1%
+-commutative82.1%
associate-*r/81.7%
*-commutative81.7%
associate-*r*81.7%
neg-mul-181.7%
distribute-rgt-out85.1%
unsub-neg85.1%
Simplified85.1%
if -3.2000000000000001e-269 < z < 5.80000000000000043e-267Initial program 63.2%
Taylor expanded in y around inf 94.5%
*-commutative94.5%
associate-/l*99.7%
Simplified99.7%
if 6.00000000000000031e109 < z < 7.99999999999999976e224 or 1.20000000000000007e256 < z Initial program 97.1%
Taylor expanded in y around 0 60.0%
mul-1-neg60.0%
*-commutative60.0%
associate-/l*73.4%
distribute-rgt-neg-out73.4%
distribute-neg-frac273.4%
neg-sub073.4%
associate--r-73.4%
metadata-eval73.4%
Simplified73.4%
Taylor expanded in z around inf 73.4%
if 7.99999999999999976e224 < z < 1.20000000000000007e256Initial program 88.8%
Taylor expanded in y around inf 89.0%
Final simplification80.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))) (t_2 (/ (* y x) z)))
(if (<= t -3e+187)
t_1
(if (<= t -3.6e+65)
t_2
(if (<= t -1.5e+32)
(/ t (/ z x))
(if (<= t 2e-255) (/ x (/ z y)) (if (<= t 3.3e-10) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double t_2 = (y * x) / z;
double tmp;
if (t <= -3e+187) {
tmp = t_1;
} else if (t <= -3.6e+65) {
tmp = t_2;
} else if (t <= -1.5e+32) {
tmp = t / (z / x);
} else if (t <= 2e-255) {
tmp = x / (z / y);
} else if (t <= 3.3e-10) {
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 = (y * x) / z
if (t <= (-3d+187)) then
tmp = t_1
else if (t <= (-3.6d+65)) then
tmp = t_2
else if (t <= (-1.5d+32)) then
tmp = t / (z / x)
else if (t <= 2d-255) then
tmp = x / (z / y)
else if (t <= 3.3d-10) 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 = (y * x) / z;
double tmp;
if (t <= -3e+187) {
tmp = t_1;
} else if (t <= -3.6e+65) {
tmp = t_2;
} else if (t <= -1.5e+32) {
tmp = t / (z / x);
} else if (t <= 2e-255) {
tmp = x / (z / y);
} else if (t <= 3.3e-10) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) t_2 = (y * x) / z tmp = 0 if t <= -3e+187: tmp = t_1 elif t <= -3.6e+65: tmp = t_2 elif t <= -1.5e+32: tmp = t / (z / x) elif t <= 2e-255: tmp = x / (z / y) elif t <= 3.3e-10: 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(Float64(y * x) / z) tmp = 0.0 if (t <= -3e+187) tmp = t_1; elseif (t <= -3.6e+65) tmp = t_2; elseif (t <= -1.5e+32) tmp = Float64(t / Float64(z / x)); elseif (t <= 2e-255) tmp = Float64(x / Float64(z / y)); elseif (t <= 3.3e-10) 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 = (y * x) / z; tmp = 0.0; if (t <= -3e+187) tmp = t_1; elseif (t <= -3.6e+65) tmp = t_2; elseif (t <= -1.5e+32) tmp = t / (z / x); elseif (t <= 2e-255) tmp = x / (z / y); elseif (t <= 3.3e-10) 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[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[t, -3e+187], t$95$1, If[LessEqual[t, -3.6e+65], t$95$2, If[LessEqual[t, -1.5e+32], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e-255], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e-10], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
t_2 := \frac{y \cdot x}{z}\\
\mathbf{if}\;t \leq -3 \cdot 10^{+187}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.6 \cdot 10^{+65}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1.5 \cdot 10^{+32}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-255}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{-10}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.9999999999999999e187 or 3.3e-10 < t Initial program 98.5%
Taylor expanded in y around 0 62.2%
mul-1-neg62.2%
*-commutative62.2%
associate-/l*70.5%
distribute-rgt-neg-out70.5%
distribute-neg-frac270.5%
neg-sub070.5%
associate--r-70.5%
metadata-eval70.5%
Simplified70.5%
Taylor expanded in z around inf 64.9%
if -2.9999999999999999e187 < t < -3.59999999999999978e65 or 2e-255 < t < 3.3e-10Initial program 91.9%
Taylor expanded in y around inf 78.6%
if -3.59999999999999978e65 < t < -1.5e32Initial program 93.1%
Taylor expanded in y around 0 70.3%
mul-1-neg70.3%
*-commutative70.3%
associate-/l*70.6%
distribute-rgt-neg-out70.6%
distribute-neg-frac270.6%
neg-sub070.6%
associate--r-70.6%
metadata-eval70.6%
Simplified70.6%
Taylor expanded in z around inf 55.5%
associate-/l*55.7%
Simplified55.7%
clear-num55.5%
un-div-inv55.8%
Applied egg-rr55.8%
if -1.5e32 < t < 2e-255Initial program 94.0%
Taylor expanded in y around inf 81.0%
associate-*r/83.9%
Simplified83.9%
clear-num83.8%
un-div-inv84.5%
Applied egg-rr84.5%
Final simplification74.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) t))) (t_2 (* x (/ (+ y t) z))))
(if (<= z -1.0)
t_2
(if (<= z -1.1e-269)
t_1
(if (<= z 1.6e-270) (* y (/ x z)) (if (<= z 1.0) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - t);
double t_2 = x * ((y + t) / z);
double tmp;
if (z <= -1.0) {
tmp = t_2;
} else if (z <= -1.1e-269) {
tmp = t_1;
} else if (z <= 1.6e-270) {
tmp = y * (x / z);
} else if (z <= 1.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * ((y / z) - t)
t_2 = x * ((y + t) / z)
if (z <= (-1.0d0)) then
tmp = t_2
else if (z <= (-1.1d-269)) then
tmp = t_1
else if (z <= 1.6d-270) then
tmp = y * (x / z)
else if (z <= 1.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - t);
double t_2 = x * ((y + t) / z);
double tmp;
if (z <= -1.0) {
tmp = t_2;
} else if (z <= -1.1e-269) {
tmp = t_1;
} else if (z <= 1.6e-270) {
tmp = y * (x / z);
} else if (z <= 1.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - t) t_2 = x * ((y + t) / z) tmp = 0 if z <= -1.0: tmp = t_2 elif z <= -1.1e-269: tmp = t_1 elif z <= 1.6e-270: tmp = y * (x / z) elif z <= 1.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - t)) t_2 = Float64(x * Float64(Float64(y + t) / z)) tmp = 0.0 if (z <= -1.0) tmp = t_2; elseif (z <= -1.1e-269) tmp = t_1; elseif (z <= 1.6e-270) tmp = Float64(y * Float64(x / z)); elseif (z <= 1.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - t); t_2 = x * ((y + t) / z); tmp = 0.0; if (z <= -1.0) tmp = t_2; elseif (z <= -1.1e-269) tmp = t_1; elseif (z <= 1.6e-270) tmp = y * (x / z); elseif (z <= 1.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.0], t$95$2, If[LessEqual[z, -1.1e-269], t$95$1, If[LessEqual[z, 1.6e-270], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t\right)\\
t_2 := x \cdot \frac{y + t}{z}\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-269}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-270}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 96.3%
Taylor expanded in z around inf 89.2%
*-commutative89.2%
remove-double-neg89.2%
cancel-sign-sub-inv89.2%
metadata-eval89.2%
*-lft-identity89.2%
distribute-neg-out89.2%
neg-mul-189.2%
sub-neg89.2%
mul-1-neg89.2%
associate-*r*89.2%
*-commutative89.2%
associate-*r/89.2%
mul-1-neg89.2%
associate-/l*95.0%
distribute-rgt-neg-in95.0%
distribute-neg-frac95.0%
Simplified95.0%
if -1 < z < -1.09999999999999992e-269 or 1.59999999999999994e-270 < z < 1Initial program 98.0%
Taylor expanded in z around 0 92.0%
+-commutative92.0%
associate-*r/91.5%
*-commutative91.5%
associate-*r*91.5%
neg-mul-191.5%
distribute-rgt-out96.2%
unsub-neg96.2%
Simplified96.2%
if -1.09999999999999992e-269 < z < 1.59999999999999994e-270Initial program 63.2%
Taylor expanded in y around inf 94.5%
*-commutative94.5%
associate-/l*99.7%
Simplified99.7%
Final simplification95.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -4e+187)
t_1
(if (<= t -3.95e+65)
(* y (/ x z))
(if (or (<= t -1.5e+32) (not (<= t 15000000000000.0)))
t_1
(* (/ y z) x))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -4e+187) {
tmp = t_1;
} else if (t <= -3.95e+65) {
tmp = y * (x / z);
} else if ((t <= -1.5e+32) || !(t <= 15000000000000.0)) {
tmp = t_1;
} else {
tmp = (y / z) * 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) :: t_1
real(8) :: tmp
t_1 = x * (t / z)
if (t <= (-4d+187)) then
tmp = t_1
else if (t <= (-3.95d+65)) then
tmp = y * (x / z)
else if ((t <= (-1.5d+32)) .or. (.not. (t <= 15000000000000.0d0))) then
tmp = t_1
else
tmp = (y / z) * x
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 <= -4e+187) {
tmp = t_1;
} else if (t <= -3.95e+65) {
tmp = y * (x / z);
} else if ((t <= -1.5e+32) || !(t <= 15000000000000.0)) {
tmp = t_1;
} else {
tmp = (y / z) * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -4e+187: tmp = t_1 elif t <= -3.95e+65: tmp = y * (x / z) elif (t <= -1.5e+32) or not (t <= 15000000000000.0): tmp = t_1 else: tmp = (y / z) * x return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -4e+187) tmp = t_1; elseif (t <= -3.95e+65) tmp = Float64(y * Float64(x / z)); elseif ((t <= -1.5e+32) || !(t <= 15000000000000.0)) tmp = t_1; else tmp = Float64(Float64(y / z) * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (t <= -4e+187) tmp = t_1; elseif (t <= -3.95e+65) tmp = y * (x / z); elseif ((t <= -1.5e+32) || ~((t <= 15000000000000.0))) tmp = t_1; else tmp = (y / z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4e+187], t$95$1, If[LessEqual[t, -3.95e+65], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1.5e+32], N[Not[LessEqual[t, 15000000000000.0]], $MachinePrecision]], t$95$1, N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -4 \cdot 10^{+187}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.95 \cdot 10^{+65}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;t \leq -1.5 \cdot 10^{+32} \lor \neg \left(t \leq 15000000000000\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\end{array}
\end{array}
if t < -3.99999999999999963e187 or -3.9499999999999999e65 < t < -1.5e32 or 1.5e13 < t Initial program 97.7%
Taylor expanded in y around 0 63.4%
mul-1-neg63.4%
*-commutative63.4%
associate-/l*71.0%
distribute-rgt-neg-out71.0%
distribute-neg-frac271.0%
neg-sub071.0%
associate--r-71.0%
metadata-eval71.0%
Simplified71.0%
Taylor expanded in z around inf 64.8%
if -3.99999999999999963e187 < t < -3.9499999999999999e65Initial program 92.3%
Taylor expanded in y around inf 53.5%
*-commutative53.5%
associate-/l*53.4%
Simplified53.4%
if -1.5e32 < t < 1.5e13Initial program 93.3%
Taylor expanded in y around inf 82.4%
associate-*r/82.6%
Simplified82.6%
Final simplification73.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -4.5e+187)
t_1
(if (<= t -3e+65)
(* y (/ x z))
(if (<= t -1.35e+32)
(/ t (/ z x))
(if (<= t 1.02e+14) (* (/ y z) x) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -4.5e+187) {
tmp = t_1;
} else if (t <= -3e+65) {
tmp = y * (x / z);
} else if (t <= -1.35e+32) {
tmp = t / (z / x);
} else if (t <= 1.02e+14) {
tmp = (y / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t / z)
if (t <= (-4.5d+187)) then
tmp = t_1
else if (t <= (-3d+65)) then
tmp = y * (x / z)
else if (t <= (-1.35d+32)) then
tmp = t / (z / x)
else if (t <= 1.02d+14) then
tmp = (y / z) * x
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 tmp;
if (t <= -4.5e+187) {
tmp = t_1;
} else if (t <= -3e+65) {
tmp = y * (x / z);
} else if (t <= -1.35e+32) {
tmp = t / (z / x);
} else if (t <= 1.02e+14) {
tmp = (y / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -4.5e+187: tmp = t_1 elif t <= -3e+65: tmp = y * (x / z) elif t <= -1.35e+32: tmp = t / (z / x) elif t <= 1.02e+14: tmp = (y / z) * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -4.5e+187) tmp = t_1; elseif (t <= -3e+65) tmp = Float64(y * Float64(x / z)); elseif (t <= -1.35e+32) tmp = Float64(t / Float64(z / x)); elseif (t <= 1.02e+14) tmp = Float64(Float64(y / z) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (t <= -4.5e+187) tmp = t_1; elseif (t <= -3e+65) tmp = y * (x / z); elseif (t <= -1.35e+32) tmp = t / (z / x); elseif (t <= 1.02e+14) tmp = (y / z) * x; 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]}, If[LessEqual[t, -4.5e+187], t$95$1, If[LessEqual[t, -3e+65], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.35e+32], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.02e+14], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+187}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3 \cdot 10^{+65}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;t \leq -1.35 \cdot 10^{+32}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{+14}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.50000000000000026e187 or 1.02e14 < t Initial program 98.5%
Taylor expanded in y around 0 62.2%
mul-1-neg62.2%
*-commutative62.2%
associate-/l*71.1%
distribute-rgt-neg-out71.1%
distribute-neg-frac271.1%
neg-sub071.1%
associate--r-71.1%
metadata-eval71.1%
Simplified71.1%
Taylor expanded in z around inf 66.4%
if -4.50000000000000026e187 < t < -3.0000000000000002e65Initial program 92.3%
Taylor expanded in y around inf 53.5%
*-commutative53.5%
associate-/l*53.4%
Simplified53.4%
if -3.0000000000000002e65 < t < -1.35000000000000006e32Initial program 93.1%
Taylor expanded in y around 0 70.3%
mul-1-neg70.3%
*-commutative70.3%
associate-/l*70.6%
distribute-rgt-neg-out70.6%
distribute-neg-frac270.6%
neg-sub070.6%
associate--r-70.6%
metadata-eval70.6%
Simplified70.6%
Taylor expanded in z around inf 55.5%
associate-/l*55.7%
Simplified55.7%
clear-num55.5%
un-div-inv55.8%
Applied egg-rr55.8%
if -1.35000000000000006e32 < t < 1.02e14Initial program 93.3%
Taylor expanded in y around inf 82.4%
associate-*r/82.6%
Simplified82.6%
Final simplification73.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -3e+187)
t_1
(if (<= t -6.1e+65)
(* y (/ x z))
(if (<= t -1.5e+32)
(/ t (/ z x))
(if (<= t 1.02e+14) (/ x (/ z y)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -3e+187) {
tmp = t_1;
} else if (t <= -6.1e+65) {
tmp = y * (x / z);
} else if (t <= -1.5e+32) {
tmp = t / (z / x);
} else if (t <= 1.02e+14) {
tmp = x / (z / y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t / z)
if (t <= (-3d+187)) then
tmp = t_1
else if (t <= (-6.1d+65)) then
tmp = y * (x / z)
else if (t <= (-1.5d+32)) then
tmp = t / (z / x)
else if (t <= 1.02d+14) then
tmp = x / (z / y)
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 tmp;
if (t <= -3e+187) {
tmp = t_1;
} else if (t <= -6.1e+65) {
tmp = y * (x / z);
} else if (t <= -1.5e+32) {
tmp = t / (z / x);
} else if (t <= 1.02e+14) {
tmp = x / (z / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -3e+187: tmp = t_1 elif t <= -6.1e+65: tmp = y * (x / z) elif t <= -1.5e+32: tmp = t / (z / x) elif t <= 1.02e+14: tmp = x / (z / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -3e+187) tmp = t_1; elseif (t <= -6.1e+65) tmp = Float64(y * Float64(x / z)); elseif (t <= -1.5e+32) tmp = Float64(t / Float64(z / x)); elseif (t <= 1.02e+14) tmp = Float64(x / Float64(z / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (t <= -3e+187) tmp = t_1; elseif (t <= -6.1e+65) tmp = y * (x / z); elseif (t <= -1.5e+32) tmp = t / (z / x); elseif (t <= 1.02e+14) tmp = x / (z / y); 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]}, If[LessEqual[t, -3e+187], t$95$1, If[LessEqual[t, -6.1e+65], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.5e+32], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.02e+14], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -3 \cdot 10^{+187}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -6.1 \cdot 10^{+65}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;t \leq -1.5 \cdot 10^{+32}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{+14}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.9999999999999999e187 or 1.02e14 < t Initial program 98.5%
Taylor expanded in y around 0 62.2%
mul-1-neg62.2%
*-commutative62.2%
associate-/l*71.1%
distribute-rgt-neg-out71.1%
distribute-neg-frac271.1%
neg-sub071.1%
associate--r-71.1%
metadata-eval71.1%
Simplified71.1%
Taylor expanded in z around inf 66.4%
if -2.9999999999999999e187 < t < -6.09999999999999965e65Initial program 92.3%
Taylor expanded in y around inf 53.5%
*-commutative53.5%
associate-/l*53.4%
Simplified53.4%
if -6.09999999999999965e65 < t < -1.5e32Initial program 93.1%
Taylor expanded in y around 0 70.3%
mul-1-neg70.3%
*-commutative70.3%
associate-/l*70.6%
distribute-rgt-neg-out70.6%
distribute-neg-frac270.6%
neg-sub070.6%
associate--r-70.6%
metadata-eval70.6%
Simplified70.6%
Taylor expanded in z around inf 55.5%
associate-/l*55.7%
Simplified55.7%
clear-num55.5%
un-div-inv55.8%
Applied egg-rr55.8%
if -1.5e32 < t < 1.02e14Initial program 93.3%
Taylor expanded in y around inf 82.4%
associate-*r/82.6%
Simplified82.6%
clear-num82.5%
un-div-inv83.2%
Applied egg-rr83.2%
Final simplification73.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8e+31) (not (<= t 4.4e-11))) (* x (/ t (+ z -1.0))) (/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8e+31) || !(t <= 4.4e-11)) {
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 <= (-8d+31)) .or. (.not. (t <= 4.4d-11))) 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 <= -8e+31) || !(t <= 4.4e-11)) {
tmp = x * (t / (z + -1.0));
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -8e+31) or not (t <= 4.4e-11): tmp = x * (t / (z + -1.0)) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -8e+31) || !(t <= 4.4e-11)) 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 <= -8e+31) || ~((t <= 4.4e-11))) 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, -8e+31], N[Not[LessEqual[t, 4.4e-11]], $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 -8 \cdot 10^{+31} \lor \neg \left(t \leq 4.4 \cdot 10^{-11}\right):\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -7.9999999999999997e31 or 4.4000000000000003e-11 < t Initial program 96.6%
Taylor expanded in y around 0 59.7%
mul-1-neg59.7%
*-commutative59.7%
associate-/l*66.3%
distribute-rgt-neg-out66.3%
distribute-neg-frac266.3%
neg-sub066.3%
associate--r-66.3%
metadata-eval66.3%
Simplified66.3%
if -7.9999999999999997e31 < t < 4.4000000000000003e-11Initial program 93.1%
Taylor expanded in y around inf 84.5%
associate-*r/84.1%
Simplified84.1%
clear-num83.9%
un-div-inv84.7%
Applied egg-rr84.7%
Final simplification76.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.25e+181) (not (<= t 1.02e+14))) (* x (/ t z)) (* (/ y z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.25e+181) || !(t <= 1.02e+14)) {
tmp = x * (t / z);
} else {
tmp = (y / z) * 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 ((t <= (-1.25d+181)) .or. (.not. (t <= 1.02d+14))) then
tmp = x * (t / z)
else
tmp = (y / z) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.25e+181) || !(t <= 1.02e+14)) {
tmp = x * (t / z);
} else {
tmp = (y / z) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.25e+181) or not (t <= 1.02e+14): tmp = x * (t / z) else: tmp = (y / z) * x return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.25e+181) || !(t <= 1.02e+14)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(Float64(y / z) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.25e+181) || ~((t <= 1.02e+14))) tmp = x * (t / z); else tmp = (y / z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.25e+181], N[Not[LessEqual[t, 1.02e+14]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+181} \lor \neg \left(t \leq 1.02 \cdot 10^{+14}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\end{array}
\end{array}
if t < -1.2500000000000001e181 or 1.02e14 < t Initial program 97.3%
Taylor expanded in y around 0 61.9%
mul-1-neg61.9%
*-commutative61.9%
associate-/l*70.6%
distribute-rgt-neg-out70.6%
distribute-neg-frac270.6%
neg-sub070.6%
associate--r-70.6%
metadata-eval70.6%
Simplified70.6%
Taylor expanded in z around inf 65.9%
if -1.2500000000000001e181 < t < 1.02e14Initial program 93.6%
Taylor expanded in y around inf 75.0%
associate-*r/74.2%
Simplified74.2%
Final simplification71.7%
(FPCore (x y z t) :precision binary64 (if (<= x 0.00035) (* x (/ t z)) (* t (/ x z))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.00035) {
tmp = x * (t / z);
} else {
tmp = t * (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 (x <= 0.00035d0) then
tmp = x * (t / z)
else
tmp = t * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.00035) {
tmp = x * (t / z);
} else {
tmp = t * (x / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 0.00035: tmp = x * (t / z) else: tmp = t * (x / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 0.00035) tmp = Float64(x * Float64(t / z)); else tmp = Float64(t * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 0.00035) tmp = x * (t / z); else tmp = t * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 0.00035], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.00035:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\end{array}
\end{array}
if x < 3.49999999999999996e-4Initial program 95.0%
Taylor expanded in y around 0 40.5%
mul-1-neg40.5%
*-commutative40.5%
associate-/l*41.7%
distribute-rgt-neg-out41.7%
distribute-neg-frac241.7%
neg-sub041.7%
associate--r-41.7%
metadata-eval41.7%
Simplified41.7%
Taylor expanded in z around inf 38.4%
if 3.49999999999999996e-4 < x Initial program 93.8%
Taylor expanded in y around 0 48.7%
mul-1-neg48.7%
*-commutative48.7%
associate-/l*50.2%
distribute-rgt-neg-out50.2%
distribute-neg-frac250.2%
neg-sub050.2%
associate--r-50.2%
metadata-eval50.2%
Simplified50.2%
Taylor expanded in z around inf 38.1%
associate-/l*48.6%
Simplified48.6%
Final simplification40.9%
(FPCore (x y z t) :precision binary64 (* t (/ x z)))
double code(double x, double y, double z, double t) {
return t * (x / 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 = t * (x / z)
end function
public static double code(double x, double y, double z, double t) {
return t * (x / z);
}
def code(x, y, z, t): return t * (x / z)
function code(x, y, z, t) return Float64(t * Float64(x / z)) end
function tmp = code(x, y, z, t) tmp = t * (x / z); end
code[x_, y_, z_, t_] := N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \frac{x}{z}
\end{array}
Initial program 94.7%
Taylor expanded in y around 0 42.5%
mul-1-neg42.5%
*-commutative42.5%
associate-/l*43.8%
distribute-rgt-neg-out43.8%
distribute-neg-frac243.8%
neg-sub043.8%
associate--r-43.8%
metadata-eval43.8%
Simplified43.8%
Taylor expanded in z around inf 37.4%
associate-/l*40.2%
Simplified40.2%
Final simplification40.2%
(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 94.7%
Taylor expanded in y around 0 42.5%
mul-1-neg42.5%
*-commutative42.5%
associate-/l*43.8%
distribute-rgt-neg-out43.8%
distribute-neg-frac243.8%
neg-sub043.8%
associate--r-43.8%
metadata-eval43.8%
Simplified43.8%
Taylor expanded in z around 0 19.7%
associate-*r*19.7%
neg-mul-119.7%
Simplified19.7%
Final simplification19.7%
(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 2024053
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:alt
(if (< (* x (- (/ y z) (/ t (- 1.0 z)))) -7.623226303312042e-196) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))) (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) 1.4133944927702302e-211) (+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z)))) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))