
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ y z) (/ t (+ z -1.0)))))
(if (<= t_1 (- INFINITY))
(/ (* y x) z)
(if (<= t_1 5e+304) (* t_1 x) (* y (/ x z))))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) + (t / (z + -1.0));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (y * x) / z;
} else if (t_1 <= 5e+304) {
tmp = t_1 * x;
} else {
tmp = y * (x / z);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y / z) + (t / (z + -1.0));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (y * x) / z;
} else if (t_1 <= 5e+304) {
tmp = t_1 * x;
} else {
tmp = y * (x / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) + (t / (z + -1.0)) tmp = 0 if t_1 <= -math.inf: tmp = (y * x) / z elif t_1 <= 5e+304: tmp = t_1 * x else: tmp = y * (x / z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) + Float64(t / Float64(z + -1.0))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y * x) / z); elseif (t_1 <= 5e+304) tmp = Float64(t_1 * x); else tmp = Float64(y * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) + (t / (z + -1.0)); tmp = 0.0; if (t_1 <= -Inf) tmp = (y * x) / z; elseif (t_1 <= 5e+304) tmp = t_1 * x; else tmp = y * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 5e+304], N[(t$95$1 * x), $MachinePrecision], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} + \frac{t}{z + -1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+304}:\\
\;\;\;\;t\_1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0Initial program 58.9%
Taylor expanded in y around inf 100.0%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 4.9999999999999997e304Initial program 98.9%
if 4.9999999999999997e304 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 46.8%
Taylor expanded in y around inf 99.8%
associate-*r/46.8%
Simplified46.8%
clear-num46.8%
un-div-inv52.5%
Applied egg-rr52.5%
associate-/r/99.9%
Simplified99.9%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) t))))
(if (<= y -1.15e-122)
(* y (/ x z))
(if (<= y -4.2e-197)
t_1
(if (<= y 2.7e-139)
(* t (/ x (+ z -1.0)))
(if (<= y 4.8e-18) t_1 (/ (* y x) z)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - t);
double tmp;
if (y <= -1.15e-122) {
tmp = y * (x / z);
} else if (y <= -4.2e-197) {
tmp = t_1;
} else if (y <= 2.7e-139) {
tmp = t * (x / (z + -1.0));
} else if (y <= 4.8e-18) {
tmp = t_1;
} 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 (y <= (-1.15d-122)) then
tmp = y * (x / z)
else if (y <= (-4.2d-197)) then
tmp = t_1
else if (y <= 2.7d-139) then
tmp = t * (x / (z + (-1.0d0)))
else if (y <= 4.8d-18) then
tmp = t_1
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 (y <= -1.15e-122) {
tmp = y * (x / z);
} else if (y <= -4.2e-197) {
tmp = t_1;
} else if (y <= 2.7e-139) {
tmp = t * (x / (z + -1.0));
} else if (y <= 4.8e-18) {
tmp = t_1;
} else {
tmp = (y * x) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - t) tmp = 0 if y <= -1.15e-122: tmp = y * (x / z) elif y <= -4.2e-197: tmp = t_1 elif y <= 2.7e-139: tmp = t * (x / (z + -1.0)) elif y <= 4.8e-18: tmp = t_1 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 (y <= -1.15e-122) tmp = Float64(y * Float64(x / z)); elseif (y <= -4.2e-197) tmp = t_1; elseif (y <= 2.7e-139) tmp = Float64(t * Float64(x / Float64(z + -1.0))); elseif (y <= 4.8e-18) tmp = t_1; 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 (y <= -1.15e-122) tmp = y * (x / z); elseif (y <= -4.2e-197) tmp = t_1; elseif (y <= 2.7e-139) tmp = t * (x / (z + -1.0)); elseif (y <= 4.8e-18) tmp = t_1; 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[y, -1.15e-122], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.2e-197], t$95$1, If[LessEqual[y, 2.7e-139], N[(t * N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e-18], t$95$1, 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}\;y \leq -1.15 \cdot 10^{-122}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-197}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-139}:\\
\;\;\;\;t \cdot \frac{x}{z + -1}\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}
\end{array}
if y < -1.15000000000000003e-122Initial program 90.1%
Taylor expanded in y around inf 71.2%
associate-*r/68.8%
Simplified68.8%
clear-num68.6%
un-div-inv69.5%
Applied egg-rr69.5%
associate-/r/75.4%
Simplified75.4%
if -1.15000000000000003e-122 < y < -4.2e-197 or 2.6999999999999998e-139 < y < 4.79999999999999988e-18Initial program 97.6%
Taylor expanded in z around 0 80.8%
if -4.2e-197 < y < 2.6999999999999998e-139Initial program 99.8%
Taylor expanded in y around 0 88.0%
mul-1-neg88.0%
associate-/l*81.7%
distribute-rgt-neg-in81.7%
distribute-neg-frac281.7%
neg-sub081.7%
associate--r-81.7%
metadata-eval81.7%
Simplified81.7%
if 4.79999999999999988e-18 < y Initial program 87.7%
Taylor expanded in y around inf 82.2%
Final simplification79.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.8e+14) (not (<= z 1.0))) (* x (/ (+ y t) z)) (* x (- (/ y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.8e+14) || !(z <= 1.0)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.8d+14)) .or. (.not. (z <= 1.0d0))) then
tmp = x * ((y + t) / z)
else
tmp = x * ((y / z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.8e+14) || !(z <= 1.0)) {
tmp = x * ((y + t) / z);
} else {
tmp = x * ((y / z) - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.8e+14) or not (z <= 1.0): tmp = x * ((y + t) / z) else: tmp = x * ((y / z) - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.8e+14) || !(z <= 1.0)) tmp = Float64(x * Float64(Float64(y + t) / z)); else tmp = Float64(x * Float64(Float64(y / z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.8e+14) || ~((z <= 1.0))) tmp = x * ((y + t) / z); else tmp = x * ((y / z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.8e+14], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+14} \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\end{array}
\end{array}
if z < -2.8e14 or 1 < z Initial program 98.1%
Taylor expanded in z around inf 90.6%
associate-/l*98.1%
sub-neg98.1%
neg-mul-198.1%
remove-double-neg98.1%
neg-mul-198.1%
neg-mul-198.1%
distribute-lft-in98.1%
neg-mul-198.1%
sub-neg98.1%
*-commutative98.1%
associate-*l/98.1%
*-commutative98.1%
associate-*r/98.1%
Simplified98.1%
if -2.8e14 < z < 1Initial program 88.5%
Taylor expanded in z around 0 87.7%
Final simplification92.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.75e+81) (not (<= t 3.8e+54))) (* x (/ t (+ z -1.0))) (/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.75e+81) || !(t <= 3.8e+54)) {
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.75d+81)) .or. (.not. (t <= 3.8d+54))) 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.75e+81) || !(t <= 3.8e+54)) {
tmp = x * (t / (z + -1.0));
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.75e+81) or not (t <= 3.8e+54): 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.75e+81) || !(t <= 3.8e+54)) 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.75e+81) || ~((t <= 3.8e+54))) 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.75e+81], N[Not[LessEqual[t, 3.8e+54]], $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.75 \cdot 10^{+81} \lor \neg \left(t \leq 3.8 \cdot 10^{+54}\right):\\
\;\;\;\;x \cdot \frac{t}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -1.75e81 or 3.8000000000000002e54 < t Initial program 93.4%
clear-num93.2%
associate-/r/93.4%
Applied egg-rr93.4%
Taylor expanded in y around 0 73.8%
neg-mul-173.8%
distribute-frac-neg273.8%
sub-neg73.8%
distribute-neg-in73.8%
metadata-eval73.8%
remove-double-neg73.8%
Simplified73.8%
if -1.75e81 < t < 3.8000000000000002e54Initial program 92.9%
Taylor expanded in y around inf 83.2%
associate-*r/83.1%
Simplified83.1%
clear-num83.0%
un-div-inv83.3%
Applied egg-rr83.3%
Final simplification79.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.55e+81) (not (<= t 1.26e+53))) (* t (/ x (+ z -1.0))) (/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.55e+81) || !(t <= 1.26e+53)) {
tmp = t * (x / (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.55d+81)) .or. (.not. (t <= 1.26d+53))) then
tmp = t * (x / (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.55e+81) || !(t <= 1.26e+53)) {
tmp = t * (x / (z + -1.0));
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.55e+81) or not (t <= 1.26e+53): tmp = t * (x / (z + -1.0)) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.55e+81) || !(t <= 1.26e+53)) tmp = Float64(t * Float64(x / 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.55e+81) || ~((t <= 1.26e+53))) tmp = t * (x / (z + -1.0)); else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.55e+81], N[Not[LessEqual[t, 1.26e+53]], $MachinePrecision]], N[(t * N[(x / 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.55 \cdot 10^{+81} \lor \neg \left(t \leq 1.26 \cdot 10^{+53}\right):\\
\;\;\;\;t \cdot \frac{x}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -1.55e81 or 1.25999999999999999e53 < t Initial program 93.4%
Taylor expanded in y around 0 71.9%
mul-1-neg71.9%
associate-/l*64.3%
distribute-rgt-neg-in64.3%
distribute-neg-frac264.3%
neg-sub064.3%
associate--r-64.3%
metadata-eval64.3%
Simplified64.3%
if -1.55e81 < t < 1.25999999999999999e53Initial program 92.9%
Taylor expanded in y around inf 83.2%
associate-*r/83.1%
Simplified83.1%
clear-num83.0%
un-div-inv83.3%
Applied egg-rr83.3%
Final simplification75.6%
(FPCore (x y z t) :precision binary64 (if (<= z -2.8e+14) (* x (+ (/ y z) (/ t z))) (if (<= z 1.0) (* x (- (/ y z) t)) (* x (/ (+ y t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.8e+14) {
tmp = x * ((y / z) + (t / z));
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} 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) :: tmp
if (z <= (-2.8d+14)) then
tmp = x * ((y / z) + (t / z))
else if (z <= 1.0d0) then
tmp = x * ((y / z) - t)
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 tmp;
if (z <= -2.8e+14) {
tmp = x * ((y / z) + (t / z));
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = x * ((y + t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.8e+14: tmp = x * ((y / z) + (t / z)) elif z <= 1.0: tmp = x * ((y / z) - t) else: tmp = x * ((y + t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.8e+14) tmp = Float64(x * Float64(Float64(y / z) + Float64(t / z))); elseif (z <= 1.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(x * Float64(Float64(y + t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.8e+14) tmp = x * ((y / z) + (t / z)); elseif (z <= 1.0) tmp = x * ((y / z) - t); else tmp = x * ((y + t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.8e+14], N[(x * N[(N[(y / z), $MachinePrecision] + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} + \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y + t}{z}\\
\end{array}
\end{array}
if z < -2.8e14Initial program 98.2%
Taylor expanded in z around inf 98.2%
associate-*r/98.2%
neg-mul-198.2%
Simplified98.2%
sub-neg98.2%
distribute-frac-neg98.2%
remove-double-neg98.2%
Applied egg-rr98.2%
if -2.8e14 < z < 1Initial program 88.5%
Taylor expanded in z around 0 87.7%
if 1 < z Initial program 98.0%
Taylor expanded in z around inf 85.9%
associate-/l*98.0%
sub-neg98.0%
neg-mul-198.0%
remove-double-neg98.0%
neg-mul-198.0%
neg-mul-198.0%
distribute-lft-in98.0%
neg-mul-198.0%
sub-neg98.0%
*-commutative98.0%
associate-*l/98.0%
*-commutative98.0%
associate-*r/98.0%
Simplified98.0%
Final simplification92.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.75e+81) (not (<= t 1.25e+183))) (* x (/ t z)) (/ (* y x) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.75e+81) || !(t <= 1.25e+183)) {
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 <= (-1.75d+81)) .or. (.not. (t <= 1.25d+183))) 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 <= -1.75e+81) || !(t <= 1.25e+183)) {
tmp = x * (t / z);
} else {
tmp = (y * x) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.75e+81) or not (t <= 1.25e+183): tmp = x * (t / z) else: tmp = (y * x) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.75e+81) || !(t <= 1.25e+183)) 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) tmp = 0.0; if ((t <= -1.75e+81) || ~((t <= 1.25e+183))) tmp = x * (t / z); else tmp = (y * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.75e+81], N[Not[LessEqual[t, 1.25e+183]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{+81} \lor \neg \left(t \leq 1.25 \cdot 10^{+183}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}
\end{array}
if t < -1.75e81 or 1.25000000000000002e183 < t Initial program 96.0%
Taylor expanded in z around inf 67.0%
associate-*r/67.0%
neg-mul-167.0%
Simplified67.0%
Taylor expanded in y around 0 58.2%
associate-*l/60.7%
*-commutative60.7%
Simplified60.7%
if -1.75e81 < t < 1.25000000000000002e183Initial program 91.9%
Taylor expanded in y around inf 77.8%
Final simplification72.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.55e+81) (not (<= t 3.3e+183))) (* x (/ t z)) (/ x (/ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.55e+81) || !(t <= 3.3e+183)) {
tmp = x * (t / z);
} else {
tmp = x / (z / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-1.55d+81)) .or. (.not. (t <= 3.3d+183))) then
tmp = x * (t / z)
else
tmp = x / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.55e+81) || !(t <= 3.3e+183)) {
tmp = x * (t / z);
} else {
tmp = x / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.55e+81) or not (t <= 3.3e+183): tmp = x * (t / z) else: tmp = x / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.55e+81) || !(t <= 3.3e+183)) tmp = Float64(x * Float64(t / z)); else tmp = Float64(x / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.55e+81) || ~((t <= 3.3e+183))) tmp = x * (t / z); else tmp = x / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.55e+81], N[Not[LessEqual[t, 3.3e+183]], $MachinePrecision]], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+81} \lor \neg \left(t \leq 3.3 \cdot 10^{+183}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}
\end{array}
if t < -1.55e81 or 3.3000000000000001e183 < t Initial program 96.0%
Taylor expanded in z around inf 67.0%
associate-*r/67.0%
neg-mul-167.0%
Simplified67.0%
Taylor expanded in y around 0 58.2%
associate-*l/60.7%
*-commutative60.7%
Simplified60.7%
if -1.55e81 < t < 3.3000000000000001e183Initial program 91.9%
Taylor expanded in y around inf 77.8%
associate-*r/76.2%
Simplified76.2%
clear-num76.1%
un-div-inv76.9%
Applied egg-rr76.9%
Final simplification72.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.6e+81) (not (<= t 1.25e+183))) (* x (/ t z)) (* (/ y z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.6e+81) || !(t <= 1.25e+183)) {
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.6d+81)) .or. (.not. (t <= 1.25d+183))) 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.6e+81) || !(t <= 1.25e+183)) {
tmp = x * (t / z);
} else {
tmp = (y / z) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.6e+81) or not (t <= 1.25e+183): tmp = x * (t / z) else: tmp = (y / z) * x return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.6e+81) || !(t <= 1.25e+183)) 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.6e+81) || ~((t <= 1.25e+183))) tmp = x * (t / z); else tmp = (y / z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.6e+81], N[Not[LessEqual[t, 1.25e+183]], $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.6 \cdot 10^{+81} \lor \neg \left(t \leq 1.25 \cdot 10^{+183}\right):\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\end{array}
\end{array}
if t < -1.6e81 or 1.25000000000000002e183 < t Initial program 96.0%
Taylor expanded in z around inf 67.0%
associate-*r/67.0%
neg-mul-167.0%
Simplified67.0%
Taylor expanded in y around 0 58.2%
associate-*l/60.7%
*-commutative60.7%
Simplified60.7%
if -1.6e81 < t < 1.25000000000000002e183Initial program 91.9%
Taylor expanded in y around inf 77.8%
associate-*r/76.2%
Simplified76.2%
Final simplification71.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5e-15) (not (<= z 1.0))) (* x (/ t z)) (* x (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5e-15) || !(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 <= (-5d-15)) .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 <= -5e-15) || !(z <= 1.0)) {
tmp = x * (t / z);
} else {
tmp = x * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5e-15) 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 <= -5e-15) || !(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 <= -5e-15) || ~((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, -5e-15], 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 -5 \cdot 10^{-15} \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 < -4.99999999999999999e-15 or 1 < z Initial program 98.2%
Taylor expanded in z around inf 98.0%
associate-*r/98.0%
neg-mul-198.0%
Simplified98.0%
Taylor expanded in y around 0 54.9%
associate-*l/56.4%
*-commutative56.4%
Simplified56.4%
if -4.99999999999999999e-15 < z < 1Initial program 88.0%
Taylor expanded in z around 0 87.2%
Taylor expanded in y around 0 31.5%
associate-*r*31.5%
neg-mul-131.5%
Simplified31.5%
Final simplification44.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.2e-15) (not (<= z 1.0))) (* t (/ x z)) (* x (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.2e-15) || !(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 <= (-7.2d-15)) .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 <= -7.2e-15) || !(z <= 1.0)) {
tmp = t * (x / z);
} else {
tmp = x * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.2e-15) 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 <= -7.2e-15) || !(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 <= -7.2e-15) || ~((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, -7.2e-15], 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 -7.2 \cdot 10^{-15} \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 < -7.2000000000000002e-15 or 1 < z Initial program 98.2%
Taylor expanded in z around inf 98.0%
associate-*r/98.0%
neg-mul-198.0%
Simplified98.0%
Taylor expanded in y around 0 54.9%
associate-/l*48.8%
Simplified48.8%
if -7.2000000000000002e-15 < z < 1Initial program 88.0%
Taylor expanded in z around 0 87.2%
Taylor expanded in y around 0 31.5%
associate-*r*31.5%
neg-mul-131.5%
Simplified31.5%
Final simplification40.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.12e+67) (* t x) (* x (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.12e+67) {
tmp = t * x;
} 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 (y <= (-1.12d+67)) then
tmp = t * x
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 (y <= -1.12e+67) {
tmp = t * x;
} else {
tmp = x * -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.12e+67: tmp = t * x else: tmp = x * -t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.12e+67) tmp = Float64(t * x); else tmp = Float64(x * Float64(-t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.12e+67) tmp = t * x; else tmp = x * -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.12e+67], N[(t * x), $MachinePrecision], N[(x * (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{+67}:\\
\;\;\;\;t \cdot x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-t\right)\\
\end{array}
\end{array}
if y < -1.12e67Initial program 82.0%
Taylor expanded in z around 0 66.4%
Taylor expanded in y around 0 2.5%
associate-*r*2.5%
neg-mul-12.5%
Simplified2.5%
add-sqr-sqrt1.5%
sqrt-unprod5.3%
sqr-neg5.3%
sqrt-unprod3.9%
add-sqr-sqrt13.7%
pow113.7%
*-commutative13.7%
Applied egg-rr13.7%
unpow113.7%
*-commutative13.7%
Simplified13.7%
if -1.12e67 < y Initial program 95.0%
Taylor expanded in z around 0 63.6%
Taylor expanded in y around 0 25.3%
associate-*r*25.3%
neg-mul-125.3%
Simplified25.3%
Final simplification23.6%
(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 * 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 x
\end{array}
Initial program 93.1%
Taylor expanded in z around 0 64.0%
Taylor expanded in y around 0 22.0%
associate-*r*22.0%
neg-mul-122.0%
Simplified22.0%
add-sqr-sqrt11.8%
sqrt-unprod14.2%
sqr-neg14.2%
sqrt-unprod4.5%
add-sqr-sqrt9.0%
pow19.0%
*-commutative9.0%
Applied egg-rr9.0%
unpow19.0%
*-commutative9.0%
Simplified9.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))))
(t_2 (* x (- (/ y z) (/ t (- 1.0 z))))))
(if (< t_2 -7.623226303312042e-196)
t_1
(if (< t_2 1.4133944927702302e-211)
(+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z))))
t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * ((y / z) - (t * (1.0d0 / (1.0d0 - z))))
t_2 = x * ((y / z) - (t / (1.0d0 - z)))
if (t_2 < (-7.623226303312042d-196)) then
tmp = t_1
else if (t_2 < 1.4133944927702302d-211) then
tmp = ((y * x) / z) + -((t * x) / (1.0d0 - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
double t_2 = x * ((y / z) - (t / (1.0 - z)));
double tmp;
if (t_2 < -7.623226303312042e-196) {
tmp = t_1;
} else if (t_2 < 1.4133944927702302e-211) {
tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))) t_2 = x * ((y / z) - (t / (1.0 - z))) tmp = 0 if t_2 < -7.623226303312042e-196: tmp = t_1 elif t_2 < 1.4133944927702302e-211: tmp = ((y * x) / z) + -((t * x) / (1.0 - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y / z) - Float64(t * Float64(1.0 / Float64(1.0 - z))))) t_2 = Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) tmp = 0.0 if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = Float64(Float64(Float64(y * x) / z) + Float64(-Float64(Float64(t * x) / Float64(1.0 - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z)))); t_2 = x * ((y / z) - (t / (1.0 - z))); tmp = 0.0; if (t_2 < -7.623226303312042e-196) tmp = t_1; elseif (t_2 < 1.4133944927702302e-211) tmp = ((y * x) / z) + -((t * x) / (1.0 - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t * N[(1.0 / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -7.623226303312042e-196], t$95$1, If[Less[t$95$2, 1.4133944927702302e-211], N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] + (-N[(N[(t * x), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\
t_2 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\
\mathbf{if}\;t\_2 < -7.623226303312042 \cdot 10^{-196}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 < 1.4133944927702302 \cdot 10^{-211}:\\
\;\;\;\;\frac{y \cdot x}{z} + \left(-\frac{t \cdot x}{1 - z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024116
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:alt
(! :herbie-platform default (if (< (* x (- (/ y z) (/ t (- 1 z)))) -3811613151656021/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* x (- (/ y z) (* t (/ 1 (- 1 z))))) (if (< (* x (- (/ y z) (/ t (- 1 z)))) 7066972463851151/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (/ (* y x) z) (- (/ (* t x) (- 1 z)))) (* x (- (/ y z) (* t (/ 1 (- 1 z))))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))