
(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 (+ -1.0 z)))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 4e+291)))
(* y (/ x z))
(* x t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) + (t / (-1.0 + z));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 4e+291)) {
tmp = y * (x / z);
} else {
tmp = x * t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y / z) + (t / (-1.0 + z));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 4e+291)) {
tmp = y * (x / z);
} else {
tmp = x * t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) + (t / (-1.0 + z)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 4e+291): tmp = y * (x / z) else: tmp = x * t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) + Float64(t / Float64(-1.0 + z))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 4e+291)) tmp = Float64(y * Float64(x / z)); else tmp = Float64(x * t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) + (t / (-1.0 + z)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 4e+291))) tmp = y * (x / z); else tmp = x * t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] + N[(t / N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 4e+291]], $MachinePrecision]], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} + \frac{t}{-1 + z}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 4 \cdot 10^{+291}\right):\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\_1\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0 or 3.9999999999999998e291 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 65.6%
clear-num65.6%
associate-/r/65.6%
Applied egg-rr65.6%
Taylor expanded in y around inf 99.8%
associate-*l/99.9%
associate-/r/66.3%
Simplified66.3%
associate-/r/99.9%
Applied egg-rr99.9%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 3.9999999999999998e291Initial program 99.3%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ x (+ -1.0 z)))) (t_2 (* y (/ x z))))
(if (<= t -4.8e+157)
(/ x (/ z t))
(if (<= t -4.8e+93)
t_2
(if (<= t -4.5e+55)
t_1
(if (<= t 1.06e-298) (* x (/ y z)) (if (<= t 2.3e+48) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (x / (-1.0 + z));
double t_2 = y * (x / z);
double tmp;
if (t <= -4.8e+157) {
tmp = x / (z / t);
} else if (t <= -4.8e+93) {
tmp = t_2;
} else if (t <= -4.5e+55) {
tmp = t_1;
} else if (t <= 1.06e-298) {
tmp = x * (y / z);
} else if (t <= 2.3e+48) {
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 = t * (x / ((-1.0d0) + z))
t_2 = y * (x / z)
if (t <= (-4.8d+157)) then
tmp = x / (z / t)
else if (t <= (-4.8d+93)) then
tmp = t_2
else if (t <= (-4.5d+55)) then
tmp = t_1
else if (t <= 1.06d-298) then
tmp = x * (y / z)
else if (t <= 2.3d+48) 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 = t * (x / (-1.0 + z));
double t_2 = y * (x / z);
double tmp;
if (t <= -4.8e+157) {
tmp = x / (z / t);
} else if (t <= -4.8e+93) {
tmp = t_2;
} else if (t <= -4.5e+55) {
tmp = t_1;
} else if (t <= 1.06e-298) {
tmp = x * (y / z);
} else if (t <= 2.3e+48) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (x / (-1.0 + z)) t_2 = y * (x / z) tmp = 0 if t <= -4.8e+157: tmp = x / (z / t) elif t <= -4.8e+93: tmp = t_2 elif t <= -4.5e+55: tmp = t_1 elif t <= 1.06e-298: tmp = x * (y / z) elif t <= 2.3e+48: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(x / Float64(-1.0 + z))) t_2 = Float64(y * Float64(x / z)) tmp = 0.0 if (t <= -4.8e+157) tmp = Float64(x / Float64(z / t)); elseif (t <= -4.8e+93) tmp = t_2; elseif (t <= -4.5e+55) tmp = t_1; elseif (t <= 1.06e-298) tmp = Float64(x * Float64(y / z)); elseif (t <= 2.3e+48) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (x / (-1.0 + z)); t_2 = y * (x / z); tmp = 0.0; if (t <= -4.8e+157) tmp = x / (z / t); elseif (t <= -4.8e+93) tmp = t_2; elseif (t <= -4.5e+55) tmp = t_1; elseif (t <= 1.06e-298) tmp = x * (y / z); elseif (t <= 2.3e+48) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(x / N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.8e+157], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.8e+93], t$95$2, If[LessEqual[t, -4.5e+55], t$95$1, If[LessEqual[t, 1.06e-298], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.3e+48], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{x}{-1 + z}\\
t_2 := y \cdot \frac{x}{z}\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{+157}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{elif}\;t \leq -4.8 \cdot 10^{+93}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.06 \cdot 10^{-298}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{+48}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.7999999999999999e157Initial program 97.3%
Taylor expanded in z around inf 83.0%
*-commutative83.0%
remove-double-neg83.0%
cancel-sign-sub-inv83.0%
metadata-eval83.0%
*-lft-identity83.0%
distribute-neg-out83.0%
neg-mul-183.0%
sub-neg83.0%
distribute-lft-neg-in83.0%
*-commutative83.0%
distribute-neg-frac83.0%
associate-/l*87.7%
distribute-rgt-neg-in87.7%
distribute-neg-frac87.7%
Simplified87.7%
clear-num87.7%
un-div-inv87.8%
+-commutative87.8%
Applied egg-rr87.8%
Taylor expanded in y around 0 83.0%
if -4.7999999999999999e157 < t < -4.80000000000000021e93 or 1.0600000000000001e-298 < t < 2.3e48Initial program 92.3%
clear-num92.2%
associate-/r/92.3%
Applied egg-rr92.3%
Taylor expanded in y around inf 73.5%
associate-*l/76.2%
associate-/r/73.6%
Simplified73.6%
associate-/r/76.2%
Applied egg-rr76.2%
if -4.80000000000000021e93 < t < -4.49999999999999998e55 or 2.3e48 < t Initial program 95.2%
Taylor expanded in y around 0 68.8%
mul-1-neg68.8%
associate-/l*68.7%
distribute-rgt-neg-in68.7%
distribute-neg-frac268.7%
neg-sub068.7%
associate--r-68.7%
metadata-eval68.7%
Simplified68.7%
if -4.49999999999999998e55 < t < 1.0600000000000001e-298Initial program 96.3%
Taylor expanded in y around inf 80.8%
associate-*r/89.6%
Simplified89.6%
Final simplification79.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) t))))
(if (<= z -1.65e+54)
(* x (/ t z))
(if (<= z 3.2e-217)
t_1
(if (<= z 1.65e-144)
(* y (/ x z))
(if (<= z 3.5e+26) t_1 (/ x (/ z t))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - t);
double tmp;
if (z <= -1.65e+54) {
tmp = x * (t / z);
} else if (z <= 3.2e-217) {
tmp = t_1;
} else if (z <= 1.65e-144) {
tmp = y * (x / z);
} else if (z <= 3.5e+26) {
tmp = t_1;
} else {
tmp = x / (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) :: t_1
real(8) :: tmp
t_1 = x * ((y / z) - t)
if (z <= (-1.65d+54)) then
tmp = x * (t / z)
else if (z <= 3.2d-217) then
tmp = t_1
else if (z <= 1.65d-144) then
tmp = y * (x / z)
else if (z <= 3.5d+26) then
tmp = t_1
else
tmp = x / (z / t)
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 <= -1.65e+54) {
tmp = x * (t / z);
} else if (z <= 3.2e-217) {
tmp = t_1;
} else if (z <= 1.65e-144) {
tmp = y * (x / z);
} else if (z <= 3.5e+26) {
tmp = t_1;
} else {
tmp = x / (z / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - t) tmp = 0 if z <= -1.65e+54: tmp = x * (t / z) elif z <= 3.2e-217: tmp = t_1 elif z <= 1.65e-144: tmp = y * (x / z) elif z <= 3.5e+26: tmp = t_1 else: tmp = x / (z / t) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - t)) tmp = 0.0 if (z <= -1.65e+54) tmp = Float64(x * Float64(t / z)); elseif (z <= 3.2e-217) tmp = t_1; elseif (z <= 1.65e-144) tmp = Float64(y * Float64(x / z)); elseif (z <= 3.5e+26) tmp = t_1; else tmp = Float64(x / Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - t); tmp = 0.0; if (z <= -1.65e+54) tmp = x * (t / z); elseif (z <= 3.2e-217) tmp = t_1; elseif (z <= 1.65e-144) tmp = y * (x / z); elseif (z <= 3.5e+26) tmp = t_1; else tmp = x / (z / t); 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, -1.65e+54], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e-217], t$95$1, If[LessEqual[z, 1.65e-144], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+26], t$95$1, N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+54}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-217}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-144}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\end{array}
\end{array}
if z < -1.65e54Initial program 97.9%
Taylor expanded in y around 0 72.6%
mul-1-neg72.6%
associate-/l*67.4%
distribute-rgt-neg-in67.4%
distribute-neg-frac267.4%
neg-sub067.4%
associate--r-67.4%
metadata-eval67.4%
Simplified67.4%
Taylor expanded in z around inf 72.6%
*-commutative72.6%
associate-/l*76.1%
Simplified76.1%
if -1.65e54 < z < 3.2000000000000001e-217 or 1.64999999999999998e-144 < z < 3.4999999999999999e26Initial program 94.9%
Taylor expanded in z around 0 89.4%
if 3.2000000000000001e-217 < z < 1.64999999999999998e-144Initial program 73.1%
clear-num73.1%
associate-/r/73.1%
Applied egg-rr73.1%
Taylor expanded in y around inf 94.6%
associate-*l/99.5%
associate-/r/74.5%
Simplified74.5%
associate-/r/99.5%
Applied egg-rr99.5%
if 3.4999999999999999e26 < z Initial program 99.8%
Taylor expanded in z around inf 92.7%
*-commutative92.7%
remove-double-neg92.7%
cancel-sign-sub-inv92.7%
metadata-eval92.7%
*-lft-identity92.7%
distribute-neg-out92.7%
neg-mul-192.7%
sub-neg92.7%
distribute-lft-neg-in92.7%
*-commutative92.7%
distribute-neg-frac92.7%
associate-/l*99.8%
distribute-rgt-neg-in99.8%
distribute-neg-frac99.8%
Simplified99.8%
clear-num99.6%
un-div-inv99.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in y around 0 72.5%
Final simplification83.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 5.5e-217)
t_1
(if (<= z 1.65e-144) (* 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 <= 5.5e-217) {
tmp = t_1;
} else if (z <= 1.65e-144) {
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 <= 5.5d-217) then
tmp = t_1
else if (z <= 1.65d-144) 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 <= 5.5e-217) {
tmp = t_1;
} else if (z <= 1.65e-144) {
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 <= 5.5e-217: tmp = t_1 elif z <= 1.65e-144: 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 <= 5.5e-217) tmp = t_1; elseif (z <= 1.65e-144) 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 <= 5.5e-217) tmp = t_1; elseif (z <= 1.65e-144) 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, 5.5e-217], t$95$1, If[LessEqual[z, 1.65e-144], 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 5.5 \cdot 10^{-217}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-144}:\\
\;\;\;\;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 99.0%
Taylor expanded in z around inf 90.2%
*-commutative90.2%
remove-double-neg90.2%
cancel-sign-sub-inv90.2%
metadata-eval90.2%
*-lft-identity90.2%
distribute-neg-out90.2%
neg-mul-190.2%
sub-neg90.2%
distribute-lft-neg-in90.2%
*-commutative90.2%
distribute-neg-frac90.2%
associate-/l*98.4%
distribute-rgt-neg-in98.4%
distribute-neg-frac98.4%
Simplified98.4%
if -1 < z < 5.49999999999999975e-217 or 1.64999999999999998e-144 < z < 1Initial program 94.1%
Taylor expanded in z around 0 92.6%
if 5.49999999999999975e-217 < z < 1.64999999999999998e-144Initial program 73.1%
clear-num73.1%
associate-/r/73.1%
Applied egg-rr73.1%
Taylor expanded in y around inf 94.6%
associate-*l/99.5%
associate-/r/74.5%
Simplified74.5%
associate-/r/99.5%
Applied egg-rr99.5%
Final simplification95.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) t))))
(if (<= z -1.0)
(* x (+ (/ y z) (/ t z)))
(if (<= z 5.4e-217)
t_1
(if (<= z 1.65e-144)
(* y (/ x z))
(if (<= z 1.0) t_1 (* x (/ (+ y t) z))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - t);
double tmp;
if (z <= -1.0) {
tmp = x * ((y / z) + (t / z));
} else if (z <= 5.4e-217) {
tmp = t_1;
} else if (z <= 1.65e-144) {
tmp = y * (x / z);
} else if (z <= 1.0) {
tmp = t_1;
} else {
tmp = x * ((y + t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((y / z) - t)
if (z <= (-1.0d0)) then
tmp = x * ((y / z) + (t / z))
else if (z <= 5.4d-217) then
tmp = t_1
else if (z <= 1.65d-144) then
tmp = y * (x / z)
else if (z <= 1.0d0) then
tmp = t_1
else
tmp = x * ((y + t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - t);
double tmp;
if (z <= -1.0) {
tmp = x * ((y / z) + (t / z));
} else if (z <= 5.4e-217) {
tmp = t_1;
} else if (z <= 1.65e-144) {
tmp = y * (x / z);
} else if (z <= 1.0) {
tmp = t_1;
} else {
tmp = x * ((y + t) / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - t) tmp = 0 if z <= -1.0: tmp = x * ((y / z) + (t / z)) elif z <= 5.4e-217: tmp = t_1 elif z <= 1.65e-144: tmp = y * (x / z) elif z <= 1.0: tmp = t_1 else: tmp = x * ((y + t) / z) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - t)) tmp = 0.0 if (z <= -1.0) tmp = Float64(x * Float64(Float64(y / z) + Float64(t / z))); elseif (z <= 5.4e-217) tmp = t_1; elseif (z <= 1.65e-144) tmp = Float64(y * Float64(x / z)); elseif (z <= 1.0) tmp = t_1; else tmp = Float64(x * Float64(Float64(y + t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - t); tmp = 0.0; if (z <= -1.0) tmp = x * ((y / z) + (t / z)); elseif (z <= 5.4e-217) tmp = t_1; elseif (z <= 1.65e-144) tmp = y * (x / z); elseif (z <= 1.0) tmp = t_1; else tmp = x * ((y + t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.0], N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e-217], t$95$1, If[LessEqual[z, 1.65e-144], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], t$95$1, N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-217}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-144}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\end{array}
\end{array}
if z < -1Initial program 98.3%
Taylor expanded in z around inf 87.6%
*-commutative87.6%
remove-double-neg87.6%
cancel-sign-sub-inv87.6%
metadata-eval87.6%
*-lft-identity87.6%
distribute-neg-out87.6%
neg-mul-187.6%
sub-neg87.6%
distribute-lft-neg-in87.6%
*-commutative87.6%
distribute-neg-frac87.6%
associate-/l*97.3%
distribute-rgt-neg-in97.3%
distribute-neg-frac97.3%
Simplified97.3%
Taylor expanded in t around 0 97.3%
if -1 < z < 5.40000000000000032e-217 or 1.64999999999999998e-144 < z < 1Initial program 94.1%
Taylor expanded in z around 0 92.6%
if 5.40000000000000032e-217 < z < 1.64999999999999998e-144Initial program 73.1%
clear-num73.1%
associate-/r/73.1%
Applied egg-rr73.1%
Taylor expanded in y around inf 94.6%
associate-*l/99.5%
associate-/r/74.5%
Simplified74.5%
associate-/r/99.5%
Applied egg-rr99.5%
if 1 < z Initial program 99.8%
Taylor expanded in z around inf 93.3%
*-commutative93.3%
remove-double-neg93.3%
cancel-sign-sub-inv93.3%
metadata-eval93.3%
*-lft-identity93.3%
distribute-neg-out93.3%
neg-mul-193.3%
sub-neg93.3%
distribute-lft-neg-in93.3%
*-commutative93.3%
distribute-neg-frac93.3%
associate-/l*99.8%
distribute-rgt-neg-in99.8%
distribute-neg-frac99.8%
Simplified99.8%
Final simplification95.9%
(FPCore (x y z t) :precision binary64 (if (<= x 8e-154) (* y (+ (/ (* x t) (* y (+ -1.0 z))) (/ x z))) (* x (+ (/ y z) (/ t (+ -1.0 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 8e-154) {
tmp = y * (((x * t) / (y * (-1.0 + z))) + (x / z));
} else {
tmp = x * ((y / z) + (t / (-1.0 + 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 <= 8d-154) then
tmp = y * (((x * t) / (y * ((-1.0d0) + z))) + (x / z))
else
tmp = x * ((y / z) + (t / ((-1.0d0) + z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 8e-154) {
tmp = y * (((x * t) / (y * (-1.0 + z))) + (x / z));
} else {
tmp = x * ((y / z) + (t / (-1.0 + z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 8e-154: tmp = y * (((x * t) / (y * (-1.0 + z))) + (x / z)) else: tmp = x * ((y / z) + (t / (-1.0 + z))) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 8e-154) tmp = Float64(y * Float64(Float64(Float64(x * t) / Float64(y * Float64(-1.0 + z))) + Float64(x / z))); else tmp = Float64(x * Float64(Float64(y / z) + Float64(t / Float64(-1.0 + z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 8e-154) tmp = y * (((x * t) / (y * (-1.0 + z))) + (x / z)); else tmp = x * ((y / z) + (t / (-1.0 + z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 8e-154], N[(y * N[(N[(N[(x * t), $MachinePrecision] / N[(y * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8 \cdot 10^{-154}:\\
\;\;\;\;y \cdot \left(\frac{x \cdot t}{y \cdot \left(-1 + z\right)} + \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{-1 + z}\right)\\
\end{array}
\end{array}
if x < 7.9999999999999998e-154Initial program 93.2%
Taylor expanded in y around inf 85.4%
mul-1-neg85.4%
distribute-neg-frac285.4%
distribute-rgt-neg-in85.4%
neg-sub085.4%
associate--r-85.4%
metadata-eval85.4%
Simplified85.4%
if 7.9999999999999998e-154 < x Initial program 97.9%
Final simplification90.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* t (/ x z)) (* x (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = t * (x / z);
} else {
tmp = x * -t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 1.0d0))) then
tmp = t * (x / z)
else
tmp = x * -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
tmp = t * (x / z);
} else {
tmp = x * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 1.0): tmp = t * (x / z) else: tmp = x * -t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(t * Float64(x / z)); else tmp = Float64(x * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.0))) tmp = t * (x / 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, 1.0]], $MachinePrecision]], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 99.0%
Taylor expanded in y around 0 64.3%
mul-1-neg64.3%
associate-/l*59.1%
distribute-rgt-neg-in59.1%
distribute-neg-frac259.1%
neg-sub059.1%
associate--r-59.1%
metadata-eval59.1%
Simplified59.1%
Taylor expanded in z around inf 63.8%
associate-/l*58.6%
Simplified58.6%
if -1 < z < 1Initial program 91.2%
Taylor expanded in y around 0 34.6%
mul-1-neg34.6%
associate-/l*34.6%
distribute-rgt-neg-in34.6%
distribute-neg-frac234.6%
neg-sub034.6%
associate--r-34.6%
metadata-eval34.6%
Simplified34.6%
Taylor expanded in z around 0 33.3%
associate-*r*33.3%
neg-mul-133.3%
*-commutative33.3%
Simplified33.3%
Final simplification45.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 1.0))) (* x (/ t z)) (* x (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 1.0)) {
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 <= 1.0d0))) 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 <= 1.0)) {
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 <= 1.0): tmp = x * (t / z) else: tmp = x * -t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.0) || !(z <= 1.0)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(x * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1.0))) 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, 1.0]], $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 1\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 99.0%
Taylor expanded in y around 0 64.3%
mul-1-neg64.3%
associate-/l*59.1%
distribute-rgt-neg-in59.1%
distribute-neg-frac259.1%
neg-sub059.1%
associate--r-59.1%
metadata-eval59.1%
Simplified59.1%
Taylor expanded in z around inf 63.8%
*-commutative63.8%
associate-/l*67.5%
Simplified67.5%
if -1 < z < 1Initial program 91.2%
Taylor expanded in y around 0 34.6%
mul-1-neg34.6%
associate-/l*34.6%
distribute-rgt-neg-in34.6%
distribute-neg-frac234.6%
neg-sub034.6%
associate--r-34.6%
metadata-eval34.6%
Simplified34.6%
Taylor expanded in z around 0 33.3%
associate-*r*33.3%
neg-mul-133.3%
*-commutative33.3%
Simplified33.3%
Final simplification49.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -7.8e+157) (not (<= t 3.3e+66))) (* x (/ t z)) (* x (/ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.8e+157) || !(t <= 3.3e+66)) {
tmp = x * (t / z);
} else {
tmp = x * (y / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-7.8d+157)) .or. (.not. (t <= 3.3d+66))) then
tmp = x * (t / z)
else
tmp = x * (y / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.8e+157) || !(t <= 3.3e+66)) {
tmp = x * (t / z);
} else {
tmp = x * (y / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -7.8e+157) or not (t <= 3.3e+66): tmp = x * (t / z) else: tmp = x * (y / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -7.8e+157) || !(t <= 3.3e+66)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(x * Float64(y / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -7.8e+157) || ~((t <= 3.3e+66))) tmp = x * (t / z); else tmp = x * (y / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -7.8e+157], N[Not[LessEqual[t, 3.3e+66]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{+157} \lor \neg \left(t \leq 3.3 \cdot 10^{+66}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}
\end{array}
if t < -7.79999999999999941e157 or 3.3000000000000001e66 < t Initial program 95.5%
Taylor expanded in y around 0 73.9%
mul-1-neg73.9%
associate-/l*66.7%
distribute-rgt-neg-in66.7%
distribute-neg-frac266.7%
neg-sub066.7%
associate--r-66.7%
metadata-eval66.7%
Simplified66.7%
Taylor expanded in z around inf 60.7%
*-commutative60.7%
associate-/l*66.9%
Simplified66.9%
if -7.79999999999999941e157 < t < 3.3000000000000001e66Initial program 94.7%
Taylor expanded in y around inf 74.8%
associate-*r/78.9%
Simplified78.9%
Final simplification74.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.1e+163) (not (<= t 3.7e+139))) (* x (/ t z)) (* y (/ x z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.1e+163) || !(t <= 3.7e+139)) {
tmp = x * (t / z);
} else {
tmp = y * (x / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-2.1d+163)) .or. (.not. (t <= 3.7d+139))) then
tmp = x * (t / z)
else
tmp = y * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.1e+163) || !(t <= 3.7e+139)) {
tmp = x * (t / z);
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.1e+163) or not (t <= 3.7e+139): tmp = x * (t / z) else: tmp = y * (x / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.1e+163) || !(t <= 3.7e+139)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.1e+163) || ~((t <= 3.7e+139))) tmp = x * (t / z); else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.1e+163], N[Not[LessEqual[t, 3.7e+139]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+163} \lor \neg \left(t \leq 3.7 \cdot 10^{+139}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if t < -2.1e163 or 3.69999999999999992e139 < t Initial program 98.5%
Taylor expanded in y around 0 76.8%
mul-1-neg76.8%
associate-/l*68.2%
distribute-rgt-neg-in68.2%
distribute-neg-frac268.2%
neg-sub068.2%
associate--r-68.2%
metadata-eval68.2%
Simplified68.2%
Taylor expanded in z around inf 65.1%
*-commutative65.1%
associate-/l*72.5%
Simplified72.5%
if -2.1e163 < t < 3.69999999999999992e139Initial program 93.5%
clear-num93.4%
associate-/r/93.5%
Applied egg-rr93.5%
Taylor expanded in y around inf 72.0%
associate-*l/76.9%
associate-/r/75.4%
Simplified75.4%
associate-/r/76.9%
Applied egg-rr76.9%
Final simplification75.6%
(FPCore (x y z t) :precision binary64 (if (<= t -2.6e+158) (/ x (/ z t)) (if (<= t 4.4e+138) (* y (/ x z)) (* x (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.6e+158) {
tmp = x / (z / t);
} else if (t <= 4.4e+138) {
tmp = y * (x / z);
} 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 (t <= (-2.6d+158)) then
tmp = x / (z / t)
else if (t <= 4.4d+138) then
tmp = y * (x / z)
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 (t <= -2.6e+158) {
tmp = x / (z / t);
} else if (t <= 4.4e+138) {
tmp = y * (x / z);
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.6e+158: tmp = x / (z / t) elif t <= 4.4e+138: tmp = y * (x / z) else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.6e+158) tmp = Float64(x / Float64(z / t)); elseif (t <= 4.4e+138) tmp = Float64(y * Float64(x / z)); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.6e+158) tmp = x / (z / t); elseif (t <= 4.4e+138) tmp = y * (x / z); else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.6e+158], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e+138], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+158}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+138}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if t < -2.6e158Initial program 97.3%
Taylor expanded in z around inf 83.0%
*-commutative83.0%
remove-double-neg83.0%
cancel-sign-sub-inv83.0%
metadata-eval83.0%
*-lft-identity83.0%
distribute-neg-out83.0%
neg-mul-183.0%
sub-neg83.0%
distribute-lft-neg-in83.0%
*-commutative83.0%
distribute-neg-frac83.0%
associate-/l*87.7%
distribute-rgt-neg-in87.7%
distribute-neg-frac87.7%
Simplified87.7%
clear-num87.7%
un-div-inv87.8%
+-commutative87.8%
Applied egg-rr87.8%
Taylor expanded in y around 0 83.0%
if -2.6e158 < t < 4.4000000000000001e138Initial program 93.5%
clear-num93.4%
associate-/r/93.5%
Applied egg-rr93.5%
Taylor expanded in y around inf 72.0%
associate-*l/76.9%
associate-/r/75.4%
Simplified75.4%
associate-/r/76.9%
Applied egg-rr76.9%
if 4.4000000000000001e138 < t Initial program 99.8%
Taylor expanded in y around 0 70.2%
mul-1-neg70.2%
associate-/l*70.1%
distribute-rgt-neg-in70.1%
distribute-neg-frac270.1%
neg-sub070.1%
associate--r-70.1%
metadata-eval70.1%
Simplified70.1%
Taylor expanded in z around inf 51.0%
*-commutative51.0%
associate-/l*61.2%
Simplified61.2%
Final simplification75.6%
(FPCore (x y z t) :precision binary64 (* x (- t)))
double code(double x, double y, double z, double t) {
return x * -t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * -t
end function
public static double code(double x, double y, double z, double t) {
return x * -t;
}
def code(x, y, z, t): return x * -t
function code(x, y, z, t) return Float64(x * Float64(-t)) end
function tmp = code(x, y, z, t) tmp = x * -t; end
code[x_, y_, z_, t_] := N[(x * (-t)), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(-t\right)
\end{array}
Initial program 95.0%
Taylor expanded in y around 0 49.0%
mul-1-neg49.0%
associate-/l*46.5%
distribute-rgt-neg-in46.5%
distribute-neg-frac246.5%
neg-sub046.5%
associate--r-46.5%
metadata-eval46.5%
Simplified46.5%
Taylor expanded in z around 0 23.6%
associate-*r*23.6%
neg-mul-123.6%
*-commutative23.6%
Simplified23.6%
Final simplification23.6%
(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 2024095
(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)))))