
(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 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (/ y z) (/ t (+ z -1.0))))) (if (<= t_1 (- INFINITY)) (/ y (/ z x)) (* 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 <= -((double) INFINITY)) {
tmp = y / (z / x);
} else {
tmp = t_1 * x;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y / z) + (t / (z + -1.0));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = y / (z / x);
} 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 <= -math.inf: tmp = y / (z / x) 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 <= Float64(-Inf)) tmp = Float64(y / Float64(z / x)); 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 <= -Inf) tmp = y / (z / x); 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, (-Infinity)], N[(y / N[(z / x), $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 -\infty:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot x\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0Initial program 47.0%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6447.0%
Simplified47.0%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6499.7%
Applied egg-rr99.7%
clear-numN/A
un-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))) Initial program 99.0%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ (+ y t) z)))) (if (<= z -5.5e-30) t_1 (if (<= z 0.006) (* (- y (* z t)) (/ x z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y + t) / z);
double tmp;
if (z <= -5.5e-30) {
tmp = t_1;
} else if (z <= 0.006) {
tmp = (y - (z * t)) * (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 * ((y + t) / z)
if (z <= (-5.5d-30)) then
tmp = t_1
else if (z <= 0.006d0) then
tmp = (y - (z * t)) * (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 * ((y + t) / z);
double tmp;
if (z <= -5.5e-30) {
tmp = t_1;
} else if (z <= 0.006) {
tmp = (y - (z * t)) * (x / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y + t) / z) tmp = 0 if z <= -5.5e-30: tmp = t_1 elif z <= 0.006: tmp = (y - (z * t)) * (x / 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 <= -5.5e-30) tmp = t_1; elseif (z <= 0.006) tmp = Float64(Float64(y - Float64(z * t)) * Float64(x / 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 <= -5.5e-30) tmp = t_1; elseif (z <= 0.006) tmp = (y - (z * t)) * (x / 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, -5.5e-30], t$95$1, If[LessEqual[z, 0.006], N[(N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y + t}{z}\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.006:\\
\;\;\;\;\left(y - z \cdot t\right) \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.49999999999999976e-30 or 0.0060000000000000001 < 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.6%
Simplified98.6%
if -5.49999999999999976e-30 < z < 0.0060000000000000001Initial program 92.0%
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-*.f6491.6%
Simplified91.6%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6493.4%
Applied egg-rr93.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ (+ y t) z)))) (if (<= z -1.0) t_1 (if (<= z 0.006) (* 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 <= 0.006) {
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 <= 0.006d0) 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 <= 0.006) {
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 <= 0.006: 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 <= 0.006) 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 <= 0.006) 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, 0.006], 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 0.006:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1 or 0.0060000000000000001 < 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.6%
Simplified98.6%
if -1 < z < 0.0060000000000000001Initial program 92.0%
Taylor expanded in z around 0
Simplified92.0%
(FPCore (x y z t) :precision binary64 (if (<= y -1.8e-123) (* y (/ x z)) (if (<= y 0.76) (* t (/ x (+ z -1.0))) (/ y (/ z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.8e-123) {
tmp = y * (x / z);
} else if (y <= 0.76) {
tmp = t * (x / (z + -1.0));
} else {
tmp = y / (z / x);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.8d-123)) then
tmp = y * (x / z)
else if (y <= 0.76d0) then
tmp = t * (x / (z + (-1.0d0)))
else
tmp = y / (z / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.8e-123) {
tmp = y * (x / z);
} else if (y <= 0.76) {
tmp = t * (x / (z + -1.0));
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.8e-123: tmp = y * (x / z) elif y <= 0.76: tmp = t * (x / (z + -1.0)) else: tmp = y / (z / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.8e-123) tmp = Float64(y * Float64(x / z)); elseif (y <= 0.76) tmp = Float64(t * Float64(x / Float64(z + -1.0))); else tmp = Float64(y / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.8e-123) tmp = y * (x / z); elseif (y <= 0.76) tmp = t * (x / (z + -1.0)); else tmp = y / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.8e-123], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.76], N[(t * N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-123}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 0.76:\\
\;\;\;\;t \cdot \frac{x}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if y < -1.7999999999999998e-123Initial program 93.4%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6477.1%
Simplified77.1%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6479.3%
Applied egg-rr79.3%
if -1.7999999999999998e-123 < y < 0.76000000000000001Initial program 98.8%
sub-negN/A
distribute-rgt-inN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
--lowering--.f6498.8%
Applied egg-rr98.8%
Taylor expanded in y around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6477.1%
Simplified77.1%
if 0.76000000000000001 < y Initial program 94.5%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6479.8%
Simplified79.8%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6480.6%
Applied egg-rr80.6%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6480.8%
Applied egg-rr80.8%
(FPCore (x y z t) :precision binary64 (if (<= y -1.8e-123) (* y (/ x z)) (if (<= y 0.075) (* x (/ t z)) (/ y (/ z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.8e-123) {
tmp = y * (x / z);
} else if (y <= 0.075) {
tmp = x * (t / z);
} else {
tmp = y / (z / x);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.8d-123)) then
tmp = y * (x / z)
else if (y <= 0.075d0) then
tmp = x * (t / z)
else
tmp = y / (z / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.8e-123) {
tmp = y * (x / z);
} else if (y <= 0.075) {
tmp = x * (t / z);
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.8e-123: tmp = y * (x / z) elif y <= 0.075: tmp = x * (t / z) else: tmp = y / (z / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.8e-123) tmp = Float64(y * Float64(x / z)); elseif (y <= 0.075) tmp = Float64(x * Float64(t / z)); else tmp = Float64(y / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.8e-123) tmp = y * (x / z); elseif (y <= 0.075) tmp = x * (t / z); else tmp = y / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.8e-123], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.075], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-123}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 0.075:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if y < -1.7999999999999998e-123Initial program 93.4%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6477.1%
Simplified77.1%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6479.3%
Applied egg-rr79.3%
if -1.7999999999999998e-123 < y < 0.0749999999999999972Initial program 98.8%
Taylor expanded in z around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6461.1%
Simplified61.1%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6456.5%
Simplified56.5%
clear-numN/A
associate-/r/N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f6458.2%
Applied egg-rr58.2%
if 0.0749999999999999972 < y Initial program 94.5%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6479.8%
Simplified79.8%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6480.6%
Applied egg-rr80.6%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6480.8%
Applied egg-rr80.8%
Final simplification71.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (/ x z)))) (if (<= y -1.9e-123) t_1 (if (<= y 0.075) (* x (/ t z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * (x / z);
double tmp;
if (y <= -1.9e-123) {
tmp = t_1;
} else if (y <= 0.075) {
tmp = x * (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 = y * (x / z)
if (y <= (-1.9d-123)) then
tmp = t_1
else if (y <= 0.075d0) then
tmp = x * (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 = y * (x / z);
double tmp;
if (y <= -1.9e-123) {
tmp = t_1;
} else if (y <= 0.075) {
tmp = x * (t / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (x / z) tmp = 0 if y <= -1.9e-123: tmp = t_1 elif y <= 0.075: tmp = x * (t / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(x / z)) tmp = 0.0 if (y <= -1.9e-123) tmp = t_1; elseif (y <= 0.075) tmp = Float64(x * Float64(t / z)); 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 <= -1.9e-123) tmp = t_1; elseif (y <= 0.075) tmp = x * (t / z); 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]}, If[LessEqual[y, -1.9e-123], t$95$1, If[LessEqual[y, 0.075], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{x}{z}\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{-123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.075:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.89999999999999998e-123 or 0.0749999999999999972 < y Initial program 93.9%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6478.3%
Simplified78.3%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6479.9%
Applied egg-rr79.9%
if -1.89999999999999998e-123 < y < 0.0749999999999999972Initial program 98.8%
Taylor expanded in z around inf
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6461.1%
Simplified61.1%
Taylor expanded in y around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6456.5%
Simplified56.5%
clear-numN/A
associate-/r/N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f6458.2%
Applied egg-rr58.2%
Final simplification71.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* t (- 0.0 x)))) (if (<= t -1.7e+155) t_1 (if (<= t 9.2e+252) (* (/ y z) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = t * (0.0 - x);
double tmp;
if (t <= -1.7e+155) {
tmp = t_1;
} else if (t <= 9.2e+252) {
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 = t * (0.0d0 - x)
if (t <= (-1.7d+155)) then
tmp = t_1
else if (t <= 9.2d+252) 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 = t * (0.0 - x);
double tmp;
if (t <= -1.7e+155) {
tmp = t_1;
} else if (t <= 9.2e+252) {
tmp = (y / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (0.0 - x) tmp = 0 if t <= -1.7e+155: tmp = t_1 elif t <= 9.2e+252: tmp = (y / z) * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(0.0 - x)) tmp = 0.0 if (t <= -1.7e+155) tmp = t_1; elseif (t <= 9.2e+252) tmp = Float64(Float64(y / z) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (0.0 - x); tmp = 0.0; if (t <= -1.7e+155) tmp = t_1; elseif (t <= 9.2e+252) tmp = (y / z) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(0.0 - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.7e+155], t$95$1, If[LessEqual[t, 9.2e+252], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(0 - x\right)\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{+155}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{+252}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.7e155 or 9.1999999999999999e252 < t Initial program 98.0%
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-*.f6457.8%
Simplified57.8%
Taylor expanded in y around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6446.3%
Simplified46.3%
sub0-negN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
*-lowering-*.f6446.3%
Applied egg-rr46.3%
if -1.7e155 < t < 9.1999999999999999e252Initial program 95.2%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6474.3%
Simplified74.3%
Final simplification68.5%
(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 95.8%
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-*.f6459.1%
Simplified59.1%
Taylor expanded in y around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6422.9%
Simplified22.9%
sub0-negN/A
neg-lowering-neg.f64N/A
*-commutativeN/A
*-lowering-*.f6422.9%
Applied egg-rr22.9%
Final simplification22.9%
(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 2024152
(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)))))