
(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) (- 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}
Initial program 98.9%
Final simplification98.9%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.15e-137)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 3.2e-145)
(+ 1.0 (/ -1.0 (* y (/ (- y z) x))))
(+ 1.0 (/ x (* (- y z) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.15e-137) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 3.2e-145) {
tmp = 1.0 + (-1.0 / (y * ((y - z) / x)));
} 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.15d-137)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 3.2d-145) then
tmp = 1.0d0 + ((-1.0d0) / (y * ((y - z) / x)))
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.15e-137) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 3.2e-145) {
tmp = 1.0 + (-1.0 / (y * ((y - z) / x)));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.15e-137: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 3.2e-145: tmp = 1.0 + (-1.0 / (y * ((y - z) / x))) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.15e-137) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 3.2e-145) tmp = Float64(1.0 + Float64(-1.0 / Float64(y * Float64(Float64(y - z) / x)))); 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.15e-137) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 3.2e-145) tmp = 1.0 + (-1.0 / (y * ((y - z) / x))); else tmp = 1.0 + (x / ((y - z) * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.15e-137], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e-145], N[(1.0 + N[(-1.0 / N[(y * N[(N[(y - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $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.15 \cdot 10^{-137}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-145}:\\
\;\;\;\;1 + \frac{-1}{y \cdot \frac{y - z}{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -1.15000000000000004e-137Initial program 98.2%
associate-/r*97.7%
div-inv97.7%
Applied egg-rr97.7%
Taylor expanded in z around inf 81.0%
associate-*r/81.0%
times-frac79.9%
associate-*l/79.9%
associate-*r/79.9%
neg-mul-179.9%
Simplified79.9%
if -1.15000000000000004e-137 < t < 3.20000000000000008e-145Initial program 98.5%
associate-/r*99.8%
div-inv99.8%
Applied egg-rr99.8%
clear-num99.7%
frac-times99.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 84.5%
associate-*r/85.2%
Simplified85.2%
if 3.20000000000000008e-145 < t Initial program 99.9%
Taylor expanded in t around inf 96.5%
associate-*r/96.5%
neg-mul-196.5%
Simplified96.5%
Final simplification87.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.2e-77) (not (<= y 3.15e-52))) (- 1.0 (/ x (* y (- y z)))) (- 1.0 (/ x (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.2e-77) || !(y <= 3.15e-52)) {
tmp = 1.0 - (x / (y * (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 <= (-4.2d-77)) .or. (.not. (y <= 3.15d-52))) then
tmp = 1.0d0 - (x / (y * (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 <= -4.2e-77) || !(y <= 3.15e-52)) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.2e-77) or not (y <= 3.15e-52): tmp = 1.0 - (x / (y * (y - z))) else: tmp = 1.0 - (x / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.2e-77) || !(y <= 3.15e-52)) tmp = Float64(1.0 - Float64(x / Float64(y * 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 <= -4.2e-77) || ~((y <= 3.15e-52))) tmp = 1.0 - (x / (y * (y - z))); else tmp = 1.0 - (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.2e-77], N[Not[LessEqual[y, 3.15e-52]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * N[(y - z), $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 -4.2 \cdot 10^{-77} \lor \neg \left(y \leq 3.15 \cdot 10^{-52}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -4.20000000000000031e-77 or 3.1500000000000002e-52 < y Initial program 99.6%
Taylor expanded in t around 0 93.4%
if -4.20000000000000031e-77 < y < 3.1500000000000002e-52Initial program 97.8%
Taylor expanded in y around 0 75.5%
Final simplification85.9%
(FPCore (x y z t) :precision binary64 (if (<= y -6.8e-75) (- 1.0 (/ x (* y (- y t)))) (if (<= y 7e-54) (- 1.0 (/ x (* z t))) (- 1.0 (/ x (* y (- y z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e-75) {
tmp = 1.0 - (x / (y * (y - t)));
} else if (y <= 7e-54) {
tmp = 1.0 - (x / (z * t));
} 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 <= (-6.8d-75)) then
tmp = 1.0d0 - (x / (y * (y - t)))
else if (y <= 7d-54) then
tmp = 1.0d0 - (x / (z * t))
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 <= -6.8e-75) {
tmp = 1.0 - (x / (y * (y - t)));
} else if (y <= 7e-54) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 - (x / (y * (y - z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.8e-75: tmp = 1.0 - (x / (y * (y - t))) elif y <= 7e-54: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 - (x / (y * (y - z))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.8e-75) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); elseif (y <= 7e-54) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.8e-75) tmp = 1.0 - (x / (y * (y - t))); elseif (y <= 7e-54) tmp = 1.0 - (x / (z * t)); else tmp = 1.0 - (x / (y * (y - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.8e-75], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-54], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{-75}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-54}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if y < -6.8000000000000003e-75Initial program 100.0%
Taylor expanded in z around 0 90.7%
if -6.8000000000000003e-75 < y < 6.99999999999999964e-54Initial program 97.8%
Taylor expanded in y around 0 75.5%
if 6.99999999999999964e-54 < y Initial program 99.3%
Taylor expanded in t around 0 95.5%
Final simplification85.7%
(FPCore (x y z t)
:precision binary64
(if (<= t -7.6e-153)
(+ 1.0 (/ x (* z (- y t))))
(if (<= t 7.2e-146)
(- 1.0 (/ x (* y (- y z))))
(+ 1.0 (/ x (* (- y z) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -7.6e-153) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 7.2e-146) {
tmp = 1.0 - (x / (y * (y - z)));
} 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 <= (-7.6d-153)) then
tmp = 1.0d0 + (x / (z * (y - t)))
else if (t <= 7.2d-146) then
tmp = 1.0d0 - (x / (y * (y - z)))
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 <= -7.6e-153) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 7.2e-146) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -7.6e-153: tmp = 1.0 + (x / (z * (y - t))) elif t <= 7.2e-146: tmp = 1.0 - (x / (y * (y - z))) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -7.6e-153) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); elseif (t <= 7.2e-146) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); 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 <= -7.6e-153) tmp = 1.0 + (x / (z * (y - t))); elseif (t <= 7.2e-146) tmp = 1.0 - (x / (y * (y - z))); else tmp = 1.0 + (x / ((y - z) * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -7.6e-153], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e-146], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $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 -7.6 \cdot 10^{-153}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-146}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -7.60000000000000046e-153Initial program 98.2%
Taylor expanded in z around inf 81.2%
associate-*r/81.2%
neg-mul-181.2%
Simplified81.2%
if -7.60000000000000046e-153 < t < 7.19999999999999957e-146Initial program 98.4%
Taylor expanded in t around 0 84.4%
if 7.19999999999999957e-146 < t Initial program 99.9%
Taylor expanded in t around inf 96.5%
associate-*r/96.5%
neg-mul-196.5%
Simplified96.5%
Final simplification87.7%
(FPCore (x y z t)
:precision binary64
(if (<= t -5.2e-143)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 1.2e-144)
(- 1.0 (/ x (* y (- y z))))
(+ 1.0 (/ x (* (- y z) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.2e-143) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.2e-144) {
tmp = 1.0 - (x / (y * (y - z)));
} 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 <= (-5.2d-143)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 1.2d-144) then
tmp = 1.0d0 - (x / (y * (y - z)))
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 <= -5.2e-143) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.2e-144) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.2e-143: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 1.2e-144: tmp = 1.0 - (x / (y * (y - z))) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.2e-143) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 1.2e-144) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); 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 <= -5.2e-143) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 1.2e-144) tmp = 1.0 - (x / (y * (y - z))); else tmp = 1.0 + (x / ((y - z) * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.2e-143], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e-144], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $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 -5.2 \cdot 10^{-143}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-144}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -5.19999999999999974e-143Initial program 98.2%
associate-/r*97.7%
div-inv97.7%
Applied egg-rr97.7%
Taylor expanded in z around inf 81.0%
associate-*r/81.0%
times-frac79.9%
associate-*l/79.9%
associate-*r/79.9%
neg-mul-179.9%
Simplified79.9%
if -5.19999999999999974e-143 < t < 1.19999999999999997e-144Initial program 98.5%
Taylor expanded in t around 0 84.6%
if 1.19999999999999997e-144 < t Initial program 99.9%
Taylor expanded in t around inf 96.5%
associate-*r/96.5%
neg-mul-196.5%
Simplified96.5%
Final simplification87.4%
(FPCore (x y z t) :precision binary64 (if (<= y -2.1e-59) 1.0 (if (<= y 7e-54) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e-59) {
tmp = 1.0;
} else if (y <= 7e-54) {
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 <= (-2.1d-59)) then
tmp = 1.0d0
else if (y <= 7d-54) 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 <= -2.1e-59) {
tmp = 1.0;
} else if (y <= 7e-54) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.1e-59: tmp = 1.0 elif y <= 7e-54: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.1e-59) tmp = 1.0; elseif (y <= 7e-54) 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 <= -2.1e-59) tmp = 1.0; elseif (y <= 7e-54) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.1e-59], 1.0, If[LessEqual[y, 7e-54], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-59}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-54}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.09999999999999997e-59 or 6.99999999999999964e-54 < y Initial program 99.6%
Taylor expanded in z around 0 93.0%
associate-/l/93.3%
Simplified93.3%
Taylor expanded in y around 0 69.2%
associate-*r/69.2%
neg-mul-169.2%
Simplified69.2%
expm1-log1p-u67.7%
expm1-udef67.7%
add-sqr-sqrt31.6%
sqrt-unprod59.0%
sqr-neg59.0%
sqrt-unprod36.2%
add-sqr-sqrt67.0%
associate-/r*67.0%
Applied egg-rr67.0%
expm1-def67.0%
expm1-log1p68.5%
associate-/l/68.5%
Simplified68.5%
Taylor expanded in x around 0 87.7%
if -2.09999999999999997e-59 < y < 6.99999999999999964e-54Initial program 97.9%
Taylor expanded in y around 0 74.6%
Final simplification82.0%
(FPCore (x y z t) :precision binary64 (if (<= y -4.7e-54) (- 1.0 (/ x (* y y))) (if (<= y 4.2e-52) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.7e-54) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 4.2e-52) {
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 <= (-4.7d-54)) then
tmp = 1.0d0 - (x / (y * y))
else if (y <= 4.2d-52) 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 <= -4.7e-54) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 4.2e-52) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.7e-54: tmp = 1.0 - (x / (y * y)) elif y <= 4.2e-52: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.7e-54) tmp = Float64(1.0 - Float64(x / Float64(y * y))); elseif (y <= 4.2e-52) 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 <= -4.7e-54) tmp = 1.0 - (x / (y * y)); elseif (y <= 4.2e-52) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.7e-54], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e-52], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.7 \cdot 10^{-54}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-52}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -4.7e-54Initial program 100.0%
Taylor expanded in y around inf 84.7%
unpow284.7%
Simplified84.7%
if -4.7e-54 < y < 4.1999999999999997e-52Initial program 98.0%
Taylor expanded in y around 0 74.2%
if 4.1999999999999997e-52 < y Initial program 99.3%
Taylor expanded in z around 0 95.5%
associate-/l/96.1%
Simplified96.1%
Taylor expanded in y around 0 71.4%
associate-*r/71.4%
neg-mul-171.4%
Simplified71.4%
expm1-log1p-u70.5%
expm1-udef70.5%
add-sqr-sqrt31.2%
sqrt-unprod62.3%
sqr-neg62.3%
sqrt-unprod39.3%
add-sqr-sqrt70.4%
associate-/r*70.4%
Applied egg-rr70.4%
expm1-def70.4%
expm1-log1p71.3%
associate-/l/71.3%
Simplified71.3%
Taylor expanded in x around 0 91.7%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (<= t 8.5e-145) (- 1.0 (/ x (* y (- y z)))) (+ 1.0 (/ x (* (- y z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 8.5e-145) {
tmp = 1.0 - (x / (y * (y - z)));
} 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 <= 8.5d-145) then
tmp = 1.0d0 - (x / (y * (y - z)))
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 <= 8.5e-145) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 8.5e-145: tmp = 1.0 - (x / (y * (y - z))) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 8.5e-145) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); 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 <= 8.5e-145) tmp = 1.0 - (x / (y * (y - z))); else tmp = 1.0 + (x / ((y - z) * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 8.5e-145], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $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 8.5 \cdot 10^{-145}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < 8.50000000000000043e-145Initial program 98.3%
Taylor expanded in t around 0 74.9%
if 8.50000000000000043e-145 < t Initial program 99.9%
Taylor expanded in t around inf 96.5%
associate-*r/96.5%
neg-mul-196.5%
Simplified96.5%
Final simplification82.8%
(FPCore (x y z t) :precision binary64 (if (<= z -1.15e-224) 1.0 (+ 1.0 (/ x (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.15e-224) {
tmp = 1.0;
} 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.15d-224)) then
tmp = 1.0d0
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.15e-224) {
tmp = 1.0;
} else {
tmp = 1.0 + (x / (y * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.15e-224: tmp = 1.0 else: tmp = 1.0 + (x / (y * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.15e-224) tmp = 1.0; 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.15e-224) tmp = 1.0; else tmp = 1.0 + (x / (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.15e-224], 1.0, N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-224}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\end{array}
\end{array}
if z < -1.14999999999999994e-224Initial program 99.9%
Taylor expanded in z around 0 70.8%
associate-/l/70.8%
Simplified70.8%
Taylor expanded in y around 0 54.2%
associate-*r/54.2%
neg-mul-154.2%
Simplified54.2%
expm1-log1p-u53.2%
expm1-udef53.2%
add-sqr-sqrt24.5%
sqrt-unprod49.2%
sqr-neg49.2%
sqrt-unprod28.1%
add-sqr-sqrt52.4%
associate-/r*52.4%
Applied egg-rr52.4%
expm1-def52.4%
expm1-log1p53.4%
associate-/l/53.4%
Simplified53.4%
Taylor expanded in x around 0 74.6%
if -1.14999999999999994e-224 < z Initial program 98.0%
Taylor expanded in z around 0 73.8%
associate-/l/74.1%
Simplified74.1%
Taylor expanded in y around 0 59.6%
associate-*r/59.6%
neg-mul-159.6%
Simplified59.6%
expm1-log1p-u53.3%
expm1-udef53.3%
add-sqr-sqrt21.9%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod30.1%
add-sqr-sqrt51.4%
associate-/r*51.4%
Applied egg-rr51.4%
expm1-def51.4%
expm1-log1p53.5%
associate-/l/53.5%
Simplified53.5%
sub-neg53.5%
distribute-neg-frac53.5%
add-sqr-sqrt23.1%
sqrt-unprod49.0%
sqr-neg49.0%
sqrt-unprod32.0%
add-sqr-sqrt59.6%
*-commutative59.6%
Applied egg-rr59.6%
+-commutative59.6%
Simplified59.6%
Final simplification66.6%
(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 98.9%
Taylor expanded in z around 0 72.4%
associate-/l/72.6%
Simplified72.6%
Taylor expanded in y around 0 57.0%
associate-*r/57.0%
neg-mul-157.0%
Simplified57.0%
expm1-log1p-u53.2%
expm1-udef53.2%
add-sqr-sqrt23.1%
sqrt-unprod48.1%
sqr-neg48.1%
sqrt-unprod29.2%
add-sqr-sqrt51.9%
associate-/r*51.9%
Applied egg-rr51.9%
expm1-def51.9%
expm1-log1p53.5%
associate-/l/53.4%
Simplified53.4%
Taylor expanded in x around 0 69.9%
Final simplification69.9%
herbie shell --seed 2023192
(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)))))