
(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 10 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 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4e-98) (not (<= y 2.8e-70))) (- 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 <= -4e-98) || !(y <= 2.8e-70)) {
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 <= (-4d-98)) .or. (.not. (y <= 2.8d-70))) 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 <= -4e-98) || !(y <= 2.8e-70)) {
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 <= -4e-98) or not (y <= 2.8e-70): 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 <= -4e-98) || !(y <= 2.8e-70)) 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 <= -4e-98) || ~((y <= 2.8e-70))) 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, -4e-98], N[Not[LessEqual[y, 2.8e-70]], $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 \cdot 10^{-98} \lor \neg \left(y \leq 2.8 \cdot 10^{-70}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -3.99999999999999976e-98 or 2.7999999999999999e-70 < y Initial program 100.0%
Taylor expanded in t around 0 91.9%
if -3.99999999999999976e-98 < y < 2.7999999999999999e-70Initial program 99.9%
Taylor expanded in y around 0 77.2%
Final simplification86.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9.4e-104) (not (<= z 1e-82))) (+ 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.4e-104) || !(z <= 1e-82)) {
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.4d-104)) .or. (.not. (z <= 1d-82))) 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.4e-104) || !(z <= 1e-82)) {
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.4e-104) or not (z <= 1e-82): 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.4e-104) || !(z <= 1e-82)) tmp = Float64(1.0 + Float64(x / Float64(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 <= -9.4e-104) || ~((z <= 1e-82))) 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.4e-104], N[Not[LessEqual[z, 1e-82]], $MachinePrecision]], N[(1.0 + N[(x / N[(z * N[(y - t), $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.4 \cdot 10^{-104} \lor \neg \left(z \leq 10^{-82}\right):\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\
\end{array}
\end{array}
if z < -9.4e-104 or 1e-82 < z Initial program 100.0%
Taylor expanded in z around inf 94.7%
associate-*r/94.7%
neg-mul-194.7%
Simplified94.7%
if -9.4e-104 < z < 1e-82Initial program 99.9%
clear-num99.9%
associate-/r/99.9%
*-commutative99.9%
associate-/r*99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 87.3%
associate-/r*87.4%
Simplified87.4%
Final simplification91.6%
(FPCore (x y z t) :precision binary64 (if (<= y -4.8e-98) (- 1.0 (/ x (* y (- y z)))) (if (<= y 5.6e-127) (- 1.0 (/ x (* z t))) (- 1.0 (/ x (* y (- y t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.8e-98) {
tmp = 1.0 - (x / (y * (y - z)));
} else if (y <= 5.6e-127) {
tmp = 1.0 - (x / (z * t));
} 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 (y <= (-4.8d-98)) then
tmp = 1.0d0 - (x / (y * (y - z)))
else if (y <= 5.6d-127) then
tmp = 1.0d0 - (x / (z * t))
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 (y <= -4.8e-98) {
tmp = 1.0 - (x / (y * (y - z)));
} else if (y <= 5.6e-127) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 - (x / (y * (y - t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.8e-98: tmp = 1.0 - (x / (y * (y - z))) elif y <= 5.6e-127: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 - (x / (y * (y - t))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.8e-98) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); elseif (y <= 5.6e-127) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.8e-98) tmp = 1.0 - (x / (y * (y - z))); elseif (y <= 5.6e-127) tmp = 1.0 - (x / (z * t)); else tmp = 1.0 - (x / (y * (y - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.8e-98], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.6e-127], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{-98}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{-127}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\end{array}
\end{array}
if y < -4.8000000000000001e-98Initial program 100.0%
Taylor expanded in t around 0 94.1%
if -4.8000000000000001e-98 < y < 5.59999999999999999e-127Initial program 99.9%
Taylor expanded in y around 0 79.9%
if 5.59999999999999999e-127 < y Initial program 99.9%
Taylor expanded in z around 0 83.9%
Final simplification85.6%
(FPCore (x y z t) :precision binary64 (if (<= y -5.2e-98) (- 1.0 (/ x (* y (- y z)))) (if (<= y 6.5e-127) (- 1.0 (/ x (* z t))) (- 1.0 (/ (/ x (- y t)) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.2e-98) {
tmp = 1.0 - (x / (y * (y - z)));
} else if (y <= 6.5e-127) {
tmp = 1.0 - (x / (z * 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 (y <= (-5.2d-98)) then
tmp = 1.0d0 - (x / (y * (y - z)))
else if (y <= 6.5d-127) then
tmp = 1.0d0 - (x / (z * 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 (y <= -5.2e-98) {
tmp = 1.0 - (x / (y * (y - z)));
} else if (y <= 6.5e-127) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 - ((x / (y - t)) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.2e-98: tmp = 1.0 - (x / (y * (y - z))) elif y <= 6.5e-127: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 - ((x / (y - t)) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.2e-98) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); elseif (y <= 6.5e-127) tmp = Float64(1.0 - Float64(x / Float64(z * 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 (y <= -5.2e-98) tmp = 1.0 - (x / (y * (y - z))); elseif (y <= 6.5e-127) tmp = 1.0 - (x / (z * t)); else tmp = 1.0 - ((x / (y - t)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.2e-98], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e-127], N[(1.0 - N[(x / N[(z * 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}\;y \leq -5.2 \cdot 10^{-98}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-127}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\
\end{array}
\end{array}
if y < -5.20000000000000027e-98Initial program 100.0%
Taylor expanded in t around 0 94.1%
if -5.20000000000000027e-98 < y < 6.49999999999999998e-127Initial program 99.9%
Taylor expanded in y around 0 79.9%
if 6.49999999999999998e-127 < y Initial program 99.9%
clear-num99.9%
associate-/r/100.0%
*-commutative100.0%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in z around 0 83.9%
associate-/r*84.0%
Simplified84.0%
Final simplification85.7%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.6e-100)
(+ 1.0 (/ x (* z (- y t))))
(if (<= z 2.65e-188)
(- 1.0 (/ (/ x (- y t)) y))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.6e-100) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (z <= 2.65e-188) {
tmp = 1.0 - ((x / (y - t)) / 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 (z <= (-2.6d-100)) then
tmp = 1.0d0 + (x / (z * (y - t)))
else if (z <= 2.65d-188) then
tmp = 1.0d0 - ((x / (y - t)) / 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 (z <= -2.6e-100) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (z <= 2.65e-188) {
tmp = 1.0 - ((x / (y - t)) / y);
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.6e-100: tmp = 1.0 + (x / (z * (y - t))) elif z <= 2.65e-188: tmp = 1.0 - ((x / (y - t)) / y) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.6e-100) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); elseif (z <= 2.65e-188) tmp = Float64(1.0 - Float64(Float64(x / Float64(y - t)) / 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 (z <= -2.6e-100) tmp = 1.0 + (x / (z * (y - t))); elseif (z <= 2.65e-188) tmp = 1.0 - ((x / (y - t)) / y); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.6e-100], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.65e-188], N[(1.0 - N[(N[(x / N[(y - t), $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}\;z \leq -2.6 \cdot 10^{-100}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{-188}:\\
\;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if z < -2.5999999999999998e-100Initial program 99.9%
Taylor expanded in z around inf 96.2%
associate-*r/96.2%
neg-mul-196.2%
Simplified96.2%
if -2.5999999999999998e-100 < z < 2.65000000000000007e-188Initial program 99.9%
clear-num99.8%
associate-/r/99.9%
*-commutative99.9%
associate-/r*99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 91.1%
associate-/r*91.2%
Simplified91.2%
if 2.65000000000000007e-188 < z Initial program 100.0%
Taylor expanded in t around inf 80.9%
mul-1-neg80.9%
distribute-frac-neg80.9%
associate-/r*80.6%
Simplified80.6%
Final simplification88.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.42e+57) (not (<= y 5e-9))) (- 1.0 (/ x (* y t))) (- 1.0 (/ x (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.42e+57) || !(y <= 5e-9)) {
tmp = 1.0 - (x / (y * t));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.42d+57)) .or. (.not. (y <= 5d-9))) then
tmp = 1.0d0 - (x / (y * t))
else
tmp = 1.0d0 - (x / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.42e+57) || !(y <= 5e-9)) {
tmp = 1.0 - (x / (y * t));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.42e+57) or not (y <= 5e-9): tmp = 1.0 - (x / (y * t)) else: tmp = 1.0 - (x / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.42e+57) || !(y <= 5e-9)) tmp = Float64(1.0 - Float64(x / Float64(y * t))); else tmp = Float64(1.0 - Float64(x / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.42e+57) || ~((y <= 5e-9))) tmp = 1.0 - (x / (y * t)); else tmp = 1.0 - (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.42e+57], N[Not[LessEqual[y, 5e-9]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.42 \cdot 10^{+57} \lor \neg \left(y \leq 5 \cdot 10^{-9}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -1.42e57 or 5.0000000000000001e-9 < y Initial program 100.0%
Taylor expanded in z around 0 96.5%
associate-/l/96.5%
Simplified96.5%
Taylor expanded in y around 0 76.4%
associate-*r/76.4%
neg-mul-176.4%
*-commutative76.4%
Simplified76.4%
expm1-log1p-u74.9%
expm1-udef74.9%
add-sqr-sqrt29.9%
sqrt-unprod64.9%
sqr-neg64.9%
sqrt-unprod45.0%
add-sqr-sqrt75.0%
*-commutative75.0%
Applied egg-rr75.0%
expm1-def75.0%
expm1-log1p75.6%
Simplified75.6%
if -1.42e57 < y < 5.0000000000000001e-9Initial program 99.9%
Taylor expanded in y around 0 65.9%
Final simplification70.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.25e-74) (not (<= y 3.5e-33))) (- 1.0 (/ x (* y y))) (- 1.0 (/ x (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.25e-74) || !(y <= 3.5e-33)) {
tmp = 1.0 - (x / (y * 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.25d-74)) .or. (.not. (y <= 3.5d-33))) then
tmp = 1.0d0 - (x / (y * 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.25e-74) || !(y <= 3.5e-33)) {
tmp = 1.0 - (x / (y * y));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.25e-74) or not (y <= 3.5e-33): tmp = 1.0 - (x / (y * y)) else: tmp = 1.0 - (x / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.25e-74) || !(y <= 3.5e-33)) tmp = Float64(1.0 - Float64(x / Float64(y * 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.25e-74) || ~((y <= 3.5e-33))) tmp = 1.0 - (x / (y * y)); else tmp = 1.0 - (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.25e-74], N[Not[LessEqual[y, 3.5e-33]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * y), $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.25 \cdot 10^{-74} \lor \neg \left(y \leq 3.5 \cdot 10^{-33}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -1.25e-74 or 3.4999999999999999e-33 < y Initial program 100.0%
Taylor expanded in y around inf 90.7%
unpow290.7%
Simplified90.7%
if -1.25e-74 < y < 3.4999999999999999e-33Initial program 99.9%
Taylor expanded in y around 0 73.6%
Final simplification83.0%
(FPCore (x y z t) :precision binary64 (if (<= y -3.3e-72) (- 1.0 (/ x (* y y))) (if (<= y 4.3e-33) (- 1.0 (/ x (* z t))) (- 1.0 (/ (/ x y) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.3e-72) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 4.3e-33) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 - ((x / y) / 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 (y <= (-3.3d-72)) then
tmp = 1.0d0 - (x / (y * y))
else if (y <= 4.3d-33) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0 - ((x / y) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.3e-72) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 4.3e-33) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 - ((x / y) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.3e-72: tmp = 1.0 - (x / (y * y)) elif y <= 4.3e-33: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 - ((x / y) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.3e-72) tmp = Float64(1.0 - Float64(x / Float64(y * y))); elseif (y <= 4.3e-33) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = Float64(1.0 - Float64(Float64(x / y) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.3e-72) tmp = 1.0 - (x / (y * y)); elseif (y <= 4.3e-33) tmp = 1.0 - (x / (z * t)); else tmp = 1.0 - ((x / y) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.3e-72], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.3e-33], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-72}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{-33}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -3.3e-72Initial program 100.0%
Taylor expanded in y around inf 90.1%
unpow290.1%
Simplified90.1%
if -3.3e-72 < y < 4.30000000000000031e-33Initial program 99.9%
Taylor expanded in y around 0 73.6%
if 4.30000000000000031e-33 < y Initial program 100.0%
Taylor expanded in y around inf 91.5%
unpow291.5%
associate-/r*91.5%
Simplified91.5%
Final simplification83.0%
(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 59.1%
Final simplification59.1%
herbie shell --seed 2023240
(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)))))