
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
(FPCore (x y z t) :precision binary64 (+ 1.0 (/ x (* (- y z) (- t y)))))
double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + (x / ((y - z) * (t - y)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
def code(x, y, z, t): return 1.0 + (x / ((y - z) * (t - y)))
function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(Float64(y - z) * Float64(t - y)))) end
function tmp = code(x, y, z, t) tmp = 1.0 + (x / ((y - z) * (t - y))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{x}{\left(y - z\right) \cdot \left(t - y\right)}
\end{array}
Initial program 99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.3e-141) (not (<= y 2.2e-162))) (+ 1.0 (/ x (* y (- z y)))) (+ 1.0 (/ -1.0 (/ (* z t) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.3e-141) || !(y <= 2.2e-162)) {
tmp = 1.0 + (x / (y * (z - y)));
} 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 <= (-2.3d-141)) .or. (.not. (y <= 2.2d-162))) then
tmp = 1.0d0 + (x / (y * (z - y)))
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 <= -2.3e-141) || !(y <= 2.2e-162)) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 + (-1.0 / ((z * t) / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.3e-141) or not (y <= 2.2e-162): tmp = 1.0 + (x / (y * (z - y))) else: tmp = 1.0 + (-1.0 / ((z * t) / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.3e-141) || !(y <= 2.2e-162)) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); else tmp = Float64(1.0 + Float64(-1.0 / Float64(Float64(z * t) / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.3e-141) || ~((y <= 2.2e-162))) tmp = 1.0 + (x / (y * (z - y))); else tmp = 1.0 + (-1.0 / ((z * t) / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.3e-141], N[Not[LessEqual[y, 2.2e-162]], $MachinePrecision]], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / N[(N[(z * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-141} \lor \neg \left(y \leq 2.2 \cdot 10^{-162}\right):\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{\frac{z \cdot t}{x}}\\
\end{array}
\end{array}
if y < -2.29999999999999995e-141 or 2.1999999999999999e-162 < y Initial program 100.0%
Taylor expanded in t around 0 89.3%
if -2.29999999999999995e-141 < y < 2.1999999999999999e-162Initial program 98.1%
clear-num98.2%
associate-/r/98.1%
Applied egg-rr98.1%
Taylor expanded in y around 0 87.9%
*-commutative87.9%
associate-/r*87.9%
Simplified87.9%
*-commutative87.9%
associate-/l/87.9%
div-inv87.9%
clear-num88.0%
Applied egg-rr88.0%
Final simplification89.0%
(FPCore (x y z t)
:precision binary64
(if (<= t -4.8e-195)
(- 1.0 (/ (/ x z) (- t y)))
(if (<= t 3.45e-65)
(+ 1.0 (/ x (* y (- z y))))
(+ 1.0 (/ x (* (- y z) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.8e-195) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (t <= 3.45e-65) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-4.8d-195)) then
tmp = 1.0d0 - ((x / z) / (t - y))
else if (t <= 3.45d-65) then
tmp = 1.0d0 + (x / (y * (z - y)))
else
tmp = 1.0d0 + (x / ((y - z) * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.8e-195) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (t <= 3.45e-65) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4.8e-195: tmp = 1.0 - ((x / z) / (t - y)) elif t <= 3.45e-65: tmp = 1.0 + (x / (y * (z - y))) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4.8e-195) tmp = Float64(1.0 - Float64(Float64(x / z) / Float64(t - y))); elseif (t <= 3.45e-65) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); else tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -4.8e-195) tmp = 1.0 - ((x / z) / (t - y)); elseif (t <= 3.45e-65) tmp = 1.0 + (x / (y * (z - y))); else tmp = 1.0 + (x / ((y - z) * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.8e-195], N[(1.0 - N[(N[(x / z), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.45e-65], N[(1.0 + N[(x / N[(y * N[(z - y), $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 -4.8 \cdot 10^{-195}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t - y}\\
\mathbf{elif}\;t \leq 3.45 \cdot 10^{-65}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -4.8e-195Initial program 99.9%
clear-num100.0%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 77.9%
mul-1-neg77.9%
associate-/r*77.8%
distribute-neg-frac277.8%
Simplified77.8%
Taylor expanded in x around 0 77.9%
associate-/r*77.8%
Simplified77.8%
if -4.8e-195 < t < 3.44999999999999996e-65Initial program 98.9%
Taylor expanded in t around 0 89.9%
if 3.44999999999999996e-65 < t Initial program 100.0%
Taylor expanded in t around inf 97.9%
associate-*r/97.9%
neg-mul-197.9%
Simplified97.9%
Final simplification87.8%
(FPCore (x y z t) :precision binary64 (if (<= y -8.4e-54) 1.0 (if (<= y 4.2e-164) (+ 1.0 (/ -1.0 (/ (* z t) x))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.4e-54) {
tmp = 1.0;
} else if (y <= 4.2e-164) {
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 <= (-8.4d-54)) then
tmp = 1.0d0
else if (y <= 4.2d-164) 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 <= -8.4e-54) {
tmp = 1.0;
} else if (y <= 4.2e-164) {
tmp = 1.0 + (-1.0 / ((z * t) / x));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.4e-54: tmp = 1.0 elif y <= 4.2e-164: 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 <= -8.4e-54) tmp = 1.0; elseif (y <= 4.2e-164) tmp = Float64(1.0 + Float64(-1.0 / Float64(Float64(z * t) / x))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.4e-54) tmp = 1.0; elseif (y <= 4.2e-164) 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, -8.4e-54], 1.0, If[LessEqual[y, 4.2e-164], N[(1.0 + N[(-1.0 / N[(N[(z * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.4 \cdot 10^{-54}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-164}:\\
\;\;\;\;1 + \frac{-1}{\frac{z \cdot t}{x}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -8.4e-54 or 4.1999999999999998e-164 < y Initial program 100.0%
Taylor expanded in y around 0 50.7%
Taylor expanded in x around 0 86.7%
if -8.4e-54 < y < 4.1999999999999998e-164Initial program 98.6%
clear-num98.6%
associate-/r/98.6%
Applied egg-rr98.6%
Taylor expanded in y around 0 82.7%
*-commutative82.7%
associate-/r*82.6%
Simplified82.6%
*-commutative82.6%
associate-/l/82.7%
div-inv82.7%
clear-num82.7%
Applied egg-rr82.7%
Final simplification85.6%
(FPCore (x y z t) :precision binary64 (if (<= y -6.5e-51) 1.0 (if (<= y 2.2e-162) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.5e-51) {
tmp = 1.0;
} else if (y <= 2.2e-162) {
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 <= (-6.5d-51)) then
tmp = 1.0d0
else if (y <= 2.2d-162) 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 <= -6.5e-51) {
tmp = 1.0;
} else if (y <= 2.2e-162) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.5e-51: tmp = 1.0 elif y <= 2.2e-162: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.5e-51) tmp = 1.0; elseif (y <= 2.2e-162) 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 <= -6.5e-51) tmp = 1.0; elseif (y <= 2.2e-162) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.5e-51], 1.0, If[LessEqual[y, 2.2e-162], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{-51}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-162}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -6.5000000000000003e-51 or 2.1999999999999999e-162 < y Initial program 100.0%
Taylor expanded in y around 0 50.7%
Taylor expanded in x around 0 86.7%
if -6.5000000000000003e-51 < y < 2.1999999999999999e-162Initial program 98.6%
Taylor expanded in y around 0 82.7%
Final simplification85.6%
(FPCore (x y z t) :precision binary64 (if (<= z -2.55e-40) (+ 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 <= -2.55e-40) {
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 <= (-2.55d-40)) 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 <= -2.55e-40) {
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 <= -2.55e-40: 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 <= -2.55e-40) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); else tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.55e-40) 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, -2.55e-40], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.55 \cdot 10^{-40}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\end{array}
\end{array}
if z < -2.55000000000000019e-40Initial program 99.9%
clear-num100.0%
associate-/r/100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 96.2%
mul-1-neg96.2%
associate-/r*96.2%
distribute-neg-frac296.2%
Simplified96.2%
Taylor expanded in x around 0 96.2%
if -2.55000000000000019e-40 < z Initial program 99.4%
Taylor expanded in z around 0 82.8%
associate-/r*82.4%
Simplified82.4%
Final simplification86.5%
(FPCore (x y z t) :precision binary64 (if (<= z -5.5e-39) (+ 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 <= -5.5e-39) {
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 <= (-5.5d-39)) 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 <= -5.5e-39) {
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 <= -5.5e-39: 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 <= -5.5e-39) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); else tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.5e-39) 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, -5.5e-39], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-39}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\end{array}
\end{array}
if z < -5.50000000000000018e-39Initial program 99.9%
clear-num100.0%
associate-/r/100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 96.2%
mul-1-neg96.2%
associate-/r*96.2%
distribute-neg-frac296.2%
Simplified96.2%
Taylor expanded in x around 0 96.2%
if -5.50000000000000018e-39 < z Initial program 99.4%
Taylor expanded in z around 0 82.8%
Final simplification86.9%
(FPCore (x y z t) :precision binary64 (if (<= z -1.9e-39) 1.0 (+ 1.0 (/ x (* y (- t y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.9e-39) {
tmp = 1.0;
} 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 <= (-1.9d-39)) then
tmp = 1.0d0
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 <= -1.9e-39) {
tmp = 1.0;
} else {
tmp = 1.0 + (x / (y * (t - y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.9e-39: tmp = 1.0 else: tmp = 1.0 + (x / (y * (t - y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.9e-39) tmp = 1.0; 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 <= -1.9e-39) tmp = 1.0; else tmp = 1.0 + (x / (y * (t - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.9e-39], 1.0, N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-39}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\end{array}
\end{array}
if z < -1.9000000000000001e-39Initial program 99.9%
Taylor expanded in y around 0 76.4%
Taylor expanded in x around 0 79.2%
if -1.9000000000000001e-39 < z Initial program 99.4%
Taylor expanded in z around 0 82.8%
Final simplification81.7%
(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.6%
Taylor expanded in y around 0 59.5%
Taylor expanded in x around 0 77.2%
herbie shell --seed 2024089
(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)))))