
(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 z) (/ t (- 1.0 z)))))
(if (<= t_1 (- INFINITY))
(* y (/ x z))
(if (<= t_1 2e+297) (* t_1 x) (/ (* y x) z)))))
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)) {
tmp = y * (x / z);
} else if (t_1 <= 2e+297) {
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 / (1.0 - z));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y * (x / z);
} else if (t_1 <= 2e+297) {
tmp = t_1 * x;
} else {
tmp = (y * x) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) - (t / (1.0 - z)) tmp = 0 if t_1 <= -math.inf: tmp = y * (x / z) elif t_1 <= 2e+297: 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(1.0 - z))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(y * Float64(x / z)); elseif (t_1 <= 2e+297) tmp = Float64(t_1 * x); else tmp = Float64(Float64(y * x) / z); 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) tmp = y * (x / z); elseif (t_1 <= 2e+297) 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[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+297], N[(t$95$1 * x), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+297}:\\
\;\;\;\;t\_1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0Initial program 59.5%
Taylor expanded in y around inf
/-lowering-/.f6459.5%
Simplified59.5%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f6499.9%
Applied egg-rr99.9%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 2e297Initial program 99.4%
if 2e297 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 75.6%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* y x) z)))
(if (<= y -9.5e+16)
t_1
(if (<= y 3.05e-176)
(* t (/ x (+ z -1.0)))
(if (<= y 7.2e+71) (* x (- (/ y z) t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y * x) / z;
double tmp;
if (y <= -9.5e+16) {
tmp = t_1;
} else if (y <= 3.05e-176) {
tmp = t * (x / (z + -1.0));
} else if (y <= 7.2e+71) {
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 = (y * x) / z
if (y <= (-9.5d+16)) then
tmp = t_1
else if (y <= 3.05d-176) then
tmp = t * (x / (z + (-1.0d0)))
else if (y <= 7.2d+71) 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 = (y * x) / z;
double tmp;
if (y <= -9.5e+16) {
tmp = t_1;
} else if (y <= 3.05e-176) {
tmp = t * (x / (z + -1.0));
} else if (y <= 7.2e+71) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * x) / z tmp = 0 if y <= -9.5e+16: tmp = t_1 elif y <= 3.05e-176: tmp = t * (x / (z + -1.0)) elif y <= 7.2e+71: tmp = x * ((y / z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * x) / z) tmp = 0.0 if (y <= -9.5e+16) tmp = t_1; elseif (y <= 3.05e-176) tmp = Float64(t * Float64(x / Float64(z + -1.0))); elseif (y <= 7.2e+71) 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 = (y * x) / z; tmp = 0.0; if (y <= -9.5e+16) tmp = t_1; elseif (y <= 3.05e-176) tmp = t * (x / (z + -1.0)); elseif (y <= 7.2e+71) 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[(y * x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -9.5e+16], t$95$1, If[LessEqual[y, 3.05e-176], N[(t * N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+71], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot x}{z}\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.05 \cdot 10^{-176}:\\
\;\;\;\;t \cdot \frac{x}{z + -1}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+71}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.5e16 or 7.1999999999999999e71 < y Initial program 88.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f6483.3%
Simplified83.3%
if -9.5e16 < y < 3.0500000000000001e-176Initial program 98.9%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
neg-sub0N/A
--lowering--.f64N/A
--lowering--.f6472.6%
Simplified72.6%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6473.8%
Applied egg-rr73.8%
if 3.0500000000000001e-176 < y < 7.1999999999999999e71Initial program 99.9%
Taylor expanded in z around 0
Simplified81.1%
Final simplification79.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (/ x (+ z -1.0)))))
(if (<= t -5.5e+70)
t_1
(if (<= t 8.8e-85)
(/ x (/ z y))
(if (<= t 1.65e+176) (/ (* y x) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = t * (x / (z + -1.0));
double tmp;
if (t <= -5.5e+70) {
tmp = t_1;
} else if (t <= 8.8e-85) {
tmp = x / (z / y);
} else if (t <= 1.65e+176) {
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 = t * (x / (z + (-1.0d0)))
if (t <= (-5.5d+70)) then
tmp = t_1
else if (t <= 8.8d-85) then
tmp = x / (z / y)
else if (t <= 1.65d+176) 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 = t * (x / (z + -1.0));
double tmp;
if (t <= -5.5e+70) {
tmp = t_1;
} else if (t <= 8.8e-85) {
tmp = x / (z / y);
} else if (t <= 1.65e+176) {
tmp = (y * x) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (x / (z + -1.0)) tmp = 0 if t <= -5.5e+70: tmp = t_1 elif t <= 8.8e-85: tmp = x / (z / y) elif t <= 1.65e+176: tmp = (y * x) / z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(x / Float64(z + -1.0))) tmp = 0.0 if (t <= -5.5e+70) tmp = t_1; elseif (t <= 8.8e-85) tmp = Float64(x / Float64(z / y)); elseif (t <= 1.65e+176) tmp = Float64(Float64(y * x) / z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (x / (z + -1.0)); tmp = 0.0; if (t <= -5.5e+70) tmp = t_1; elseif (t <= 8.8e-85) tmp = x / (z / y); elseif (t <= 1.65e+176) tmp = (y * x) / z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.5e+70], t$95$1, If[LessEqual[t, 8.8e-85], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.65e+176], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{x}{z + -1}\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{-85}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{+176}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.49999999999999986e70 or 1.65000000000000012e176 < t Initial program 97.3%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
neg-sub0N/A
--lowering--.f64N/A
--lowering--.f6468.9%
Simplified68.9%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
associate--r-N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6470.9%
Applied egg-rr70.9%
if -5.49999999999999986e70 < t < 8.8e-85Initial program 94.3%
Taylor expanded in y around inf
/-lowering-/.f6486.5%
Simplified86.5%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6487.2%
Applied egg-rr87.2%
if 8.8e-85 < t < 1.65000000000000012e176Initial program 89.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f6473.2%
Simplified73.2%
Final simplification78.7%
(FPCore (x y z t)
:precision binary64
(if (<= t -2.8e+71)
(* x (/ t z))
(if (<= t 3.3e+105)
(/ x (/ z y))
(if (<= t 3.3e+202) (* y (/ x z)) (/ x (/ z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.8e+71) {
tmp = x * (t / z);
} else if (t <= 3.3e+105) {
tmp = x / (z / y);
} else if (t <= 3.3e+202) {
tmp = y * (x / z);
} 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) :: tmp
if (t <= (-2.8d+71)) then
tmp = x * (t / z)
else if (t <= 3.3d+105) then
tmp = x / (z / y)
else if (t <= 3.3d+202) then
tmp = y * (x / z)
else
tmp = x / (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.8e+71) {
tmp = x * (t / z);
} else if (t <= 3.3e+105) {
tmp = x / (z / y);
} else if (t <= 3.3e+202) {
tmp = y * (x / z);
} else {
tmp = x / (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.8e+71: tmp = x * (t / z) elif t <= 3.3e+105: tmp = x / (z / y) elif t <= 3.3e+202: tmp = y * (x / z) else: tmp = x / (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.8e+71) tmp = Float64(x * Float64(t / z)); elseif (t <= 3.3e+105) tmp = Float64(x / Float64(z / y)); elseif (t <= 3.3e+202) tmp = Float64(y * Float64(x / z)); else tmp = Float64(x / Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.8e+71) tmp = x * (t / z); elseif (t <= 3.3e+105) tmp = x / (z / y); elseif (t <= 3.3e+202) tmp = y * (x / z); else tmp = x / (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.8e+71], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e+105], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e+202], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+71}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{+105}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{+202}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\end{array}
\end{array}
if t < -2.80000000000000002e71Initial program 97.6%
Taylor expanded in z around inf
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6474.3%
Simplified74.3%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6459.3%
Simplified59.3%
if -2.80000000000000002e71 < t < 3.29999999999999997e105Initial program 93.5%
Taylor expanded in y around inf
/-lowering-/.f6482.4%
Simplified82.4%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6483.0%
Applied egg-rr83.0%
if 3.29999999999999997e105 < t < 3.2999999999999999e202Initial program 81.8%
Taylor expanded in y around inf
/-lowering-/.f6440.7%
Simplified40.7%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f6463.4%
Applied egg-rr63.4%
if 3.2999999999999999e202 < t Initial program 99.8%
Taylor expanded in z around inf
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6467.0%
Simplified67.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6464.1%
Simplified64.1%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6464.2%
Applied egg-rr64.2%
Final simplification75.1%
(FPCore (x y z t) :precision binary64 (if (<= z -5.9e-13) (/ x (/ z (+ y t))) (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 <= -5.9e-13) {
tmp = x / (z / (y + t));
} 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 <= (-5.9d-13)) then
tmp = x / (z / (y + t))
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 <= -5.9e-13) {
tmp = x / (z / (y + t));
} 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 <= -5.9e-13: tmp = x / (z / (y + t)) 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 <= -5.9e-13) tmp = Float64(x / Float64(z / Float64(y + t))); 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 <= -5.9e-13) tmp = x / (z / (y + t)); 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, -5.9e-13], N[(x / N[(z / N[(y + t), $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 -5.9 \cdot 10^{-13}:\\
\;\;\;\;\frac{x}{\frac{z}{y + t}}\\
\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 < -5.9000000000000001e-13Initial program 96.9%
Taylor expanded in z around inf
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6494.5%
Simplified94.5%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6494.8%
Applied egg-rr94.8%
if -5.9000000000000001e-13 < z < 1Initial program 89.2%
Taylor expanded in z around 0
Simplified88.8%
if 1 < z Initial program 99.7%
Taylor expanded in z around inf
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6498.8%
Simplified98.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ (+ y t) z)))) (if (<= z -145.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 <= -145.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 <= (-145.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 <= -145.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 <= -145.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(x * Float64(Float64(y + t) / z)) tmp = 0.0 if (z <= -145.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 <= -145.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[(x * N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -145.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 := x \cdot \frac{y + t}{z}\\
\mathbf{if}\;z \leq -145:\\
\;\;\;\;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 < -145 or 1 < z Initial program 99.1%
Taylor expanded in z around inf
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6498.3%
Simplified98.3%
if -145 < z < 1Initial program 89.0%
Taylor expanded in z around 0
Simplified87.8%
(FPCore (x y z t) :precision binary64 (if (<= t -1.02e+72) (* x (/ t z)) (if (<= t 3.5e+202) (* y (/ x z)) (/ x (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.02e+72) {
tmp = x * (t / z);
} else if (t <= 3.5e+202) {
tmp = y * (x / z);
} 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) :: tmp
if (t <= (-1.02d+72)) then
tmp = x * (t / z)
else if (t <= 3.5d+202) then
tmp = y * (x / z)
else
tmp = x / (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.02e+72) {
tmp = x * (t / z);
} else if (t <= 3.5e+202) {
tmp = y * (x / z);
} else {
tmp = x / (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.02e+72: tmp = x * (t / z) elif t <= 3.5e+202: tmp = y * (x / z) else: tmp = x / (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.02e+72) tmp = Float64(x * Float64(t / z)); elseif (t <= 3.5e+202) tmp = Float64(y * Float64(x / z)); else tmp = Float64(x / Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.02e+72) tmp = x * (t / z); elseif (t <= 3.5e+202) tmp = y * (x / z); else tmp = x / (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.02e+72], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e+202], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.02 \cdot 10^{+72}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+202}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\end{array}
\end{array}
if t < -1.02e72Initial program 97.6%
Taylor expanded in z around inf
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6474.3%
Simplified74.3%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6459.3%
Simplified59.3%
if -1.02e72 < t < 3.49999999999999987e202Initial program 92.2%
Taylor expanded in y around inf
/-lowering-/.f6477.6%
Simplified77.6%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f6478.3%
Applied egg-rr78.3%
if 3.49999999999999987e202 < t Initial program 99.8%
Taylor expanded in z around inf
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6467.0%
Simplified67.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6464.1%
Simplified64.1%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6464.2%
Applied egg-rr64.2%
Final simplification73.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ t z)))) (if (<= t -3.9e+71) t_1 (if (<= t 3.25e+202) (* 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 <= -3.9e+71) {
tmp = t_1;
} else if (t <= 3.25e+202) {
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 <= (-3.9d+71)) then
tmp = t_1
else if (t <= 3.25d+202) 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 <= -3.9e+71) {
tmp = t_1;
} else if (t <= 3.25e+202) {
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 <= -3.9e+71: tmp = t_1 elif t <= 3.25e+202: 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 <= -3.9e+71) tmp = t_1; elseif (t <= 3.25e+202) 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 <= -3.9e+71) tmp = t_1; elseif (t <= 3.25e+202) 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, -3.9e+71], t$95$1, If[LessEqual[t, 3.25e+202], 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 -3.9 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.25 \cdot 10^{+202}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.9000000000000001e71 or 3.2499999999999998e202 < t Initial program 98.5%
Taylor expanded in z around inf
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6471.3%
Simplified71.3%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6461.3%
Simplified61.3%
if -3.9000000000000001e71 < t < 3.2499999999999998e202Initial program 92.2%
Taylor expanded in y around inf
/-lowering-/.f6477.6%
Simplified77.6%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f6478.3%
Applied egg-rr78.3%
Final simplification73.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ t z)))) (if (<= t -9.5e+71) t_1 (if (<= t 5.1e+169) (* (/ 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 <= -9.5e+71) {
tmp = t_1;
} else if (t <= 5.1e+169) {
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 <= (-9.5d+71)) then
tmp = t_1
else if (t <= 5.1d+169) 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 <= -9.5e+71) {
tmp = t_1;
} else if (t <= 5.1e+169) {
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 <= -9.5e+71: tmp = t_1 elif t <= 5.1e+169: 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 <= -9.5e+71) tmp = t_1; elseif (t <= 5.1e+169) 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 <= -9.5e+71) tmp = t_1; elseif (t <= 5.1e+169) 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, -9.5e+71], t$95$1, If[LessEqual[t, 5.1e+169], 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 -9.5 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.1 \cdot 10^{+169}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.50000000000000015e71 or 5.10000000000000008e169 < t Initial program 97.3%
Taylor expanded in z around inf
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6470.4%
Simplified70.4%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6459.6%
Simplified59.6%
if -9.50000000000000015e71 < t < 5.10000000000000008e169Initial program 92.6%
Taylor expanded in y around inf
/-lowering-/.f6478.8%
Simplified78.8%
Final simplification72.9%
(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 94.0%
Taylor expanded in z around inf
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6474.5%
Simplified74.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6435.3%
Simplified35.3%
(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 2024138
(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)))))