
(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 14 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 t)) (/ -1.0 (- y z)))))
double code(double x, double y, double z, double t) {
return 1.0 + ((x / (y - t)) * (-1.0 / (y - 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 = 1.0d0 + ((x / (y - t)) * ((-1.0d0) / (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + ((x / (y - t)) * (-1.0 / (y - z)));
}
def code(x, y, z, t): return 1.0 + ((x / (y - t)) * (-1.0 / (y - z)))
function code(x, y, z, t) return Float64(1.0 + Float64(Float64(x / Float64(y - t)) * Float64(-1.0 / Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = 1.0 + ((x / (y - t)) * (-1.0 / (y - z))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{x}{y - t} \cdot \frac{-1}{y - z}
\end{array}
Initial program 99.2%
associate-/l/99.9%
div-inv99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.18e-116) (not (<= y 4.4e-87))) (- 1.0 (/ x (* y (- y z)))) (+ 1.0 (/ -1.0 (* z (/ t x))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.18e-116) || !(y <= 4.4e-87)) {
tmp = 1.0 - (x / (y * (y - z)));
} 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 <= (-1.18d-116)) .or. (.not. (y <= 4.4d-87))) then
tmp = 1.0d0 - (x / (y * (y - z)))
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 <= -1.18e-116) || !(y <= 4.4e-87)) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 + (-1.0 / (z * (t / x)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.18e-116) or not (y <= 4.4e-87): tmp = 1.0 - (x / (y * (y - z))) else: tmp = 1.0 + (-1.0 / (z * (t / x))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.18e-116) || !(y <= 4.4e-87)) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); else tmp = Float64(1.0 + Float64(-1.0 / Float64(z * Float64(t / x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.18e-116) || ~((y <= 4.4e-87))) tmp = 1.0 - (x / (y * (y - z))); else tmp = 1.0 + (-1.0 / (z * (t / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.18e-116], N[Not[LessEqual[y, 4.4e-87]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / N[(z * N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.18 \cdot 10^{-116} \lor \neg \left(y \leq 4.4 \cdot 10^{-87}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{z \cdot \frac{t}{x}}\\
\end{array}
\end{array}
if y < -1.1800000000000001e-116 or 4.39999999999999976e-87 < y Initial program 99.9%
Taylor expanded in t around 0 89.1%
if -1.1800000000000001e-116 < y < 4.39999999999999976e-87Initial program 97.4%
Taylor expanded in y around 0 84.0%
associate-/r*84.2%
clear-num84.2%
inv-pow84.2%
div-inv84.2%
clear-num84.2%
Applied egg-rr84.2%
unpow-184.2%
Simplified84.2%
Final simplification87.7%
(FPCore (x y z t) :precision binary64 (if (<= y -1.85e-5) (- 1.0 (/ x (* y y))) (if (<= y 3.7e-66) (+ 1.0 (* (/ x t) (/ -1.0 z))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.85e-5) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 3.7e-66) {
tmp = 1.0 + ((x / t) * (-1.0 / z));
} 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.85d-5)) then
tmp = 1.0d0 - (x / (y * y))
else if (y <= 3.7d-66) then
tmp = 1.0d0 + ((x / t) * ((-1.0d0) / z))
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.85e-5) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 3.7e-66) {
tmp = 1.0 + ((x / t) * (-1.0 / z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.85e-5: tmp = 1.0 - (x / (y * y)) elif y <= 3.7e-66: tmp = 1.0 + ((x / t) * (-1.0 / z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.85e-5) tmp = Float64(1.0 - Float64(x / Float64(y * y))); elseif (y <= 3.7e-66) tmp = Float64(1.0 + Float64(Float64(x / t) * Float64(-1.0 / z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.85e-5) tmp = 1.0 - (x / (y * y)); elseif (y <= 3.7e-66) tmp = 1.0 + ((x / t) * (-1.0 / z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.85e-5], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.7e-66], N[(1.0 + N[(N[(x / t), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-5}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-66}:\\
\;\;\;\;1 + \frac{x}{t} \cdot \frac{-1}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.84999999999999991e-5Initial program 99.9%
Taylor expanded in y around inf 92.3%
unpow292.3%
Simplified92.3%
if -1.84999999999999991e-5 < y < 3.7000000000000002e-66Initial program 98.0%
Taylor expanded in y around 0 75.5%
associate-/r*75.7%
div-inv75.7%
Applied egg-rr75.7%
if 3.7000000000000002e-66 < y Initial program 99.9%
Taylor expanded in t around 0 92.1%
Taylor expanded in x around 0 90.0%
Final simplification84.8%
(FPCore (x y z t) :precision binary64 (if (<= y -3.3e-14) (- 1.0 (/ x (* y y))) (if (<= y 3.8e-66) (+ 1.0 (/ -1.0 (* z (/ t x)))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.3e-14) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 3.8e-66) {
tmp = 1.0 + (-1.0 / (z * (t / x)));
} 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 <= (-3.3d-14)) then
tmp = 1.0d0 - (x / (y * y))
else if (y <= 3.8d-66) then
tmp = 1.0d0 + ((-1.0d0) / (z * (t / x)))
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 <= -3.3e-14) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 3.8e-66) {
tmp = 1.0 + (-1.0 / (z * (t / x)));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.3e-14: tmp = 1.0 - (x / (y * y)) elif y <= 3.8e-66: tmp = 1.0 + (-1.0 / (z * (t / x))) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.3e-14) tmp = Float64(1.0 - Float64(x / Float64(y * y))); elseif (y <= 3.8e-66) tmp = Float64(1.0 + Float64(-1.0 / Float64(z * Float64(t / x)))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.3e-14) tmp = 1.0 - (x / (y * y)); elseif (y <= 3.8e-66) tmp = 1.0 + (-1.0 / (z * (t / x))); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.3e-14], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e-66], N[(1.0 + N[(-1.0 / N[(z * N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-14}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-66}:\\
\;\;\;\;1 + \frac{-1}{z \cdot \frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.2999999999999998e-14Initial program 99.9%
Taylor expanded in y around inf 92.3%
unpow292.3%
Simplified92.3%
if -3.2999999999999998e-14 < y < 3.7999999999999998e-66Initial program 98.0%
Taylor expanded in y around 0 75.5%
associate-/r*75.7%
clear-num75.7%
inv-pow75.7%
div-inv75.7%
clear-num75.7%
Applied egg-rr75.7%
unpow-175.7%
Simplified75.7%
if 3.7999999999999998e-66 < y Initial program 99.9%
Taylor expanded in t around 0 92.1%
Taylor expanded in x around 0 90.0%
Final simplification84.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.8e-116)
(- 1.0 (/ x (* y (- y z))))
(if (<= y 1.25e-87)
(+ 1.0 (/ -1.0 (* z (/ t x))))
(- 1.0 (/ (/ x y) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.8e-116) {
tmp = 1.0 - (x / (y * (y - z)));
} else if (y <= 1.25e-87) {
tmp = 1.0 + (-1.0 / (z * (t / x)));
} else {
tmp = 1.0 - ((x / y) / (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 (y <= (-1.8d-116)) then
tmp = 1.0d0 - (x / (y * (y - z)))
else if (y <= 1.25d-87) then
tmp = 1.0d0 + ((-1.0d0) / (z * (t / x)))
else
tmp = 1.0d0 - ((x / y) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.8e-116) {
tmp = 1.0 - (x / (y * (y - z)));
} else if (y <= 1.25e-87) {
tmp = 1.0 + (-1.0 / (z * (t / x)));
} else {
tmp = 1.0 - ((x / y) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.8e-116: tmp = 1.0 - (x / (y * (y - z))) elif y <= 1.25e-87: tmp = 1.0 + (-1.0 / (z * (t / x))) else: tmp = 1.0 - ((x / y) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.8e-116) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); elseif (y <= 1.25e-87) tmp = Float64(1.0 + Float64(-1.0 / Float64(z * Float64(t / x)))); else tmp = Float64(1.0 - Float64(Float64(x / y) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.8e-116) tmp = 1.0 - (x / (y * (y - z))); elseif (y <= 1.25e-87) tmp = 1.0 + (-1.0 / (z * (t / x))); else tmp = 1.0 - ((x / y) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.8e-116], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e-87], N[(1.0 + N[(-1.0 / N[(z * N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-116}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-87}:\\
\;\;\;\;1 + \frac{-1}{z \cdot \frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - z}\\
\end{array}
\end{array}
if y < -1.79999999999999988e-116Initial program 99.9%
Taylor expanded in t around 0 86.9%
if -1.79999999999999988e-116 < y < 1.25000000000000011e-87Initial program 97.4%
Taylor expanded in y around 0 84.0%
associate-/r*84.2%
clear-num84.2%
inv-pow84.2%
div-inv84.2%
clear-num84.2%
Applied egg-rr84.2%
unpow-184.2%
Simplified84.2%
if 1.25000000000000011e-87 < y Initial program 99.9%
Taylor expanded in t around 0 91.4%
associate-/r*91.4%
Simplified91.4%
Final simplification87.7%
(FPCore (x y z t)
:precision binary64
(if (<= t -2.9e-218)
(+ 1.0 (/ x (* (- y t) z)))
(if (<= t 6.2e-93)
(- 1.0 (/ x (* y (- y z))))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.9e-218) {
tmp = 1.0 + (x / ((y - t) * z));
} else if (t <= 6.2e-93) {
tmp = 1.0 - (x / (y * (y - z)));
} 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 <= (-2.9d-218)) then
tmp = 1.0d0 + (x / ((y - t) * z))
else if (t <= 6.2d-93) then
tmp = 1.0d0 - (x / (y * (y - z)))
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 <= -2.9e-218) {
tmp = 1.0 + (x / ((y - t) * z));
} else if (t <= 6.2e-93) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.9e-218: tmp = 1.0 + (x / ((y - t) * z)) elif t <= 6.2e-93: tmp = 1.0 - (x / (y * (y - z))) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.9e-218) tmp = Float64(1.0 + Float64(x / Float64(Float64(y - t) * z))); elseif (t <= 6.2e-93) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); 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 <= -2.9e-218) tmp = 1.0 + (x / ((y - t) * z)); elseif (t <= 6.2e-93) tmp = 1.0 - (x / (y * (y - z))); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.9e-218], N[(1.0 + N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e-93], N[(1.0 - N[(x / N[(y * N[(y - z), $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 -2.9 \cdot 10^{-218}:\\
\;\;\;\;1 + \frac{x}{\left(y - t\right) \cdot z}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-93}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if t < -2.9000000000000002e-218Initial program 99.9%
Taylor expanded in z around inf 79.0%
associate-*r/79.0%
neg-mul-179.0%
Simplified79.0%
if -2.9000000000000002e-218 < t < 6.19999999999999999e-93Initial program 96.9%
Taylor expanded in t around 0 90.8%
if 6.19999999999999999e-93 < t Initial program 99.9%
Taylor expanded in t around inf 96.2%
mul-1-neg96.2%
distribute-frac-neg96.2%
associate-/r*96.3%
Simplified96.3%
Final simplification87.3%
(FPCore (x y z t) :precision binary64 (if (<= y -4.3e-62) 1.0 (if (<= y 2.6e-66) (- 1.0 (/ x (* t z))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.3e-62) {
tmp = 1.0;
} else if (y <= 2.6e-66) {
tmp = 1.0 - (x / (t * z));
} 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 <= (-4.3d-62)) then
tmp = 1.0d0
else if (y <= 2.6d-66) then
tmp = 1.0d0 - (x / (t * z))
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 <= -4.3e-62) {
tmp = 1.0;
} else if (y <= 2.6e-66) {
tmp = 1.0 - (x / (t * z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.3e-62: tmp = 1.0 elif y <= 2.6e-66: tmp = 1.0 - (x / (t * z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.3e-62) tmp = 1.0; elseif (y <= 2.6e-66) tmp = Float64(1.0 - Float64(x / Float64(t * z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.3e-62) tmp = 1.0; elseif (y <= 2.6e-66) tmp = 1.0 - (x / (t * z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.3e-62], 1.0, If[LessEqual[y, 2.6e-66], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{-62}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-66}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -4.2999999999999997e-62 or 2.5999999999999999e-66 < y Initial program 99.9%
Taylor expanded in t around 0 92.3%
Taylor expanded in x around 0 87.5%
if -4.2999999999999997e-62 < y < 2.5999999999999999e-66Initial program 97.8%
Taylor expanded in y around 0 78.9%
Final simplification84.4%
(FPCore (x y z t) :precision binary64 (if (<= y -3.1e-9) (- 1.0 (/ x (* y y))) (if (<= y 3.4e-66) (- 1.0 (/ x (* t z))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e-9) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 3.4e-66) {
tmp = 1.0 - (x / (t * z));
} 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 <= (-3.1d-9)) then
tmp = 1.0d0 - (x / (y * y))
else if (y <= 3.4d-66) then
tmp = 1.0d0 - (x / (t * z))
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 <= -3.1e-9) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 3.4e-66) {
tmp = 1.0 - (x / (t * z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.1e-9: tmp = 1.0 - (x / (y * y)) elif y <= 3.4e-66: tmp = 1.0 - (x / (t * z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.1e-9) tmp = Float64(1.0 - Float64(x / Float64(y * y))); elseif (y <= 3.4e-66) tmp = Float64(1.0 - Float64(x / Float64(t * z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.1e-9) tmp = 1.0 - (x / (y * y)); elseif (y <= 3.4e-66) tmp = 1.0 - (x / (t * z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.1e-9], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e-66], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-9}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-66}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.10000000000000005e-9Initial program 99.9%
Taylor expanded in y around inf 92.3%
unpow292.3%
Simplified92.3%
if -3.10000000000000005e-9 < y < 3.39999999999999997e-66Initial program 98.0%
Taylor expanded in y around 0 75.5%
if 3.39999999999999997e-66 < y Initial program 99.9%
Taylor expanded in t around 0 92.1%
Taylor expanded in x around 0 90.0%
Final simplification84.7%
(FPCore (x y z t) :precision binary64 (if (<= y -0.00033) (- 1.0 (/ x (* y y))) (if (<= y 1e-65) (- 1.0 (/ (/ x t) z)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -0.00033) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 1e-65) {
tmp = 1.0 - ((x / t) / z);
} 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 <= (-0.00033d0)) then
tmp = 1.0d0 - (x / (y * y))
else if (y <= 1d-65) then
tmp = 1.0d0 - ((x / t) / z)
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 <= -0.00033) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 1e-65) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -0.00033: tmp = 1.0 - (x / (y * y)) elif y <= 1e-65: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -0.00033) tmp = Float64(1.0 - Float64(x / Float64(y * y))); elseif (y <= 1e-65) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -0.00033) tmp = 1.0 - (x / (y * y)); elseif (y <= 1e-65) tmp = 1.0 - ((x / t) / z); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -0.00033], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e-65], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00033:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{elif}\;y \leq 10^{-65}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.3e-4Initial program 99.9%
Taylor expanded in y around inf 92.3%
unpow292.3%
Simplified92.3%
if -3.3e-4 < y < 9.99999999999999923e-66Initial program 98.0%
Taylor expanded in y around 0 75.5%
associate-/r*75.7%
Simplified75.7%
if 9.99999999999999923e-66 < y Initial program 99.9%
Taylor expanded in t around 0 92.1%
Taylor expanded in x around 0 90.0%
Final simplification84.8%
(FPCore (x y z t) :precision binary64 (if (<= z -3.9e-60) (+ 1.0 (/ x (* (- y t) z))) (- 1.0 (/ (/ x y) (- y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.9e-60) {
tmp = 1.0 + (x / ((y - t) * z));
} else {
tmp = 1.0 - ((x / y) / (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 <= (-3.9d-60)) then
tmp = 1.0d0 + (x / ((y - t) * z))
else
tmp = 1.0d0 - ((x / y) / (y - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.9e-60) {
tmp = 1.0 + (x / ((y - t) * z));
} else {
tmp = 1.0 - ((x / y) / (y - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.9e-60: tmp = 1.0 + (x / ((y - t) * z)) else: tmp = 1.0 - ((x / y) / (y - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.9e-60) tmp = Float64(1.0 + Float64(x / Float64(Float64(y - t) * z))); else tmp = Float64(1.0 - Float64(Float64(x / y) / Float64(y - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.9e-60) tmp = 1.0 + (x / ((y - t) * z)); else tmp = 1.0 - ((x / y) / (y - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.9e-60], N[(1.0 + N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{-60}:\\
\;\;\;\;1 + \frac{x}{\left(y - t\right) \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - t}\\
\end{array}
\end{array}
if z < -3.9000000000000002e-60Initial program 99.9%
Taylor expanded in z around inf 96.6%
associate-*r/96.6%
neg-mul-196.6%
Simplified96.6%
if -3.9000000000000002e-60 < z Initial program 98.8%
Taylor expanded in z around 0 82.4%
associate-/l/82.4%
Simplified82.4%
Final simplification87.1%
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y t) (- y z)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - t) * (y - 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 = 1.0d0 - (x / ((y - t) * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - t) * (y - z)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - t) * (y - z)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - t) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - t) * (y - z))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - t\right) \cdot \left(y - z\right)}
\end{array}
Initial program 99.2%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (- 1.0 (/ (/ x (- y t)) (- y z))))
double code(double x, double y, double z, double t) {
return 1.0 - ((x / (y - t)) / (y - 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 = 1.0d0 - ((x / (y - t)) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - ((x / (y - t)) / (y - z));
}
def code(x, y, z, t): return 1.0 - ((x / (y - t)) / (y - z))
function code(x, y, z, t) return Float64(1.0 - Float64(Float64(x / Float64(y - t)) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = 1.0 - ((x / (y - t)) / (y - z)); end
code[x_, y_, z_, t_] := N[(1.0 - N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{\frac{x}{y - t}}{y - z}
\end{array}
Initial program 99.2%
associate-/l/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (<= t 3.1e-180) (+ 1.0 (/ x (* y z))) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.1e-180) {
tmp = 1.0 + (x / (y * z));
} 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 <= 3.1d-180) then
tmp = 1.0d0 + (x / (y * z))
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 <= 3.1e-180) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 3.1e-180: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 3.1e-180) tmp = Float64(1.0 + Float64(x / Float64(y * z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 3.1e-180) tmp = 1.0 + (x / (y * z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 3.1e-180], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.1 \cdot 10^{-180}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < 3.0999999999999999e-180Initial program 98.7%
Taylor expanded in t around 0 75.9%
Taylor expanded in z around inf 58.6%
if 3.0999999999999999e-180 < t Initial program 99.9%
Taylor expanded in t around 0 68.6%
Taylor expanded in x around 0 81.2%
Final simplification67.8%
(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.2%
Taylor expanded in t around 0 72.9%
Taylor expanded in x around 0 75.3%
Final simplification75.3%
herbie shell --seed 2023185
(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)))))