
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
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 = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
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 = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
(FPCore (x y z t) :precision binary64 (+ 1.0 (/ x (* (- y z) (- t y)))))
double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
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 = 1.0d0 + (x / ((y - z) * (t - y)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
def code(x, y, z, t): return 1.0 + (x / ((y - z) * (t - y)))
function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(Float64(y - z) * Float64(t - y)))) end
function tmp = code(x, y, z, t) tmp = 1.0 + (x / ((y - z) * (t - y))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{x}{\left(y - z\right) \cdot \left(t - y\right)}
\end{array}
Initial program 99.2%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.2e-94) (not (<= y 1.02e-109))) (- 1.0 (/ x (* y (- y t)))) (+ 1.0 (/ -1.0 (/ (* z t) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.2e-94) || !(y <= 1.02e-109)) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 + (-1.0 / ((z * t) / 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 <= (-5.2d-94)) .or. (.not. (y <= 1.02d-109))) then
tmp = 1.0d0 - (x / (y * (y - t)))
else
tmp = 1.0d0 + ((-1.0d0) / ((z * t) / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.2e-94) || !(y <= 1.02e-109)) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 + (-1.0 / ((z * t) / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.2e-94) or not (y <= 1.02e-109): tmp = 1.0 - (x / (y * (y - t))) else: tmp = 1.0 + (-1.0 / ((z * t) / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.2e-94) || !(y <= 1.02e-109)) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); else tmp = Float64(1.0 + Float64(-1.0 / Float64(Float64(z * t) / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5.2e-94) || ~((y <= 1.02e-109))) tmp = 1.0 - (x / (y * (y - t))); else tmp = 1.0 + (-1.0 / ((z * t) / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.2e-94], N[Not[LessEqual[y, 1.02e-109]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / N[(N[(z * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{-94} \lor \neg \left(y \leq 1.02 \cdot 10^{-109}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{\frac{z \cdot t}{x}}\\
\end{array}
\end{array}
if y < -5.19999999999999988e-94 or 1.02e-109 < y Initial program 99.9%
Taylor expanded in z around 0 89.8%
if -5.19999999999999988e-94 < y < 1.02e-109Initial program 97.3%
Taylor expanded in y around 0 83.6%
clear-num83.7%
inv-pow83.7%
*-commutative83.7%
associate-/l*81.1%
Applied egg-rr81.1%
unpow-181.1%
associate-*r/83.7%
*-commutative83.7%
Simplified83.7%
Final simplification88.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -225000.0) (not (<= y 1.1e+24))) (- 1.0 (/ x (* y t))) (- 1.0 (/ x (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -225000.0) || !(y <= 1.1e+24)) {
tmp = 1.0 - (x / (y * t));
} else {
tmp = 1.0 - (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 ((y <= (-225000.0d0)) .or. (.not. (y <= 1.1d+24))) then
tmp = 1.0d0 - (x / (y * t))
else
tmp = 1.0d0 - (x / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -225000.0) || !(y <= 1.1e+24)) {
tmp = 1.0 - (x / (y * t));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -225000.0) or not (y <= 1.1e+24): tmp = 1.0 - (x / (y * t)) else: tmp = 1.0 - (x / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -225000.0) || !(y <= 1.1e+24)) tmp = Float64(1.0 - Float64(x / Float64(y * t))); else tmp = Float64(1.0 - Float64(x / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -225000.0) || ~((y <= 1.1e+24))) tmp = 1.0 - (x / (y * t)); else tmp = 1.0 - (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -225000.0], N[Not[LessEqual[y, 1.1e+24]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -225000 \lor \neg \left(y \leq 1.1 \cdot 10^{+24}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -225000 or 1.10000000000000001e24 < y Initial program 100.0%
Taylor expanded in z around 0 96.2%
Taylor expanded in y around 0 72.2%
associate-*r/72.2%
mul-1-neg72.2%
Simplified72.2%
div-inv72.2%
add-sqr-sqrt36.9%
sqrt-unprod55.9%
sqr-neg55.9%
sqrt-unprod34.4%
add-sqr-sqrt70.6%
associate-/r*70.6%
Applied egg-rr70.6%
associate-*r/70.5%
associate-*r/70.5%
*-rgt-identity70.5%
associate-/r*70.6%
Simplified70.6%
if -225000 < y < 1.10000000000000001e24Initial program 98.4%
Taylor expanded in y around 0 69.7%
Final simplification70.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -60000000000.0) (not (<= y 1.3e+14))) (- 1.0 (/ x (* y z))) (- 1.0 (/ x (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -60000000000.0) || !(y <= 1.3e+14)) {
tmp = 1.0 - (x / (y * z));
} else {
tmp = 1.0 - (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 ((y <= (-60000000000.0d0)) .or. (.not. (y <= 1.3d+14))) then
tmp = 1.0d0 - (x / (y * z))
else
tmp = 1.0d0 - (x / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -60000000000.0) || !(y <= 1.3e+14)) {
tmp = 1.0 - (x / (y * z));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -60000000000.0) or not (y <= 1.3e+14): tmp = 1.0 - (x / (y * z)) else: tmp = 1.0 - (x / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -60000000000.0) || !(y <= 1.3e+14)) tmp = Float64(1.0 - Float64(x / Float64(y * z))); else tmp = Float64(1.0 - Float64(x / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -60000000000.0) || ~((y <= 1.3e+14))) tmp = 1.0 - (x / (y * z)); else tmp = 1.0 - (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -60000000000.0], N[Not[LessEqual[y, 1.3e+14]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -60000000000 \lor \neg \left(y \leq 1.3 \cdot 10^{+14}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -6e10 or 1.3e14 < y Initial program 100.0%
Taylor expanded in t around 0 95.5%
Taylor expanded in y around 0 71.1%
associate-*r/71.1%
neg-mul-171.1%
*-commutative71.1%
Simplified71.1%
div-inv71.1%
add-sqr-sqrt34.7%
sqrt-unprod54.9%
sqr-neg54.9%
sqrt-unprod36.0%
add-sqr-sqrt70.7%
*-commutative70.7%
Applied egg-rr70.7%
associate-*r/70.7%
*-rgt-identity70.7%
Simplified70.7%
if -6e10 < y < 1.3e14Initial program 98.4%
Taylor expanded in y around 0 70.3%
Final simplification70.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2500000.0) (not (<= y 3000000000000.0))) (- 1.0 (/ x (* y z))) (- 1.0 (/ (/ x t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2500000.0) || !(y <= 3000000000000.0)) {
tmp = 1.0 - (x / (y * z));
} else {
tmp = 1.0 - ((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 ((y <= (-2500000.0d0)) .or. (.not. (y <= 3000000000000.0d0))) then
tmp = 1.0d0 - (x / (y * z))
else
tmp = 1.0d0 - ((x / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2500000.0) || !(y <= 3000000000000.0)) {
tmp = 1.0 - (x / (y * z));
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2500000.0) or not (y <= 3000000000000.0): tmp = 1.0 - (x / (y * z)) else: tmp = 1.0 - ((x / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2500000.0) || !(y <= 3000000000000.0)) tmp = Float64(1.0 - Float64(x / Float64(y * z))); else tmp = Float64(1.0 - Float64(Float64(x / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2500000.0) || ~((y <= 3000000000000.0))) tmp = 1.0 - (x / (y * z)); else tmp = 1.0 - ((x / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2500000.0], N[Not[LessEqual[y, 3000000000000.0]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2500000 \lor \neg \left(y \leq 3000000000000\right):\\
\;\;\;\;1 - \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\end{array}
\end{array}
if y < -2.5e6 or 3e12 < y Initial program 100.0%
Taylor expanded in t around 0 95.5%
Taylor expanded in y around 0 71.1%
associate-*r/71.1%
neg-mul-171.1%
*-commutative71.1%
Simplified71.1%
div-inv71.1%
add-sqr-sqrt34.7%
sqrt-unprod54.9%
sqr-neg54.9%
sqrt-unprod36.0%
add-sqr-sqrt70.7%
*-commutative70.7%
Applied egg-rr70.7%
associate-*r/70.7%
*-rgt-identity70.7%
Simplified70.7%
if -2.5e6 < y < 3e12Initial program 98.4%
Taylor expanded in y around 0 70.3%
associate-/r*68.9%
div-inv68.9%
Applied egg-rr68.9%
un-div-inv68.9%
Applied egg-rr68.9%
Final simplification69.8%
(FPCore (x y z t) :precision binary64 (if (<= t 1.35e-128) (- 1.0 (/ x (* y z))) (if (<= t 2.7e+122) (- 1.0 (/ x (* z t))) (+ 1.0 (/ x (* y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.35e-128) {
tmp = 1.0 - (x / (y * z));
} else if (t <= 2.7e+122) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 + (x / (y * 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.35d-128) then
tmp = 1.0d0 - (x / (y * z))
else if (t <= 2.7d+122) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0 + (x / (y * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.35e-128) {
tmp = 1.0 - (x / (y * z));
} else if (t <= 2.7e+122) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 + (x / (y * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 1.35e-128: tmp = 1.0 - (x / (y * z)) elif t <= 2.7e+122: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 + (x / (y * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 1.35e-128) tmp = Float64(1.0 - Float64(x / Float64(y * z))); elseif (t <= 2.7e+122) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = Float64(1.0 + Float64(x / Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 1.35e-128) tmp = 1.0 - (x / (y * z)); elseif (t <= 2.7e+122) tmp = 1.0 - (x / (z * t)); else tmp = 1.0 + (x / (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.35e-128], N[(1.0 - N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.7e+122], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.35 \cdot 10^{-128}:\\
\;\;\;\;1 - \frac{x}{y \cdot z}\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+122}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\end{array}
\end{array}
if t < 1.35000000000000003e-128Initial program 98.7%
Taylor expanded in t around 0 80.9%
Taylor expanded in y around 0 60.2%
associate-*r/60.2%
neg-mul-160.2%
*-commutative60.2%
Simplified60.2%
div-inv60.2%
add-sqr-sqrt27.8%
sqrt-unprod49.7%
sqr-neg49.7%
sqrt-unprod29.9%
add-sqr-sqrt56.9%
*-commutative56.9%
Applied egg-rr56.9%
associate-*r/56.9%
*-rgt-identity56.9%
Simplified56.9%
if 1.35000000000000003e-128 < t < 2.6999999999999998e122Initial program 99.9%
Taylor expanded in y around 0 75.7%
if 2.6999999999999998e122 < t Initial program 100.0%
Taylor expanded in z around 0 91.4%
Taylor expanded in y around 0 91.4%
associate-*r/91.4%
mul-1-neg91.4%
Simplified91.4%
Final simplification66.6%
(FPCore (x y z t) :precision binary64 (if (<= t 5.6e-23) (+ 1.0 (/ x (* y z))) (if (<= t 6e+126) (- 1.0 (/ (/ x t) z)) (+ 1.0 (/ x (* y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 5.6e-23) {
tmp = 1.0 + (x / (y * z));
} else if (t <= 6e+126) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 + (x / (y * 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 <= 5.6d-23) then
tmp = 1.0d0 + (x / (y * z))
else if (t <= 6d+126) then
tmp = 1.0d0 - ((x / t) / z)
else
tmp = 1.0d0 + (x / (y * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 5.6e-23) {
tmp = 1.0 + (x / (y * z));
} else if (t <= 6e+126) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 + (x / (y * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 5.6e-23: tmp = 1.0 + (x / (y * z)) elif t <= 6e+126: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 + (x / (y * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 5.6e-23) tmp = Float64(1.0 + Float64(x / Float64(y * z))); elseif (t <= 6e+126) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); else tmp = Float64(1.0 + Float64(x / Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 5.6e-23) tmp = 1.0 + (x / (y * z)); elseif (t <= 6e+126) tmp = 1.0 - ((x / t) / z); else tmp = 1.0 + (x / (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 5.6e-23], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e+126], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.6 \cdot 10^{-23}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+126}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\end{array}
\end{array}
if t < 5.5999999999999994e-23Initial program 98.9%
Taylor expanded in t around 0 81.0%
Taylor expanded in y around 0 60.7%
associate-*r/60.7%
neg-mul-160.7%
*-commutative60.7%
Simplified60.7%
if 5.5999999999999994e-23 < t < 6.0000000000000005e126Initial program 99.9%
Taylor expanded in y around 0 84.6%
associate-/r*84.6%
div-inv84.6%
Applied egg-rr84.6%
un-div-inv84.6%
Applied egg-rr84.6%
if 6.0000000000000005e126 < t Initial program 100.0%
Taylor expanded in z around 0 91.4%
Taylor expanded in y around 0 91.4%
associate-*r/91.4%
mul-1-neg91.4%
Simplified91.4%
Final simplification68.6%
(FPCore (x y z t) :precision binary64 (if (<= t 7.5e-21) (+ 1.0 (/ x (* y z))) (if (<= t 1.4e+122) (- 1.0 (/ (/ x t) z)) (+ 1.0 (/ (/ x t) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 7.5e-21) {
tmp = 1.0 + (x / (y * z));
} else if (t <= 1.4e+122) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 7.5d-21) then
tmp = 1.0d0 + (x / (y * z))
else if (t <= 1.4d+122) then
tmp = 1.0d0 - ((x / t) / z)
else
tmp = 1.0d0 + ((x / t) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 7.5e-21) {
tmp = 1.0 + (x / (y * z));
} else if (t <= 1.4e+122) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 7.5e-21: tmp = 1.0 + (x / (y * z)) elif t <= 1.4e+122: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 + ((x / t) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 7.5e-21) tmp = Float64(1.0 + Float64(x / Float64(y * z))); elseif (t <= 1.4e+122) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); else tmp = Float64(1.0 + Float64(Float64(x / t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 7.5e-21) tmp = 1.0 + (x / (y * z)); elseif (t <= 1.4e+122) tmp = 1.0 - ((x / t) / z); else tmp = 1.0 + ((x / t) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 7.5e-21], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e+122], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7.5 \cdot 10^{-21}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+122}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if t < 7.50000000000000072e-21Initial program 98.9%
Taylor expanded in t around 0 81.0%
Taylor expanded in y around 0 60.7%
associate-*r/60.7%
neg-mul-160.7%
*-commutative60.7%
Simplified60.7%
if 7.50000000000000072e-21 < t < 1.4e122Initial program 99.9%
Taylor expanded in y around 0 84.6%
associate-/r*84.6%
div-inv84.6%
Applied egg-rr84.6%
un-div-inv84.6%
Applied egg-rr84.6%
if 1.4e122 < t Initial program 100.0%
Taylor expanded in z around 0 91.4%
Taylor expanded in y around 0 91.4%
mul-1-neg91.4%
associate-/r*91.5%
distribute-neg-frac291.5%
Simplified91.5%
Final simplification68.6%
(FPCore (x y z t) :precision binary64 (if (<= t 2.4e-22) (+ 1.0 (/ (/ x z) y)) (if (<= t 8.8e+125) (- 1.0 (/ (/ x t) z)) (+ 1.0 (/ (/ x t) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.4e-22) {
tmp = 1.0 + ((x / z) / y);
} else if (t <= 8.8e+125) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 2.4d-22) then
tmp = 1.0d0 + ((x / z) / y)
else if (t <= 8.8d+125) then
tmp = 1.0d0 - ((x / t) / z)
else
tmp = 1.0d0 + ((x / t) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.4e-22) {
tmp = 1.0 + ((x / z) / y);
} else if (t <= 8.8e+125) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 2.4e-22: tmp = 1.0 + ((x / z) / y) elif t <= 8.8e+125: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 + ((x / t) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 2.4e-22) tmp = Float64(1.0 + Float64(Float64(x / z) / y)); elseif (t <= 8.8e+125) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); else tmp = Float64(1.0 + Float64(Float64(x / t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 2.4e-22) tmp = 1.0 + ((x / z) / y); elseif (t <= 8.8e+125) tmp = 1.0 - ((x / t) / z); else tmp = 1.0 + ((x / t) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 2.4e-22], N[(1.0 + N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.8e+125], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.4 \cdot 10^{-22}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y}\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{+125}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if t < 2.40000000000000002e-22Initial program 98.9%
Taylor expanded in t around 0 81.0%
Taylor expanded in y around 0 60.7%
associate-*r/60.7%
neg-mul-160.7%
*-commutative60.7%
Simplified60.7%
Taylor expanded in x around 0 60.7%
neg-mul-160.7%
distribute-neg-frac260.7%
*-commutative60.7%
distribute-rgt-neg-out60.7%
associate-/r*60.8%
Simplified60.8%
if 2.40000000000000002e-22 < t < 8.79999999999999964e125Initial program 99.9%
Taylor expanded in y around 0 84.6%
associate-/r*84.6%
div-inv84.6%
Applied egg-rr84.6%
un-div-inv84.6%
Applied egg-rr84.6%
if 8.79999999999999964e125 < t Initial program 100.0%
Taylor expanded in z around 0 91.4%
Taylor expanded in y around 0 91.4%
mul-1-neg91.4%
associate-/r*91.5%
distribute-neg-frac291.5%
Simplified91.5%
Final simplification68.6%
(FPCore (x y z t) :precision binary64 (if (<= t 3.7e-6) (+ 1.0 (/ x (* y (- z y)))) (if (<= t 4e+122) (- 1.0 (/ (/ x t) z)) (+ 1.0 (/ (/ x t) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.7e-6) {
tmp = 1.0 + (x / (y * (z - y)));
} else if (t <= 4e+122) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 3.7d-6) then
tmp = 1.0d0 + (x / (y * (z - y)))
else if (t <= 4d+122) then
tmp = 1.0d0 - ((x / t) / z)
else
tmp = 1.0d0 + ((x / t) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.7e-6) {
tmp = 1.0 + (x / (y * (z - y)));
} else if (t <= 4e+122) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0 + ((x / t) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 3.7e-6: tmp = 1.0 + (x / (y * (z - y))) elif t <= 4e+122: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 + ((x / t) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 3.7e-6) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); elseif (t <= 4e+122) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); else tmp = Float64(1.0 + Float64(Float64(x / t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 3.7e-6) tmp = 1.0 + (x / (y * (z - y))); elseif (t <= 4e+122) tmp = 1.0 - ((x / t) / z); else tmp = 1.0 + ((x / t) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 3.7e-6], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e+122], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.7 \cdot 10^{-6}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+122}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\
\end{array}
\end{array}
if t < 3.7000000000000002e-6Initial program 98.9%
Taylor expanded in t around 0 81.3%
if 3.7000000000000002e-6 < t < 4.00000000000000006e122Initial program 99.9%
Taylor expanded in y around 0 91.2%
associate-/r*91.3%
div-inv91.2%
Applied egg-rr91.2%
un-div-inv91.3%
Applied egg-rr91.3%
if 4.00000000000000006e122 < t Initial program 100.0%
Taylor expanded in z around 0 91.4%
Taylor expanded in y around 0 91.4%
mul-1-neg91.4%
associate-/r*91.5%
distribute-neg-frac291.5%
Simplified91.5%
Final simplification83.9%
(FPCore (x y z t) :precision binary64 (if (<= t 3.2e-21) (+ 1.0 (/ x (* y (- z y)))) (+ 1.0 (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.2e-21) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 + ((x / t) / (y - 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 <= 3.2d-21) then
tmp = 1.0d0 + (x / (y * (z - y)))
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.2e-21) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 3.2e-21: tmp = 1.0 + (x / (y * (z - y))) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 3.2e-21) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 3.2e-21) tmp = 1.0 + (x / (y * (z - y))); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 3.2e-21], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.2 \cdot 10^{-21}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < 3.2000000000000002e-21Initial program 98.9%
Taylor expanded in t around 0 81.0%
if 3.2000000000000002e-21 < t Initial program 99.9%
*-un-lft-identity99.9%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in t around inf 98.6%
mul-1-neg98.6%
associate-/r*98.7%
distribute-neg-frac298.7%
sub-neg98.7%
neg-mul-198.7%
+-commutative98.7%
distribute-neg-in98.7%
neg-mul-198.7%
remove-double-neg98.7%
Simplified98.7%
Taylor expanded in x around 0 98.6%
associate-/r*98.7%
Simplified98.7%
Final simplification85.9%
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* y t))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / (y * t));
}
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 = 1.0d0 - (x / (y * t))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / (y * t));
}
def code(x, y, z, t): return 1.0 - (x / (y * t))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(y * t))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / (y * t)); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{y \cdot t}
\end{array}
Initial program 99.2%
Taylor expanded in z around 0 75.4%
Taylor expanded in y around 0 57.1%
associate-*r/57.1%
mul-1-neg57.1%
Simplified57.1%
div-inv57.1%
add-sqr-sqrt29.0%
sqrt-unprod46.8%
sqr-neg46.8%
sqrt-unprod24.3%
add-sqr-sqrt50.3%
associate-/r*50.3%
Applied egg-rr50.3%
associate-*r/50.3%
associate-*r/50.3%
*-rgt-identity50.3%
associate-/r*50.3%
Simplified50.3%
Final simplification50.3%
herbie shell --seed 2024078
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, A"
:precision binary64
(- 1.0 (/ x (* (- y z) (- y t)))))