
(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 (+ z -1.0))))) (if (<= t_1 -5e+282) (* y (/ x z)) (* t_1 x))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) + (t / (z + -1.0));
double tmp;
if (t_1 <= -5e+282) {
tmp = y * (x / z);
} else {
tmp = t_1 * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y / z) + (t / (z + (-1.0d0)))
if (t_1 <= (-5d+282)) then
tmp = y * (x / z)
else
tmp = t_1 * x
end if
code = tmp
end function
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 <= -5e+282) {
tmp = y * (x / z);
} else {
tmp = t_1 * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) + (t / (z + -1.0)) tmp = 0 if t_1 <= -5e+282: tmp = y * (x / z) else: tmp = t_1 * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) + Float64(t / Float64(z + -1.0))) tmp = 0.0 if (t_1 <= -5e+282) tmp = Float64(y * Float64(x / z)); else tmp = Float64(t_1 * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) + (t / (z + -1.0)); tmp = 0.0; if (t_1 <= -5e+282) tmp = y * (x / z); else tmp = t_1 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] + N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+282], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} + \frac{t}{z + -1}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+282}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot x\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -4.99999999999999978e282Initial program 75.5%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6475.5%
Simplified75.5%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6478.9%
Applied egg-rr78.9%
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64100.0%
Applied egg-rr100.0%
if -4.99999999999999978e282 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 98.6%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ (+ y t) z)))) (if (<= z -0.95) t_1 (if (<= z 0.0036) (/ (* x (- y (* z t))) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y + t) / z);
double tmp;
if (z <= -0.95) {
tmp = t_1;
} else if (z <= 0.0036) {
tmp = (x * (y - (z * t))) / 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 * ((y + t) / z)
if (z <= (-0.95d0)) then
tmp = t_1
else if (z <= 0.0036d0) then
tmp = (x * (y - (z * t))) / 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 + t) / z);
double tmp;
if (z <= -0.95) {
tmp = t_1;
} else if (z <= 0.0036) {
tmp = (x * (y - (z * t))) / z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y + t) / z) tmp = 0 if z <= -0.95: tmp = t_1 elif z <= 0.0036: tmp = (x * (y - (z * t))) / z 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 <= -0.95) tmp = t_1; elseif (z <= 0.0036) tmp = Float64(Float64(x * Float64(y - Float64(z * t))) / z); 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 <= -0.95) tmp = t_1; elseif (z <= 0.0036) tmp = (x * (y - (z * t))) / z; 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, -0.95], t$95$1, If[LessEqual[z, 0.0036], N[(N[(x * N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y + t}{z}\\
\mathbf{if}\;z \leq -0.95:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.0036:\\
\;\;\;\;\frac{x \cdot \left(y - z \cdot t\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.94999999999999996 or 0.0035999999999999999 < z Initial program 99.0%
Taylor expanded in z around inf
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6498.4%
Simplified98.4%
if -0.94999999999999996 < z < 0.0035999999999999999Initial program 93.6%
Taylor expanded in z around 0
/-lowering-/.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-out--N/A
unsub-negN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6495.7%
Simplified95.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ (+ y t) z)))) (if (<= z -1.0) t_1 (if (<= z 5.6e-5) (* 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 <= -1.0) {
tmp = t_1;
} else if (z <= 5.6e-5) {
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 <= (-1.0d0)) then
tmp = t_1
else if (z <= 5.6d-5) 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 <= -1.0) {
tmp = t_1;
} else if (z <= 5.6e-5) {
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 <= -1.0: tmp = t_1 elif z <= 5.6e-5: 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 <= -1.0) tmp = t_1; elseif (z <= 5.6e-5) 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 <= -1.0) tmp = t_1; elseif (z <= 5.6e-5) 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, -1.0], t$95$1, If[LessEqual[z, 5.6e-5], 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 -1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1 or 5.59999999999999992e-5 < z Initial program 99.0%
Taylor expanded in z around inf
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6498.4%
Simplified98.4%
if -1 < z < 5.59999999999999992e-5Initial program 93.6%
Taylor expanded in z around 0
Simplified92.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ t (+ z -1.0))))) (if (<= t -4.8e+152) t_1 (if (<= t 4.2e+81) (/ x (/ z y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / (z + -1.0));
double tmp;
if (t <= -4.8e+152) {
tmp = t_1;
} else if (t <= 4.2e+81) {
tmp = x / (z / y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t / (z + (-1.0d0)))
if (t <= (-4.8d+152)) then
tmp = t_1
else if (t <= 4.2d+81) then
tmp = x / (z / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t / (z + -1.0));
double tmp;
if (t <= -4.8e+152) {
tmp = t_1;
} else if (t <= 4.2e+81) {
tmp = x / (z / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / (z + -1.0)) tmp = 0 if t <= -4.8e+152: tmp = t_1 elif t <= 4.2e+81: tmp = x / (z / y) 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 <= -4.8e+152) tmp = t_1; elseif (t <= 4.2e+81) tmp = Float64(x / Float64(z / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / (z + -1.0)); tmp = 0.0; if (t <= -4.8e+152) tmp = t_1; elseif (t <= 4.2e+81) tmp = x / (z / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.8e+152], t$95$1, If[LessEqual[t, 4.2e+81], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z + -1}\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{+152}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+81}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.7999999999999998e152 or 4.1999999999999997e81 < t Initial program 93.9%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6493.8%
Applied egg-rr93.8%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-lowering-+.f6479.9%
Simplified79.9%
if -4.7999999999999998e152 < t < 4.1999999999999997e81Initial program 97.7%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6482.0%
Simplified82.0%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6482.3%
Applied egg-rr82.3%
Final simplification81.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ t z)))) (if (<= z -3.1e+87) t_1 (if (<= z 1.05e+15) (* x (- (/ y z) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (z <= -3.1e+87) {
tmp = t_1;
} else if (z <= 1.05e+15) {
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 * (t / z)
if (z <= (-3.1d+87)) then
tmp = t_1
else if (z <= 1.05d+15) 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 * (t / z);
double tmp;
if (z <= -3.1e+87) {
tmp = t_1;
} else if (z <= 1.05e+15) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if z <= -3.1e+87: tmp = t_1 elif z <= 1.05e+15: tmp = x * ((y / z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (z <= -3.1e+87) tmp = t_1; elseif (z <= 1.05e+15) 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 * (t / z); tmp = 0.0; if (z <= -3.1e+87) tmp = t_1; elseif (z <= 1.05e+15) 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[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e+87], t$95$1, If[LessEqual[z, 1.05e+15], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+15}:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.1e87 or 1.05e15 < z Initial program 98.8%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6498.8%
Applied egg-rr98.8%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-lowering-+.f6465.9%
Simplified65.9%
Taylor expanded in z around inf
Simplified65.8%
if -3.1e87 < z < 1.05e15Initial program 94.9%
Taylor expanded in z around 0
Simplified87.7%
(FPCore (x y z t) :precision binary64 (if (<= t -1.05e+153) (/ x (/ z t)) (if (<= t 9.6e+80) (/ x (/ z y)) (* x (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.05e+153) {
tmp = x / (z / t);
} else if (t <= 9.6e+80) {
tmp = x / (z / y);
} else {
tmp = x * (t / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.05d+153)) then
tmp = x / (z / t)
else if (t <= 9.6d+80) then
tmp = x / (z / y)
else
tmp = x * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.05e+153) {
tmp = x / (z / t);
} else if (t <= 9.6e+80) {
tmp = x / (z / y);
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.05e+153: tmp = x / (z / t) elif t <= 9.6e+80: tmp = x / (z / y) else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.05e+153) tmp = Float64(x / Float64(z / t)); elseif (t <= 9.6e+80) tmp = Float64(x / Float64(z / y)); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.05e+153) tmp = x / (z / t); elseif (t <= 9.6e+80) tmp = x / (z / y); else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.05e+153], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.6e+80], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+153}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{+80}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if t < -1.05000000000000008e153Initial program 94.1%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6494.1%
Applied egg-rr94.1%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-lowering-+.f6480.3%
Simplified80.3%
Taylor expanded in z around inf
Simplified57.9%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6458.0%
Applied egg-rr58.0%
if -1.05000000000000008e153 < t < 9.59999999999999916e80Initial program 97.7%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6482.0%
Simplified82.0%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6482.3%
Applied egg-rr82.3%
if 9.59999999999999916e80 < t Initial program 93.8%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6493.6%
Applied egg-rr93.6%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-lowering-+.f6479.6%
Simplified79.6%
Taylor expanded in z around inf
Simplified59.3%
(FPCore (x y z t) :precision binary64 (if (<= t -2.3e+152) (/ x (/ z t)) (if (<= t 1.8e+82) (* (/ y z) x) (* x (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.3e+152) {
tmp = x / (z / t);
} else if (t <= 1.8e+82) {
tmp = (y / z) * x;
} else {
tmp = x * (t / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2.3d+152)) then
tmp = x / (z / t)
else if (t <= 1.8d+82) then
tmp = (y / z) * x
else
tmp = x * (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.3e+152) {
tmp = x / (z / t);
} else if (t <= 1.8e+82) {
tmp = (y / z) * x;
} else {
tmp = x * (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.3e+152: tmp = x / (z / t) elif t <= 1.8e+82: tmp = (y / z) * x else: tmp = x * (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.3e+152) tmp = Float64(x / Float64(z / t)); elseif (t <= 1.8e+82) tmp = Float64(Float64(y / z) * x); else tmp = Float64(x * Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.3e+152) tmp = x / (z / t); elseif (t <= 1.8e+82) tmp = (y / z) * x; else tmp = x * (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.3e+152], N[(x / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e+82], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{+152}:\\
\;\;\;\;\frac{x}{\frac{z}{t}}\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{+82}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\end{array}
\end{array}
if t < -2.29999999999999985e152Initial program 94.1%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6494.1%
Applied egg-rr94.1%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-lowering-+.f6480.3%
Simplified80.3%
Taylor expanded in z around inf
Simplified57.9%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6458.0%
Applied egg-rr58.0%
if -2.29999999999999985e152 < t < 1.80000000000000007e82Initial program 97.7%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6482.0%
Simplified82.0%
if 1.80000000000000007e82 < t Initial program 93.8%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6493.6%
Applied egg-rr93.6%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-lowering-+.f6479.6%
Simplified79.6%
Taylor expanded in z around inf
Simplified59.3%
Final simplification74.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ t z)))) (if (<= t -1.3e+154) t_1 (if (<= t 2.6e+81) (* (/ 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.3e+154) {
tmp = t_1;
} else if (t <= 2.6e+81) {
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.3d+154)) then
tmp = t_1
else if (t <= 2.6d+81) 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.3e+154) {
tmp = t_1;
} else if (t <= 2.6e+81) {
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.3e+154: tmp = t_1 elif t <= 2.6e+81: 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.3e+154) tmp = t_1; elseif (t <= 2.6e+81) 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.3e+154) tmp = t_1; elseif (t <= 2.6e+81) 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.3e+154], t$95$1, If[LessEqual[t, 2.6e+81], 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.3 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+81}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.29999999999999994e154 or 2.59999999999999992e81 < t Initial program 93.9%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6493.8%
Applied egg-rr93.8%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-lowering-+.f6479.9%
Simplified79.9%
Taylor expanded in z around inf
Simplified58.7%
if -1.29999999999999994e154 < t < 2.59999999999999992e81Initial program 97.7%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6482.0%
Simplified82.0%
Final simplification74.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ t z)))) (if (<= z -1.0) t_1 (if (<= z 1.0) (* t (- 0.0 x)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (z <= -1.0) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = t * (0.0 - 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 (z <= (-1.0d0)) then
tmp = t_1
else if (z <= 1.0d0) then
tmp = t * (0.0d0 - 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 (z <= -1.0) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = t * (0.0 - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if z <= -1.0: tmp = t_1 elif z <= 1.0: tmp = t * (0.0 - x) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (z <= -1.0) tmp = t_1; elseif (z <= 1.0) tmp = Float64(t * Float64(0.0 - 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 (z <= -1.0) tmp = t_1; elseif (z <= 1.0) tmp = t * (0.0 - 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[z, -1.0], t$95$1, If[LessEqual[z, 1.0], N[(t * N[(0.0 - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;t \cdot \left(0 - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 99.0%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.0%
Applied egg-rr99.0%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-lowering-+.f6461.8%
Simplified61.8%
Taylor expanded in z around inf
Simplified61.1%
if -1 < z < 1Initial program 93.7%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6493.6%
Applied egg-rr93.6%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-lowering-+.f6435.1%
Simplified35.1%
Taylor expanded in z around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6434.3%
Simplified34.3%
sub0-negN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
*-lowering-*.f6434.3%
Applied egg-rr34.3%
Final simplification48.4%
(FPCore (x y z t) :precision binary64 (* t (- 0.0 x)))
double code(double x, double y, double z, double t) {
return t * (0.0 - 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 * (0.0d0 - x)
end function
public static double code(double x, double y, double z, double t) {
return t * (0.0 - x);
}
def code(x, y, z, t): return t * (0.0 - x)
function code(x, y, z, t) return Float64(t * Float64(0.0 - x)) end
function tmp = code(x, y, z, t) tmp = t * (0.0 - x); end
code[x_, y_, z_, t_] := N[(t * N[(0.0 - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(0 - x\right)
\end{array}
Initial program 96.5%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6496.4%
Applied egg-rr96.4%
Taylor expanded in y around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
mul-1-negN/A
remove-double-negN/A
+-lowering-+.f6449.2%
Simplified49.2%
Taylor expanded in z around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6425.4%
Simplified25.4%
sub0-negN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
*-lowering-*.f6425.4%
Applied egg-rr25.4%
Final simplification25.4%
(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 2024160
(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)))))