
(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 10 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 (/ x z))) (t_2 (+ (/ y z) (/ t (+ z -1.0))))) (if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 4e+296) (* t_2 x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * (x / z);
double t_2 = (y / z) + (t / (z + -1.0));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 4e+296) {
tmp = t_2 * x;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = y * (x / z);
double t_2 = (y / z) + (t / (z + -1.0));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= 4e+296) {
tmp = t_2 * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (x / z) t_2 = (y / z) + (t / (z + -1.0)) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= 4e+296: tmp = t_2 * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(x / z)) t_2 = Float64(Float64(y / z) + Float64(t / Float64(z + -1.0))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 4e+296) tmp = Float64(t_2 * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (x / z); t_2 = (y / z) + (t / (z + -1.0)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= 4e+296) tmp = t_2 * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 4e+296], N[(t$95$2 * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{x}{z}\\
t_2 := \frac{y}{z} + \frac{t}{z + -1}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+296}:\\
\;\;\;\;t\_2 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0 or 3.99999999999999993e296 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 63.7%
Taylor expanded in y around inf
/-lowering-/.f6463.7%
Simplified63.7%
div-invN/A
*-commutativeN/A
associate-*r*N/A
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f6499.8%
Applied egg-rr99.8%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 3.99999999999999993e296Initial program 98.7%
Final simplification98.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ (+ z -1.0) t))))
(if (<= t -2.4e+94)
t_1
(if (<= t -1e-246) (* (/ y z) x) (if (<= t 230.0) (* y (/ x z)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / ((z + -1.0) / t);
double tmp;
if (t <= -2.4e+94) {
tmp = t_1;
} else if (t <= -1e-246) {
tmp = (y / z) * x;
} else if (t <= 230.0) {
tmp = y * (x / 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) :: tmp
t_1 = x / ((z + (-1.0d0)) / t)
if (t <= (-2.4d+94)) then
tmp = t_1
else if (t <= (-1d-246)) then
tmp = (y / z) * x
else if (t <= 230.0d0) then
tmp = y * (x / 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 / ((z + -1.0) / t);
double tmp;
if (t <= -2.4e+94) {
tmp = t_1;
} else if (t <= -1e-246) {
tmp = (y / z) * x;
} else if (t <= 230.0) {
tmp = y * (x / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / ((z + -1.0) / t) tmp = 0 if t <= -2.4e+94: tmp = t_1 elif t <= -1e-246: tmp = (y / z) * x elif t <= 230.0: tmp = y * (x / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(z + -1.0) / t)) tmp = 0.0 if (t <= -2.4e+94) tmp = t_1; elseif (t <= -1e-246) tmp = Float64(Float64(y / z) * x); elseif (t <= 230.0) tmp = Float64(y * Float64(x / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / ((z + -1.0) / t); tmp = 0.0; if (t <= -2.4e+94) tmp = t_1; elseif (t <= -1e-246) tmp = (y / z) * x; elseif (t <= 230.0) tmp = y * (x / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(z + -1.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.4e+94], t$95$1, If[LessEqual[t, -1e-246], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 230.0], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{z + -1}{t}}\\
\mathbf{if}\;t \leq -2.4 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1 \cdot 10^{-246}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 230:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.39999999999999983e94 or 230 < t Initial program 93.7%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
+-lowering-+.f6473.0%
Simplified73.0%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
Applied egg-rr73.0%
if -2.39999999999999983e94 < t < -9.99999999999999956e-247Initial program 98.4%
Taylor expanded in y around inf
/-lowering-/.f6490.0%
Simplified90.0%
if -9.99999999999999956e-247 < t < 230Initial program 87.2%
Taylor expanded in y around inf
/-lowering-/.f6477.9%
Simplified77.9%
div-invN/A
*-commutativeN/A
associate-*r*N/A
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f6484.1%
Applied egg-rr84.1%
Final simplification80.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t (+ z -1.0)))))
(if (<= t -6.6e+93)
t_1
(if (<= t -1.1e-247) (* (/ y z) x) (if (<= t 10.6) (* y (/ x z)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / (z + -1.0));
double tmp;
if (t <= -6.6e+93) {
tmp = t_1;
} else if (t <= -1.1e-247) {
tmp = (y / z) * x;
} else if (t <= 10.6) {
tmp = y * (x / 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) :: tmp
t_1 = x * (t / (z + (-1.0d0)))
if (t <= (-6.6d+93)) then
tmp = t_1
else if (t <= (-1.1d-247)) then
tmp = (y / z) * x
else if (t <= 10.6d0) then
tmp = y * (x / 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 * (t / (z + -1.0));
double tmp;
if (t <= -6.6e+93) {
tmp = t_1;
} else if (t <= -1.1e-247) {
tmp = (y / z) * x;
} else if (t <= 10.6) {
tmp = y * (x / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / (z + -1.0)) tmp = 0 if t <= -6.6e+93: tmp = t_1 elif t <= -1.1e-247: tmp = (y / z) * x elif t <= 10.6: tmp = y * (x / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / Float64(z + -1.0))) tmp = 0.0 if (t <= -6.6e+93) tmp = t_1; elseif (t <= -1.1e-247) tmp = Float64(Float64(y / z) * x); elseif (t <= 10.6) tmp = Float64(y * Float64(x / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / (z + -1.0)); tmp = 0.0; if (t <= -6.6e+93) tmp = t_1; elseif (t <= -1.1e-247) tmp = (y / z) * x; elseif (t <= 10.6) tmp = y * (x / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.6e+93], t$95$1, If[LessEqual[t, -1.1e-247], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 10.6], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z + -1}\\
\mathbf{if}\;t \leq -6.6 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.1 \cdot 10^{-247}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 10.6:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.60000000000000017e93 or 10.5999999999999996 < t Initial program 93.7%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
+-lowering-+.f6473.0%
Simplified73.0%
if -6.60000000000000017e93 < t < -1.09999999999999996e-247Initial program 98.4%
Taylor expanded in y around inf
/-lowering-/.f6490.0%
Simplified90.0%
if -1.09999999999999996e-247 < t < 10.5999999999999996Initial program 87.2%
Taylor expanded in y around inf
/-lowering-/.f6477.9%
Simplified77.9%
div-invN/A
*-commutativeN/A
associate-*r*N/A
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f6484.1%
Applied egg-rr84.1%
Final simplification80.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ z t))))
(if (<= t -3.2e+115)
t_1
(if (<= t -2.3e-248)
(* (/ y z) x)
(if (<= t 7.8e+70) (* y (/ x z)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (z / t);
double tmp;
if (t <= -3.2e+115) {
tmp = t_1;
} else if (t <= -2.3e-248) {
tmp = (y / z) * x;
} else if (t <= 7.8e+70) {
tmp = y * (x / 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) :: tmp
t_1 = x / (z / t)
if (t <= (-3.2d+115)) then
tmp = t_1
else if (t <= (-2.3d-248)) then
tmp = (y / z) * x
else if (t <= 7.8d+70) then
tmp = y * (x / 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 / (z / t);
double tmp;
if (t <= -3.2e+115) {
tmp = t_1;
} else if (t <= -2.3e-248) {
tmp = (y / z) * x;
} else if (t <= 7.8e+70) {
tmp = y * (x / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z / t) tmp = 0 if t <= -3.2e+115: tmp = t_1 elif t <= -2.3e-248: tmp = (y / z) * x elif t <= 7.8e+70: tmp = y * (x / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z / t)) tmp = 0.0 if (t <= -3.2e+115) tmp = t_1; elseif (t <= -2.3e-248) tmp = Float64(Float64(y / z) * x); elseif (t <= 7.8e+70) tmp = Float64(y * Float64(x / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z / t); tmp = 0.0; if (t <= -3.2e+115) tmp = t_1; elseif (t <= -2.3e-248) tmp = (y / z) * x; elseif (t <= 7.8e+70) tmp = y * (x / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.2e+115], t$95$1, If[LessEqual[t, -2.3e-248], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 7.8e+70], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{z}{t}}\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.3 \cdot 10^{-248}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{+70}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.2e115 or 7.79999999999999949e70 < t Initial program 94.7%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
+-lowering-+.f6474.1%
Simplified74.1%
Taylor expanded in z around inf
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6455.6%
Simplified55.6%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6455.7%
Applied egg-rr55.7%
if -3.2e115 < t < -2.3e-248Initial program 98.5%
Taylor expanded in y around inf
/-lowering-/.f6487.7%
Simplified87.7%
if -2.3e-248 < t < 7.79999999999999949e70Initial program 86.6%
Taylor expanded in y around inf
/-lowering-/.f6473.0%
Simplified73.0%
div-invN/A
*-commutativeN/A
associate-*r*N/A
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f6480.6%
Applied egg-rr80.6%
Final simplification73.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ t z))))
(if (<= t -6.6e+117)
t_1
(if (<= t -7.5e-249)
(* (/ y z) x)
(if (<= t 7.2e+68) (* y (/ x z)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -6.6e+117) {
tmp = t_1;
} else if (t <= -7.5e-249) {
tmp = (y / z) * x;
} else if (t <= 7.2e+68) {
tmp = y * (x / 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) :: tmp
t_1 = x * (t / z)
if (t <= (-6.6d+117)) then
tmp = t_1
else if (t <= (-7.5d-249)) then
tmp = (y / z) * x
else if (t <= 7.2d+68) then
tmp = y * (x / 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 * (t / z);
double tmp;
if (t <= -6.6e+117) {
tmp = t_1;
} else if (t <= -7.5e-249) {
tmp = (y / z) * x;
} else if (t <= 7.2e+68) {
tmp = y * (x / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -6.6e+117: tmp = t_1 elif t <= -7.5e-249: tmp = (y / z) * x elif t <= 7.2e+68: tmp = y * (x / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -6.6e+117) tmp = t_1; elseif (t <= -7.5e-249) tmp = Float64(Float64(y / z) * x); elseif (t <= 7.2e+68) tmp = Float64(y * Float64(x / z)); 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 <= -6.6e+117) tmp = t_1; elseif (t <= -7.5e-249) tmp = (y / z) * x; elseif (t <= 7.2e+68) tmp = y * (x / z); 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, -6.6e+117], t$95$1, If[LessEqual[t, -7.5e-249], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 7.2e+68], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -6.6 \cdot 10^{+117}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{-249}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+68}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.5999999999999996e117 or 7.1999999999999998e68 < t Initial program 94.7%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
+-lowering-+.f6474.1%
Simplified74.1%
Taylor expanded in z around inf
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6455.6%
Simplified55.6%
if -6.5999999999999996e117 < t < -7.50000000000000034e-249Initial program 98.5%
Taylor expanded in y around inf
/-lowering-/.f6487.7%
Simplified87.7%
if -7.50000000000000034e-249 < t < 7.1999999999999998e68Initial program 86.6%
Taylor expanded in y around inf
/-lowering-/.f6473.0%
Simplified73.0%
div-invN/A
*-commutativeN/A
associate-*r*N/A
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f6480.6%
Applied egg-rr80.6%
Final simplification73.2%
(FPCore (x y z t) :precision binary64 (if (<= z -165000.0) (/ (* x (+ y t)) z) (if (<= z 1.0) (* x (- (/ y z) t)) (/ (/ x (/ 1.0 (+ y t))) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -165000.0) {
tmp = (x * (y + t)) / z;
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = (x / (1.0 / (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 <= (-165000.0d0)) then
tmp = (x * (y + t)) / z
else if (z <= 1.0d0) then
tmp = x * ((y / z) - t)
else
tmp = (x / (1.0d0 / (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 <= -165000.0) {
tmp = (x * (y + t)) / z;
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = (x / (1.0 / (y + t))) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -165000.0: tmp = (x * (y + t)) / z elif z <= 1.0: tmp = x * ((y / z) - t) else: tmp = (x / (1.0 / (y + t))) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -165000.0) tmp = Float64(Float64(x * Float64(y + t)) / z); elseif (z <= 1.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(Float64(x / Float64(1.0 / Float64(y + t))) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -165000.0) tmp = (x * (y + t)) / z; elseif (z <= 1.0) tmp = x * ((y / z) - t); else tmp = (x / (1.0 / (y + t))) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -165000.0], N[(N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -165000:\\
\;\;\;\;\frac{x \cdot \left(y + t\right)}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\frac{1}{y + t}}}{z}\\
\end{array}
\end{array}
if z < -165000Initial program 98.1%
Taylor expanded in z around inf
*-commutativeN/A
remove-double-negN/A
neg-mul-1N/A
distribute-lft-out--N/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
/-lowering-/.f64N/A
Simplified79.6%
if -165000 < z < 1Initial program 87.9%
Taylor expanded in z around 0
Simplified86.8%
if 1 < z Initial program 97.7%
Taylor expanded in z around inf
*-commutativeN/A
remove-double-negN/A
neg-mul-1N/A
distribute-lft-out--N/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
/-lowering-/.f64N/A
Simplified83.4%
flip-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
+-lowering-+.f6483.5%
Applied egg-rr83.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* x (+ y t)) z))) (if (<= z -165000.0) t_1 (if (<= z 1.0) (* x (- (/ y z) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x * (y + t)) / z;
double tmp;
if (z <= -165000.0) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} 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 * (y + t)) / z
if (z <= (-165000.0d0)) then
tmp = t_1
else if (z <= 1.0d0) then
tmp = x * ((y / z) - t)
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 + t)) / z;
double tmp;
if (z <= -165000.0) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * (y + t)) / z tmp = 0 if z <= -165000.0: tmp = t_1 elif z <= 1.0: tmp = x * ((y / z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(y + t)) / z) tmp = 0.0 if (z <= -165000.0) tmp = t_1; elseif (z <= 1.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * (y + t)) / z; tmp = 0.0; if (z <= -165000.0) tmp = t_1; elseif (z <= 1.0) tmp = x * ((y / z) - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -165000.0], t$95$1, If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(y + t\right)}{z}\\
\mathbf{if}\;z \leq -165000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -165000 or 1 < z Initial program 97.9%
Taylor expanded in z around inf
*-commutativeN/A
remove-double-negN/A
neg-mul-1N/A
distribute-lft-out--N/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
/-lowering-/.f64N/A
Simplified81.5%
if -165000 < z < 1Initial program 87.9%
Taylor expanded in z around 0
Simplified86.8%
(FPCore (x y z t) :precision binary64 (if (<= z -3.1e+149) (/ x (/ z t)) (if (<= z 2.7e+16) (* x (- (/ y z) t)) (* x (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.1e+149) {
tmp = x / (z / t);
} else if (z <= 2.7e+16) {
tmp = x * ((y / z) - t);
} else {
tmp = x * (t / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-3.1d+149)) then
tmp = x / (z / t)
else if (z <= 2.7d+16) then
tmp = x * ((y / z) - t)
else
tmp = x * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.1e+149) {
tmp = x / (z / t);
} else if (z <= 2.7e+16) {
tmp = x * ((y / z) - t);
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.1e+149: tmp = x / (z / t) elif z <= 2.7e+16: tmp = x * ((y / z) - t) else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.1e+149) tmp = Float64(x / Float64(z / t)); elseif (z <= 2.7e+16) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.1e+149) tmp = x / (z / t); elseif (z <= 2.7e+16) tmp = x * ((y / z) - t); else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.1e+149], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e+16], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+149}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+16}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if z < -3.09999999999999987e149Initial program 97.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
+-lowering-+.f6466.2%
Simplified66.2%
Taylor expanded in z around inf
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6466.2%
Simplified66.2%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6466.3%
Applied egg-rr66.3%
if -3.09999999999999987e149 < z < 2.7e16Initial program 90.2%
Taylor expanded in z around 0
Simplified80.9%
if 2.7e16 < z Initial program 97.6%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
+-lowering-+.f6461.8%
Simplified61.8%
Taylor expanded in z around inf
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6461.8%
Simplified61.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ t z)))) (if (<= t -1.05e+119) t_1 (if (<= t 1.02e+54) (* (/ 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 <= -1.05e+119) {
tmp = t_1;
} else if (t <= 1.02e+54) {
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 <= (-1.05d+119)) then
tmp = t_1
else if (t <= 1.02d+54) 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 <= -1.05e+119) {
tmp = t_1;
} else if (t <= 1.02e+54) {
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 <= -1.05e+119: tmp = t_1 elif t <= 1.02e+54: 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 <= -1.05e+119) tmp = t_1; elseif (t <= 1.02e+54) 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 <= -1.05e+119) tmp = t_1; elseif (t <= 1.02e+54) 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, -1.05e+119], t$95$1, If[LessEqual[t, 1.02e+54], 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 -1.05 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{+54}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.04999999999999991e119 or 1.02e54 < t Initial program 94.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
+-lowering-+.f6473.9%
Simplified73.9%
Taylor expanded in z around inf
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6454.2%
Simplified54.2%
if -1.04999999999999991e119 < t < 1.02e54Initial program 92.3%
Taylor expanded in y around inf
/-lowering-/.f6481.0%
Simplified81.0%
Final simplification70.6%
(FPCore (x y z t) :precision binary64 (* x (/ t z)))
double code(double x, double y, double z, double t) {
return x * (t / 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 * (t / z)
end function
public static double code(double x, double y, double z, double t) {
return x * (t / z);
}
def code(x, y, z, t): return x * (t / z)
function code(x, y, z, t) return Float64(x * Float64(t / z)) end
function tmp = code(x, y, z, t) tmp = x * (t / z); end
code[x_, y_, z_, t_] := N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{t}{z}
\end{array}
Initial program 92.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
+-lowering-+.f6443.0%
Simplified43.0%
Taylor expanded in z around inf
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6434.0%
Simplified34.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 2024185
(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)))))