
(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 9 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.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ 1.0 (/ x (* y (- t y))))))
(if (<= y -2.1e-24)
t_1
(if (<= y 9.5e-115)
(- 1.0 (/ x (* z t)))
(if (or (<= y 9e-48) (not (<= y 7e+20))) t_1 (+ 1.0 (/ x (* y z))))))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 + (x / (y * (t - y)));
double tmp;
if (y <= -2.1e-24) {
tmp = t_1;
} else if (y <= 9.5e-115) {
tmp = 1.0 - (x / (z * t));
} else if ((y <= 9e-48) || !(y <= 7e+20)) {
tmp = t_1;
} else {
tmp = 1.0 + (x / (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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 + (x / (y * (t - y)))
if (y <= (-2.1d-24)) then
tmp = t_1
else if (y <= 9.5d-115) then
tmp = 1.0d0 - (x / (z * t))
else if ((y <= 9d-48) .or. (.not. (y <= 7d+20))) then
tmp = t_1
else
tmp = 1.0d0 + (x / (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 + (x / (y * (t - y)));
double tmp;
if (y <= -2.1e-24) {
tmp = t_1;
} else if (y <= 9.5e-115) {
tmp = 1.0 - (x / (z * t));
} else if ((y <= 9e-48) || !(y <= 7e+20)) {
tmp = t_1;
} else {
tmp = 1.0 + (x / (y * z));
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 + (x / (y * (t - y))) tmp = 0 if y <= -2.1e-24: tmp = t_1 elif y <= 9.5e-115: tmp = 1.0 - (x / (z * t)) elif (y <= 9e-48) or not (y <= 7e+20): tmp = t_1 else: tmp = 1.0 + (x / (y * z)) return tmp
function code(x, y, z, t) t_1 = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))) tmp = 0.0 if (y <= -2.1e-24) tmp = t_1; elseif (y <= 9.5e-115) tmp = Float64(1.0 - Float64(x / Float64(z * t))); elseif ((y <= 9e-48) || !(y <= 7e+20)) tmp = t_1; else tmp = Float64(1.0 + Float64(x / Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 + (x / (y * (t - y))); tmp = 0.0; if (y <= -2.1e-24) tmp = t_1; elseif (y <= 9.5e-115) tmp = 1.0 - (x / (z * t)); elseif ((y <= 9e-48) || ~((y <= 7e+20))) tmp = t_1; else tmp = 1.0 + (x / (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e-24], t$95$1, If[LessEqual[y, 9.5e-115], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 9e-48], N[Not[LessEqual[y, 7e+20]], $MachinePrecision]], t$95$1, N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 + \frac{x}{y \cdot \left(t - y\right)}\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-115}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-48} \lor \neg \left(y \leq 7 \cdot 10^{+20}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\end{array}
\end{array}
if y < -2.0999999999999999e-24 or 9.4999999999999996e-115 < y < 8.99999999999999977e-48 or 7e20 < y Initial program 100.0%
Taylor expanded in z around 0 92.4%
if -2.0999999999999999e-24 < y < 9.4999999999999996e-115Initial program 99.0%
Taylor expanded in y around 0 79.8%
if 8.99999999999999977e-48 < y < 7e20Initial program 99.8%
Taylor expanded in t around 0 74.5%
Taylor expanded in y around 0 65.0%
mul-1-neg65.0%
distribute-neg-frac265.0%
distribute-rgt-neg-out65.0%
Simplified65.0%
Final simplification84.5%
(FPCore (x y z t)
:precision binary64
(if (<= t -470000000000.0)
(- 1.0 (/ x (* z t)))
(if (<= t 5e-90)
(+ 1.0 (/ x (* y (- z y))))
(if (<= t 1.5e-20) (+ 1.0 (/ -1.0 (/ z (/ x t)))) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -470000000000.0) {
tmp = 1.0 - (x / (z * t));
} else if (t <= 5e-90) {
tmp = 1.0 + (x / (y * (z - y)));
} else if (t <= 1.5e-20) {
tmp = 1.0 + (-1.0 / (z / (x / t)));
} else {
tmp = 1.0;
}
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 <= (-470000000000.0d0)) then
tmp = 1.0d0 - (x / (z * t))
else if (t <= 5d-90) then
tmp = 1.0d0 + (x / (y * (z - y)))
else if (t <= 1.5d-20) then
tmp = 1.0d0 + ((-1.0d0) / (z / (x / t)))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -470000000000.0) {
tmp = 1.0 - (x / (z * t));
} else if (t <= 5e-90) {
tmp = 1.0 + (x / (y * (z - y)));
} else if (t <= 1.5e-20) {
tmp = 1.0 + (-1.0 / (z / (x / t)));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -470000000000.0: tmp = 1.0 - (x / (z * t)) elif t <= 5e-90: tmp = 1.0 + (x / (y * (z - y))) elif t <= 1.5e-20: tmp = 1.0 + (-1.0 / (z / (x / t))) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -470000000000.0) tmp = Float64(1.0 - Float64(x / Float64(z * t))); elseif (t <= 5e-90) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); elseif (t <= 1.5e-20) tmp = Float64(1.0 + Float64(-1.0 / Float64(z / Float64(x / t)))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -470000000000.0) tmp = 1.0 - (x / (z * t)); elseif (t <= 5e-90) tmp = 1.0 + (x / (y * (z - y))); elseif (t <= 1.5e-20) tmp = 1.0 + (-1.0 / (z / (x / t))); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -470000000000.0], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e-90], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e-20], N[(1.0 + N[(-1.0 / N[(z / N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -470000000000:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-90}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-20}:\\
\;\;\;\;1 + \frac{-1}{\frac{z}{\frac{x}{t}}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -4.7e11Initial program 99.9%
Taylor expanded in y around 0 75.9%
if -4.7e11 < t < 5.00000000000000019e-90Initial program 99.0%
Taylor expanded in t around 0 84.0%
if 5.00000000000000019e-90 < t < 1.50000000000000014e-20Initial program 99.4%
Taylor expanded in y around 0 77.3%
clear-num77.4%
inv-pow77.4%
*-commutative77.4%
associate-/l*77.4%
Applied egg-rr77.4%
unpow-177.4%
Simplified77.4%
clear-num77.5%
div-inv77.5%
Applied egg-rr77.5%
if 1.50000000000000014e-20 < t Initial program 100.0%
Taylor expanded in t around inf 99.3%
associate-*r/99.3%
neg-mul-199.3%
Simplified99.3%
Taylor expanded in y around inf 76.0%
Taylor expanded in x around 0 85.2%
Final simplification81.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9.5e-153) (not (<= z 5e-122))) (+ 1.0 (/ x (* z (- y t)))) (+ 1.0 (/ x (* y (- t y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.5e-153) || !(z <= 5e-122)) {
tmp = 1.0 + (x / (z * (y - t)));
} else {
tmp = 1.0 + (x / (y * (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 ((z <= (-9.5d-153)) .or. (.not. (z <= 5d-122))) then
tmp = 1.0d0 + (x / (z * (y - t)))
else
tmp = 1.0d0 + (x / (y * (t - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9.5e-153) || !(z <= 5e-122)) {
tmp = 1.0 + (x / (z * (y - t)));
} else {
tmp = 1.0 + (x / (y * (t - y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -9.5e-153) or not (z <= 5e-122): tmp = 1.0 + (x / (z * (y - t))) else: tmp = 1.0 + (x / (y * (t - y))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -9.5e-153) || !(z <= 5e-122)) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); else tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -9.5e-153) || ~((z <= 5e-122))) tmp = 1.0 + (x / (z * (y - t))); else tmp = 1.0 + (x / (y * (t - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9.5e-153], N[Not[LessEqual[z, 5e-122]], $MachinePrecision]], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-153} \lor \neg \left(z \leq 5 \cdot 10^{-122}\right):\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\end{array}
\end{array}
if z < -9.50000000000000031e-153 or 4.9999999999999999e-122 < z Initial program 99.9%
*-un-lft-identity99.9%
times-frac98.5%
Applied egg-rr98.5%
Taylor expanded in z around inf 95.0%
mul-1-neg95.0%
associate-/r*94.5%
distribute-neg-frac294.5%
Simplified94.5%
Taylor expanded in x around 0 95.0%
if -9.50000000000000031e-153 < z < 4.9999999999999999e-122Initial program 98.5%
Taylor expanded in z around 0 90.3%
Final simplification93.7%
(FPCore (x y z t) :precision binary64 (if (<= t -1.22e-183) (+ 1.0 (/ x (* z (- y t)))) (if (<= t 1e-91) (+ 1.0 (/ (/ x (- z y)) y)) (+ 1.0 (/ x (* (- y z) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.22e-183) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 1e-91) {
tmp = 1.0 + ((x / (z - y)) / y);
} else {
tmp = 1.0 + (x / ((y - 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.22d-183)) then
tmp = 1.0d0 + (x / (z * (y - t)))
else if (t <= 1d-91) then
tmp = 1.0d0 + ((x / (z - y)) / y)
else
tmp = 1.0d0 + (x / ((y - 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.22e-183) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 1e-91) {
tmp = 1.0 + ((x / (z - y)) / y);
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.22e-183: tmp = 1.0 + (x / (z * (y - t))) elif t <= 1e-91: tmp = 1.0 + ((x / (z - y)) / y) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.22e-183) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); elseif (t <= 1e-91) tmp = Float64(1.0 + Float64(Float64(x / Float64(z - y)) / y)); else tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.22e-183) tmp = 1.0 + (x / (z * (y - t))); elseif (t <= 1e-91) tmp = 1.0 + ((x / (z - y)) / y); else tmp = 1.0 + (x / ((y - z) * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.22e-183], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-91], N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.22 \cdot 10^{-183}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{elif}\;t \leq 10^{-91}:\\
\;\;\;\;1 + \frac{\frac{x}{z - y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -1.21999999999999992e-183Initial program 99.9%
*-un-lft-identity99.9%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 83.9%
mul-1-neg83.9%
associate-/r*82.9%
distribute-neg-frac282.9%
Simplified82.9%
Taylor expanded in x around 0 83.9%
if -1.21999999999999992e-183 < t < 1.00000000000000002e-91Initial program 98.6%
Taylor expanded in t around 0 91.4%
*-commutative91.4%
associate-/r*92.1%
Simplified92.1%
if 1.00000000000000002e-91 < t Initial program 99.9%
Taylor expanded in t around inf 98.5%
associate-*r/98.5%
neg-mul-198.5%
Simplified98.5%
Final simplification90.6%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.32e-176)
(+ 1.0 (/ x (* z (- y t))))
(if (<= t 7.2e-93)
(+ 1.0 (/ (/ x (- z y)) y))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.32e-176) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 7.2e-93) {
tmp = 1.0 + ((x / (z - y)) / 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 <= (-1.32d-176)) then
tmp = 1.0d0 + (x / (z * (y - t)))
else if (t <= 7.2d-93) then
tmp = 1.0d0 + ((x / (z - y)) / 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 <= -1.32e-176) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 7.2e-93) {
tmp = 1.0 + ((x / (z - y)) / y);
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.32e-176: tmp = 1.0 + (x / (z * (y - t))) elif t <= 7.2e-93: tmp = 1.0 + ((x / (z - y)) / y) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.32e-176) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); elseif (t <= 7.2e-93) tmp = Float64(1.0 + Float64(Float64(x / Float64(z - y)) / 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 <= -1.32e-176) tmp = 1.0 + (x / (z * (y - t))); elseif (t <= 7.2e-93) tmp = 1.0 + ((x / (z - y)) / y); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.32e-176], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e-93], N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / y), $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 -1.32 \cdot 10^{-176}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-93}:\\
\;\;\;\;1 + \frac{\frac{x}{z - y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -1.32e-176Initial program 99.9%
*-un-lft-identity99.9%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 83.6%
mul-1-neg83.6%
associate-/r*82.6%
distribute-neg-frac282.6%
Simplified82.6%
Taylor expanded in x around 0 83.6%
if -1.32e-176 < t < 7.2000000000000003e-93Initial program 98.6%
Taylor expanded in t around 0 91.7%
*-commutative91.7%
associate-/r*92.3%
Simplified92.3%
if 7.2000000000000003e-93 < t Initial program 99.9%
*-un-lft-identity99.9%
times-frac99.9%
Applied egg-rr99.9%
associate-*l/99.9%
*-un-lft-identity99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 98.5%
mul-1-neg98.5%
distribute-neg-frac298.5%
Simplified98.5%
Final simplification90.7%
(FPCore (x y z t) :precision binary64 (if (<= t -8.2e-179) (+ 1.0 (* x (/ (/ 1.0 z) (- y t)))) (if (<= t 5e-90) (+ 1.0 (/ (/ x (- z y)) y)) (+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.2e-179) {
tmp = 1.0 + (x * ((1.0 / z) / (y - t)));
} else if (t <= 5e-90) {
tmp = 1.0 + ((x / (z - y)) / 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 <= (-8.2d-179)) then
tmp = 1.0d0 + (x * ((1.0d0 / z) / (y - t)))
else if (t <= 5d-90) then
tmp = 1.0d0 + ((x / (z - y)) / 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 <= -8.2e-179) {
tmp = 1.0 + (x * ((1.0 / z) / (y - t)));
} else if (t <= 5e-90) {
tmp = 1.0 + ((x / (z - y)) / y);
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -8.2e-179: tmp = 1.0 + (x * ((1.0 / z) / (y - t))) elif t <= 5e-90: tmp = 1.0 + ((x / (z - y)) / y) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -8.2e-179) tmp = Float64(1.0 + Float64(x * Float64(Float64(1.0 / z) / Float64(y - t)))); elseif (t <= 5e-90) tmp = Float64(1.0 + Float64(Float64(x / Float64(z - y)) / 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 <= -8.2e-179) tmp = 1.0 + (x * ((1.0 / z) / (y - t))); elseif (t <= 5e-90) tmp = 1.0 + ((x / (z - y)) / y); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -8.2e-179], N[(1.0 + N[(x * N[(N[(1.0 / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e-90], N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / y), $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 -8.2 \cdot 10^{-179}:\\
\;\;\;\;1 + x \cdot \frac{\frac{1}{z}}{y - t}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-90}:\\
\;\;\;\;1 + \frac{\frac{x}{z - y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -8.2e-179Initial program 99.9%
*-un-lft-identity99.9%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 83.6%
mul-1-neg83.6%
associate-/r*82.6%
distribute-neg-frac282.6%
Simplified82.6%
Taylor expanded in x around 0 83.6%
clear-num83.6%
associate-/r/83.6%
associate-/r*83.6%
Applied egg-rr83.6%
if -8.2e-179 < t < 5.00000000000000019e-90Initial program 98.6%
Taylor expanded in t around 0 91.7%
*-commutative91.7%
associate-/r*92.3%
Simplified92.3%
if 5.00000000000000019e-90 < t Initial program 99.9%
*-un-lft-identity99.9%
times-frac99.9%
Applied egg-rr99.9%
associate-*l/99.9%
*-un-lft-identity99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 98.5%
mul-1-neg98.5%
distribute-neg-frac298.5%
Simplified98.5%
Final simplification90.6%
(FPCore (x y z t) :precision binary64 (if (<= y -1.8e-24) 1.0 (if (<= y 9.2e-61) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.8e-24) {
tmp = 1.0;
} else if (y <= 9.2e-61) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
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-24)) then
tmp = 1.0d0
else if (y <= 9.2d-61) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.8e-24) {
tmp = 1.0;
} else if (y <= 9.2e-61) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.8e-24: tmp = 1.0 elif y <= 9.2e-61: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.8e-24) tmp = 1.0; elseif (y <= 9.2e-61) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.8e-24) tmp = 1.0; elseif (y <= 9.2e-61) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.8e-24], 1.0, If[LessEqual[y, 9.2e-61], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-24}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-61}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.8e-24 or 9.19999999999999967e-61 < y Initial program 99.9%
Taylor expanded in t around inf 73.9%
associate-*r/73.9%
neg-mul-173.9%
Simplified73.9%
Taylor expanded in y around inf 68.9%
Taylor expanded in x around 0 86.6%
if -1.8e-24 < y < 9.19999999999999967e-61Initial program 99.1%
Taylor expanded in y around 0 77.9%
Final simplification82.5%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
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
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.5%
Taylor expanded in t around inf 81.0%
associate-*r/81.0%
neg-mul-181.0%
Simplified81.0%
Taylor expanded in y around inf 56.7%
Taylor expanded in x around 0 72.3%
Final simplification72.3%
herbie shell --seed 2024053
(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)))))