
(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 11 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.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.9e+94)
(+ 1.0 (/ x (* y z)))
(if (or (<= z -9.5e-81) (and (not (<= z -1.45e-223)) (<= z -4.8e-235)))
(- 1.0 (/ x (* z t)))
(+ 1.0 (/ x (* y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.9e+94) {
tmp = 1.0 + (x / (y * z));
} else if ((z <= -9.5e-81) || (!(z <= -1.45e-223) && (z <= -4.8e-235))) {
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 (z <= (-1.9d+94)) then
tmp = 1.0d0 + (x / (y * z))
else if ((z <= (-9.5d-81)) .or. (.not. (z <= (-1.45d-223))) .and. (z <= (-4.8d-235))) 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 (z <= -1.9e+94) {
tmp = 1.0 + (x / (y * z));
} else if ((z <= -9.5e-81) || (!(z <= -1.45e-223) && (z <= -4.8e-235))) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 + (x / (y * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.9e+94: tmp = 1.0 + (x / (y * z)) elif (z <= -9.5e-81) or (not (z <= -1.45e-223) and (z <= -4.8e-235)): 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 (z <= -1.9e+94) tmp = Float64(1.0 + Float64(x / Float64(y * z))); elseif ((z <= -9.5e-81) || (!(z <= -1.45e-223) && (z <= -4.8e-235))) 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 (z <= -1.9e+94) tmp = 1.0 + (x / (y * z)); elseif ((z <= -9.5e-81) || (~((z <= -1.45e-223)) && (z <= -4.8e-235))) 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[z, -1.9e+94], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -9.5e-81], And[N[Not[LessEqual[z, -1.45e-223]], $MachinePrecision], LessEqual[z, -4.8e-235]]], 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}\;z \leq -1.9 \cdot 10^{+94}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-81} \lor \neg \left(z \leq -1.45 \cdot 10^{-223}\right) \land z \leq -4.8 \cdot 10^{-235}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.8999999999999998e94Initial program 99.9%
Taylor expanded in t around 0 95.3%
Taylor expanded in y around 0 95.3%
associate-*r/95.3%
neg-mul-195.3%
*-commutative95.3%
Simplified95.3%
if -1.8999999999999998e94 < z < -9.49999999999999917e-81 or -1.45e-223 < z < -4.80000000000000022e-235Initial program 100.0%
Taylor expanded in y around 0 70.9%
if -9.49999999999999917e-81 < z < -1.45e-223 or -4.80000000000000022e-235 < z Initial program 99.9%
Taylor expanded in z around 0 78.5%
Taylor expanded in y around 0 58.6%
mul-1-neg58.6%
distribute-neg-frac258.6%
distribute-rgt-neg-in58.6%
Simplified58.6%
Final simplification66.6%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.4e+94)
(- 1.0 (* x (/ -1.0 (* y z))))
(if (or (<= z -7.9e-81) (and (not (<= z -1.45e-223)) (<= z -4.8e-235)))
(- 1.0 (/ x (* z t)))
(+ 1.0 (/ x (* y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.4e+94) {
tmp = 1.0 - (x * (-1.0 / (y * z)));
} else if ((z <= -7.9e-81) || (!(z <= -1.45e-223) && (z <= -4.8e-235))) {
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 (z <= (-2.4d+94)) then
tmp = 1.0d0 - (x * ((-1.0d0) / (y * z)))
else if ((z <= (-7.9d-81)) .or. (.not. (z <= (-1.45d-223))) .and. (z <= (-4.8d-235))) 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 (z <= -2.4e+94) {
tmp = 1.0 - (x * (-1.0 / (y * z)));
} else if ((z <= -7.9e-81) || (!(z <= -1.45e-223) && (z <= -4.8e-235))) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 + (x / (y * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.4e+94: tmp = 1.0 - (x * (-1.0 / (y * z))) elif (z <= -7.9e-81) or (not (z <= -1.45e-223) and (z <= -4.8e-235)): 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 (z <= -2.4e+94) tmp = Float64(1.0 - Float64(x * Float64(-1.0 / Float64(y * z)))); elseif ((z <= -7.9e-81) || (!(z <= -1.45e-223) && (z <= -4.8e-235))) 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 (z <= -2.4e+94) tmp = 1.0 - (x * (-1.0 / (y * z))); elseif ((z <= -7.9e-81) || (~((z <= -1.45e-223)) && (z <= -4.8e-235))) 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[z, -2.4e+94], N[(1.0 - N[(x * N[(-1.0 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -7.9e-81], And[N[Not[LessEqual[z, -1.45e-223]], $MachinePrecision], LessEqual[z, -4.8e-235]]], 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}\;z \leq -2.4 \cdot 10^{+94}:\\
\;\;\;\;1 - x \cdot \frac{-1}{y \cdot z}\\
\mathbf{elif}\;z \leq -7.9 \cdot 10^{-81} \lor \neg \left(z \leq -1.45 \cdot 10^{-223}\right) \land z \leq -4.8 \cdot 10^{-235}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -2.39999999999999983e94Initial program 99.9%
clear-num99.9%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 99.9%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in y around inf 95.4%
*-commutative95.4%
Simplified95.4%
if -2.39999999999999983e94 < z < -7.90000000000000016e-81 or -1.45e-223 < z < -4.80000000000000022e-235Initial program 100.0%
Taylor expanded in y around 0 70.9%
if -7.90000000000000016e-81 < z < -1.45e-223 or -4.80000000000000022e-235 < z Initial program 99.9%
Taylor expanded in z around 0 78.5%
Taylor expanded in y around 0 58.6%
mul-1-neg58.6%
distribute-neg-frac258.6%
distribute-rgt-neg-in58.6%
Simplified58.6%
Final simplification66.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ 1.0 (/ x (* y t)))))
(if (<= y -2200000000000.0)
t_1
(if (<= y -6.2e-68)
(- 1.0 (/ x (* y z)))
(if (<= y 3.2e-7) (- 1.0 (/ x (* z t))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 + (x / (y * t));
double tmp;
if (y <= -2200000000000.0) {
tmp = t_1;
} else if (y <= -6.2e-68) {
tmp = 1.0 - (x / (y * z));
} else if (y <= 3.2e-7) {
tmp = 1.0 - (x / (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 = 1.0d0 + (x / (y * t))
if (y <= (-2200000000000.0d0)) then
tmp = t_1
else if (y <= (-6.2d-68)) then
tmp = 1.0d0 - (x / (y * z))
else if (y <= 3.2d-7) then
tmp = 1.0d0 - (x / (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 = 1.0 + (x / (y * t));
double tmp;
if (y <= -2200000000000.0) {
tmp = t_1;
} else if (y <= -6.2e-68) {
tmp = 1.0 - (x / (y * z));
} else if (y <= 3.2e-7) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 + (x / (y * t)) tmp = 0 if y <= -2200000000000.0: tmp = t_1 elif y <= -6.2e-68: tmp = 1.0 - (x / (y * z)) elif y <= 3.2e-7: tmp = 1.0 - (x / (z * t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 + Float64(x / Float64(y * t))) tmp = 0.0 if (y <= -2200000000000.0) tmp = t_1; elseif (y <= -6.2e-68) tmp = Float64(1.0 - Float64(x / Float64(y * z))); elseif (y <= 3.2e-7) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 + (x / (y * t)); tmp = 0.0; if (y <= -2200000000000.0) tmp = t_1; elseif (y <= -6.2e-68) tmp = 1.0 - (x / (y * z)); elseif (y <= 3.2e-7) tmp = 1.0 - (x / (z * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2200000000000.0], t$95$1, If[LessEqual[y, -6.2e-68], N[(1.0 - N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-7], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 + \frac{x}{y \cdot t}\\
\mathbf{if}\;y \leq -2200000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6.2 \cdot 10^{-68}:\\
\;\;\;\;1 - \frac{x}{y \cdot z}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-7}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.2e12 or 3.2000000000000001e-7 < y Initial program 100.0%
Taylor expanded in z around 0 97.4%
Taylor expanded in y around 0 72.9%
mul-1-neg72.9%
distribute-neg-frac272.9%
distribute-rgt-neg-in72.9%
Simplified72.9%
if -2.2e12 < y < -6.1999999999999999e-68Initial program 100.0%
clear-num99.9%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 65.2%
associate-/r*65.2%
Simplified65.2%
Taylor expanded in y around inf 57.5%
*-commutative57.5%
Simplified57.5%
associate-*l/57.5%
neg-mul-157.5%
add-sqr-sqrt35.9%
sqrt-unprod53.2%
sqr-neg53.2%
sqrt-unprod21.4%
*-commutative21.4%
add-sqr-sqrt57.7%
Applied egg-rr57.7%
if -6.1999999999999999e-68 < y < 3.2000000000000001e-7Initial program 99.7%
Taylor expanded in y around 0 76.1%
Final simplification73.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -9.2e-74) (not (<= y 2.9e-101))) (+ 1.0 (/ x (* y (- t y)))) (- 1.0 (/ x (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9.2e-74) || !(y <= 2.9e-101)) {
tmp = 1.0 + (x / (y * (t - y)));
} 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 <= (-9.2d-74)) .or. (.not. (y <= 2.9d-101))) then
tmp = 1.0d0 + (x / (y * (t - y)))
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 <= -9.2e-74) || !(y <= 2.9e-101)) {
tmp = 1.0 + (x / (y * (t - y)));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9.2e-74) or not (y <= 2.9e-101): tmp = 1.0 + (x / (y * (t - y))) else: tmp = 1.0 - (x / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9.2e-74) || !(y <= 2.9e-101)) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); 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 <= -9.2e-74) || ~((y <= 2.9e-101))) tmp = 1.0 + (x / (y * (t - y))); else tmp = 1.0 - (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9.2e-74], N[Not[LessEqual[y, 2.9e-101]], $MachinePrecision]], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{-74} \lor \neg \left(y \leq 2.9 \cdot 10^{-101}\right):\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -9.19999999999999922e-74 or 2.9e-101 < y Initial program 100.0%
Taylor expanded in z around 0 88.4%
if -9.19999999999999922e-74 < y < 2.9e-101Initial program 99.6%
Taylor expanded in y around 0 84.8%
Final simplification87.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.8e-142) (not (<= y 5.2e-130))) (+ 1.0 (/ x (* y (- z y)))) (- 1.0 (/ x (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.8e-142) || !(y <= 5.2e-130)) {
tmp = 1.0 + (x / (y * (z - y)));
} 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 <= (-1.8d-142)) .or. (.not. (y <= 5.2d-130))) then
tmp = 1.0d0 + (x / (y * (z - y)))
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 <= -1.8e-142) || !(y <= 5.2e-130)) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.8e-142) or not (y <= 5.2e-130): tmp = 1.0 + (x / (y * (z - y))) else: tmp = 1.0 - (x / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.8e-142) || !(y <= 5.2e-130)) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); 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 <= -1.8e-142) || ~((y <= 5.2e-130))) tmp = 1.0 + (x / (y * (z - y))); else tmp = 1.0 - (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.8e-142], N[Not[LessEqual[y, 5.2e-130]], $MachinePrecision]], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-142} \lor \neg \left(y \leq 5.2 \cdot 10^{-130}\right):\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -1.8e-142 or 5.2000000000000001e-130 < y Initial program 100.0%
Taylor expanded in t around 0 89.4%
if -1.8e-142 < y < 5.2000000000000001e-130Initial program 99.5%
Taylor expanded in y around 0 89.4%
Final simplification89.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4e-66) (not (<= y 1.1e-16))) (- 1.0 (/ x (* y z))) (- 1.0 (/ x (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4e-66) || !(y <= 1.1e-16)) {
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 <= (-4d-66)) .or. (.not. (y <= 1.1d-16))) 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 <= -4e-66) || !(y <= 1.1e-16)) {
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 <= -4e-66) or not (y <= 1.1e-16): 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 <= -4e-66) || !(y <= 1.1e-16)) 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 <= -4e-66) || ~((y <= 1.1e-16))) 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, -4e-66], N[Not[LessEqual[y, 1.1e-16]], $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 -4 \cdot 10^{-66} \lor \neg \left(y \leq 1.1 \cdot 10^{-16}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -3.9999999999999999e-66 or 1.1e-16 < y Initial program 100.0%
clear-num100.0%
associate-/r/100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 73.9%
associate-/r*73.9%
Simplified73.9%
Taylor expanded in y around inf 69.6%
*-commutative69.6%
Simplified69.6%
associate-*l/69.6%
neg-mul-169.6%
add-sqr-sqrt29.8%
sqrt-unprod57.9%
sqr-neg57.9%
sqrt-unprod39.0%
*-commutative39.0%
add-sqr-sqrt69.0%
Applied egg-rr69.0%
if -3.9999999999999999e-66 < y < 1.1e-16Initial program 99.7%
Taylor expanded in y around 0 77.2%
Final simplification72.3%
(FPCore (x y z t) :precision binary64 (if (<= z -9.5e-44) (+ 1.0 (* x (/ (/ -1.0 z) (- t y)))) (- 1.0 (/ (/ x (- y t)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9.5e-44) {
tmp = 1.0 + (x * ((-1.0 / z) / (t - y)));
} 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-44)) then
tmp = 1.0d0 + (x * (((-1.0d0) / z) / (t - y)))
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-44) {
tmp = 1.0 + (x * ((-1.0 / z) / (t - y)));
} else {
tmp = 1.0 - ((x / (y - t)) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -9.5e-44: tmp = 1.0 + (x * ((-1.0 / z) / (t - y))) else: tmp = 1.0 - ((x / (y - t)) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -9.5e-44) tmp = Float64(1.0 + Float64(x * Float64(Float64(-1.0 / z) / Float64(t - y)))); else tmp = Float64(1.0 - Float64(Float64(x / Float64(y - t)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -9.5e-44) tmp = 1.0 + (x * ((-1.0 / z) / (t - y))); else tmp = 1.0 - ((x / (y - t)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -9.5e-44], N[(1.0 + N[(x * N[(N[(-1.0 / z), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-44}:\\
\;\;\;\;1 + x \cdot \frac{\frac{-1}{z}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\
\end{array}
\end{array}
if z < -9.49999999999999924e-44Initial program 99.9%
clear-num99.9%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 95.9%
associate-/r*95.9%
Simplified95.9%
if -9.49999999999999924e-44 < z Initial program 99.9%
Taylor expanded in z around 0 77.6%
*-un-lft-identity77.6%
times-frac77.7%
Applied egg-rr77.7%
associate-*l/77.7%
*-lft-identity77.7%
Simplified77.7%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (<= z -7.5e-42) (+ 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 <= -7.5e-42) {
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 <= (-7.5d-42)) 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 <= -7.5e-42) {
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 <= -7.5e-42: 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 <= -7.5e-42) tmp = Float64(1.0 + Float64(Float64(x / 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 <= -7.5e-42) 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[LessEqual[z, -7.5e-42], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $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 -7.5 \cdot 10^{-42}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\end{array}
\end{array}
if z < -7.49999999999999972e-42Initial program 99.9%
sub-neg99.9%
distribute-lft-in94.2%
Applied egg-rr94.2%
Taylor expanded in z around inf 95.9%
associate-/r*95.9%
neg-mul-195.9%
unsub-neg95.9%
Simplified95.9%
if -7.49999999999999972e-42 < z Initial program 99.9%
Taylor expanded in z around 0 77.6%
Final simplification82.6%
(FPCore (x y z t) :precision binary64 (if (<= z -4.6e-43) (+ 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 <= -4.6e-43) {
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 <= (-4.6d-43)) 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 <= -4.6e-43) {
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 <= -4.6e-43: 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 <= -4.6e-43) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); else tmp = Float64(1.0 - Float64(Float64(x / Float64(y - t)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.6e-43) 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[LessEqual[z, -4.6e-43], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-43}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\
\end{array}
\end{array}
if z < -4.5999999999999998e-43Initial program 99.9%
sub-neg99.9%
distribute-lft-in94.2%
Applied egg-rr94.2%
Taylor expanded in z around inf 95.9%
associate-/r*95.9%
neg-mul-195.9%
unsub-neg95.9%
Simplified95.9%
if -4.5999999999999998e-43 < z Initial program 99.9%
Taylor expanded in z around 0 77.6%
*-un-lft-identity77.6%
times-frac77.7%
Applied egg-rr77.7%
associate-*l/77.7%
*-lft-identity77.7%
Simplified77.7%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* z t))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / (z * 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 / (z * t))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / (z * t));
}
def code(x, y, z, t): return 1.0 - (x / (z * t))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(z * t))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / (z * t)); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{z \cdot t}
\end{array}
Initial program 99.9%
Taylor expanded in y around 0 60.2%
Final simplification60.2%
herbie shell --seed 2024071
(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)))))