
(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 t) (- z y)))))
double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - t) * (z - 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 - t) * (z - y)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - t) * (z - y)));
}
def code(x, y, z, t): return 1.0 + (x / ((y - t) * (z - y)))
function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(Float64(y - t) * Float64(z - y)))) end
function tmp = code(x, y, z, t) tmp = 1.0 + (x / ((y - t) * (z - y))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(x / N[(N[(y - t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{x}{\left(y - t\right) \cdot \left(z - y\right)}
\end{array}
Initial program 99.2%
Final simplification99.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -6.2e-107)
(- 1.0 (/ (/ x z) (- t y)))
(if (<= z 8.2e-209)
(+ 1.0 (/ 1.0 (* y (/ (- t y) x))))
(- 1.0 (/ (/ x t) (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.2e-107) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (z <= 8.2e-209) {
tmp = 1.0 + (1.0 / (y * ((t - y) / x)));
} else {
tmp = 1.0 - ((x / t) / (z - 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 <= (-6.2d-107)) then
tmp = 1.0d0 - ((x / z) / (t - y))
else if (z <= 8.2d-209) then
tmp = 1.0d0 + (1.0d0 / (y * ((t - y) / x)))
else
tmp = 1.0d0 - ((x / t) / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.2e-107) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (z <= 8.2e-209) {
tmp = 1.0 + (1.0 / (y * ((t - y) / x)));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.2e-107: tmp = 1.0 - ((x / z) / (t - y)) elif z <= 8.2e-209: tmp = 1.0 + (1.0 / (y * ((t - y) / x))) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.2e-107) tmp = Float64(1.0 - Float64(Float64(x / z) / Float64(t - y))); elseif (z <= 8.2e-209) tmp = Float64(1.0 + Float64(1.0 / Float64(y * Float64(Float64(t - y) / x)))); else tmp = Float64(1.0 - Float64(Float64(x / t) / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6.2e-107) tmp = 1.0 - ((x / z) / (t - y)); elseif (z <= 8.2e-209) tmp = 1.0 + (1.0 / (y * ((t - y) / x))); else tmp = 1.0 - ((x / t) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.2e-107], N[(1.0 - N[(N[(x / z), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e-209], N[(1.0 + N[(1.0 / N[(y * N[(N[(t - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-107}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t - y}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-209}:\\
\;\;\;\;1 + \frac{1}{y \cdot \frac{t - y}{x}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if z < -6.20000000000000043e-107Initial program 99.9%
Taylor expanded in z around inf 94.7%
associate-/r*94.7%
Simplified94.7%
if -6.20000000000000043e-107 < z < 8.19999999999999955e-209Initial program 96.9%
clear-num97.0%
inv-pow97.0%
associate-/l*99.9%
Applied egg-rr99.9%
unpow-199.9%
Simplified99.9%
Taylor expanded in z around 0 92.5%
associate-*r/95.4%
Simplified95.4%
if 8.19999999999999955e-209 < z Initial program 100.0%
Taylor expanded in t around inf 81.4%
associate-/r*81.4%
Simplified81.4%
Final simplification89.3%
(FPCore (x y z t)
:precision binary64
(if (<= z -4e-107)
(- 1.0 (/ (/ x z) (- t y)))
(if (<= z 1.25e-208)
(+ 1.0 (* (/ 1.0 y) (/ x (- t y))))
(- 1.0 (/ (/ x t) (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4e-107) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (z <= 1.25e-208) {
tmp = 1.0 + ((1.0 / y) * (x / (t - y)));
} else {
tmp = 1.0 - ((x / t) / (z - 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 <= (-4d-107)) then
tmp = 1.0d0 - ((x / z) / (t - y))
else if (z <= 1.25d-208) then
tmp = 1.0d0 + ((1.0d0 / y) * (x / (t - y)))
else
tmp = 1.0d0 - ((x / t) / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4e-107) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (z <= 1.25e-208) {
tmp = 1.0 + ((1.0 / y) * (x / (t - y)));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4e-107: tmp = 1.0 - ((x / z) / (t - y)) elif z <= 1.25e-208: tmp = 1.0 + ((1.0 / y) * (x / (t - y))) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4e-107) tmp = Float64(1.0 - Float64(Float64(x / z) / Float64(t - y))); elseif (z <= 1.25e-208) tmp = Float64(1.0 + Float64(Float64(1.0 / y) * Float64(x / Float64(t - y)))); else tmp = Float64(1.0 - Float64(Float64(x / t) / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4e-107) tmp = 1.0 - ((x / z) / (t - y)); elseif (z <= 1.25e-208) tmp = 1.0 + ((1.0 / y) * (x / (t - y))); else tmp = 1.0 - ((x / t) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4e-107], N[(1.0 - N[(N[(x / z), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e-208], N[(1.0 + N[(N[(1.0 / y), $MachinePrecision] * N[(x / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-107}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t - y}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-208}:\\
\;\;\;\;1 + \frac{1}{y} \cdot \frac{x}{t - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if z < -4e-107Initial program 99.9%
Taylor expanded in z around inf 94.7%
associate-/r*94.7%
Simplified94.7%
if -4e-107 < z < 1.24999999999999991e-208Initial program 96.9%
*-un-lft-identity96.9%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 95.3%
if 1.24999999999999991e-208 < z Initial program 100.0%
Taylor expanded in t around inf 81.4%
associate-/r*81.4%
Simplified81.4%
Final simplification89.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.8e-83) (not (<= y 7e-93))) (+ 1.0 (/ (/ x y) (- t y))) (- 1.0 (/ (/ x t) (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.8e-83) || !(y <= 7e-93)) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 - ((x / t) / (z - 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 <= (-1.8d-83)) .or. (.not. (y <= 7d-93))) then
tmp = 1.0d0 + ((x / y) / (t - y))
else
tmp = 1.0d0 - ((x / t) / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.8e-83) || !(y <= 7e-93)) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.8e-83) or not (y <= 7e-93): tmp = 1.0 + ((x / y) / (t - y)) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.8e-83) || !(y <= 7e-93)) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - y))); else tmp = Float64(1.0 - Float64(Float64(x / t) / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.8e-83) || ~((y <= 7e-93))) tmp = 1.0 + ((x / y) / (t - y)); else tmp = 1.0 - ((x / t) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.8e-83], N[Not[LessEqual[y, 7e-93]], $MachinePrecision]], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-83} \lor \neg \left(y \leq 7 \cdot 10^{-93}\right):\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if y < -1.80000000000000006e-83 or 7e-93 < y Initial program 99.9%
Taylor expanded in z around 0 93.1%
sub-neg93.1%
associate-/r*93.1%
distribute-neg-frac293.1%
neg-sub093.1%
sub-neg93.1%
+-commutative93.1%
associate--r+93.1%
neg-sub093.1%
remove-double-neg93.1%
Simplified93.1%
if -1.80000000000000006e-83 < y < 7e-93Initial program 97.7%
Taylor expanded in t around inf 85.9%
associate-/r*83.9%
Simplified83.9%
Final simplification89.9%
(FPCore (x y z t) :precision binary64 (if (<= z -6e-107) (- 1.0 (/ (/ x z) (- t y))) (if (<= z 4e-209) (+ 1.0 (/ (/ x y) (- t y))) (- 1.0 (/ (/ x t) (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6e-107) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (z <= 4e-209) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 - ((x / t) / (z - 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 <= (-6d-107)) then
tmp = 1.0d0 - ((x / z) / (t - y))
else if (z <= 4d-209) then
tmp = 1.0d0 + ((x / y) / (t - y))
else
tmp = 1.0d0 - ((x / t) / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6e-107) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (z <= 4e-209) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6e-107: tmp = 1.0 - ((x / z) / (t - y)) elif z <= 4e-209: tmp = 1.0 + ((x / y) / (t - y)) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6e-107) tmp = Float64(1.0 - Float64(Float64(x / z) / Float64(t - y))); elseif (z <= 4e-209) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - y))); else tmp = Float64(1.0 - Float64(Float64(x / t) / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6e-107) tmp = 1.0 - ((x / z) / (t - y)); elseif (z <= 4e-209) tmp = 1.0 + ((x / y) / (t - y)); else tmp = 1.0 - ((x / t) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6e-107], N[(1.0 - N[(N[(x / z), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e-209], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-107}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t - y}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-209}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if z < -5.9999999999999994e-107Initial program 99.9%
Taylor expanded in z around inf 94.7%
associate-/r*94.7%
Simplified94.7%
if -5.9999999999999994e-107 < z < 4.0000000000000002e-209Initial program 96.9%
Taylor expanded in z around 0 92.4%
sub-neg92.4%
associate-/r*95.4%
distribute-neg-frac295.4%
neg-sub095.4%
sub-neg95.4%
+-commutative95.4%
associate--r+95.4%
neg-sub095.4%
remove-double-neg95.4%
Simplified95.4%
if 4.0000000000000002e-209 < z Initial program 100.0%
Taylor expanded in t around inf 81.4%
associate-/r*81.4%
Simplified81.4%
Final simplification89.3%
(FPCore (x y z t) :precision binary64 (if (<= y -2.6e+53) 1.0 (if (<= y 1.2e-74) (- 1.0 (/ (/ x t) (- z y))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e+53) {
tmp = 1.0;
} else if (y <= 1.2e-74) {
tmp = 1.0 - ((x / t) / (z - y));
} 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.6d+53)) then
tmp = 1.0d0
else if (y <= 1.2d-74) then
tmp = 1.0d0 - ((x / t) / (z - y))
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.6e+53) {
tmp = 1.0;
} else if (y <= 1.2e-74) {
tmp = 1.0 - ((x / t) / (z - y));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.6e+53: tmp = 1.0 elif y <= 1.2e-74: tmp = 1.0 - ((x / t) / (z - y)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.6e+53) tmp = 1.0; elseif (y <= 1.2e-74) tmp = Float64(1.0 - Float64(Float64(x / t) / Float64(z - y))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.6e+53) tmp = 1.0; elseif (y <= 1.2e-74) tmp = 1.0 - ((x / t) / (z - y)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.6e+53], 1.0, If[LessEqual[y, 1.2e-74], N[(1.0 - N[(N[(x / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+53}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-74}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.59999999999999998e53 or 1.1999999999999999e-74 < y Initial program 100.0%
Taylor expanded in x around 0 92.6%
if -2.59999999999999998e53 < y < 1.1999999999999999e-74Initial program 98.3%
Taylor expanded in t around inf 81.4%
associate-/r*79.9%
Simplified79.9%
Final simplification86.3%
(FPCore (x y z t) :precision binary64 (if (<= y -8.5e-167) 1.0 (if (<= y 8.5e-104) (/ (- t (/ x z)) t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.5e-167) {
tmp = 1.0;
} else if (y <= 8.5e-104) {
tmp = (t - (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 <= (-8.5d-167)) then
tmp = 1.0d0
else if (y <= 8.5d-104) then
tmp = (t - (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 <= -8.5e-167) {
tmp = 1.0;
} else if (y <= 8.5e-104) {
tmp = (t - (x / z)) / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.5e-167: tmp = 1.0 elif y <= 8.5e-104: tmp = (t - (x / z)) / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.5e-167) tmp = 1.0; elseif (y <= 8.5e-104) tmp = Float64(Float64(t - Float64(x / z)) / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.5e-167) tmp = 1.0; elseif (y <= 8.5e-104) tmp = (t - (x / z)) / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.5e-167], 1.0, If[LessEqual[y, 8.5e-104], N[(N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-104}:\\
\;\;\;\;\frac{t - \frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -8.4999999999999994e-167 or 8.50000000000000007e-104 < y Initial program 99.9%
Taylor expanded in x around 0 86.0%
if -8.4999999999999994e-167 < y < 8.50000000000000007e-104Initial program 97.3%
clear-num97.3%
inv-pow97.3%
associate-/l*96.0%
Applied egg-rr96.0%
unpow-196.0%
Simplified96.0%
Taylor expanded in y around 0 82.1%
associate-/r*79.7%
Simplified79.7%
Taylor expanded in t around 0 82.2%
(FPCore (x y z t) :precision binary64 (if (<= y -1e-166) 1.0 (if (<= y 2.6e-104) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1e-166) {
tmp = 1.0;
} else if (y <= 2.6e-104) {
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 <= (-1d-166)) then
tmp = 1.0d0
else if (y <= 2.6d-104) 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 <= -1e-166) {
tmp = 1.0;
} else if (y <= 2.6e-104) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1e-166: tmp = 1.0 elif y <= 2.6e-104: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1e-166) tmp = 1.0; elseif (y <= 2.6e-104) 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 <= -1e-166) tmp = 1.0; elseif (y <= 2.6e-104) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1e-166], 1.0, If[LessEqual[y, 2.6e-104], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-166}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-104}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.00000000000000004e-166 or 2.60000000000000003e-104 < y Initial program 99.9%
Taylor expanded in x around 0 86.0%
if -1.00000000000000004e-166 < y < 2.60000000000000003e-104Initial program 97.3%
Taylor expanded in y around 0 82.1%
Final simplification84.9%
(FPCore (x y z t) :precision binary64 (if (<= y -3.2e-275) 1.0 (if (<= y 5e-241) (/ (/ x z) (- t)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.2e-275) {
tmp = 1.0;
} else if (y <= 5e-241) {
tmp = (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 <= (-3.2d-275)) then
tmp = 1.0d0
else if (y <= 5d-241) then
tmp = (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 <= -3.2e-275) {
tmp = 1.0;
} else if (y <= 5e-241) {
tmp = (x / z) / -t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.2e-275: tmp = 1.0 elif y <= 5e-241: tmp = (x / z) / -t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.2e-275) tmp = 1.0; elseif (y <= 5e-241) tmp = Float64(Float64(x / z) / Float64(-t)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.2e-275) tmp = 1.0; elseif (y <= 5e-241) tmp = (x / z) / -t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.2e-275], 1.0, If[LessEqual[y, 5e-241], N[(N[(x / z), $MachinePrecision] / (-t)), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{-275}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-241}:\\
\;\;\;\;\frac{\frac{x}{z}}{-t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.2e-275 or 4.9999999999999998e-241 < y Initial program 99.1%
Taylor expanded in x around 0 80.2%
if -3.2e-275 < y < 4.9999999999999998e-241Initial program 99.8%
Taylor expanded in z around inf 99.8%
associate-/r*99.9%
Simplified99.9%
Taylor expanded in x around inf 69.2%
Taylor expanded in y around 0 65.5%
neg-mul-165.5%
Simplified65.5%
associate-/r*65.6%
distribute-frac-neg265.6%
Applied egg-rr65.6%
Final simplification78.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 99.2%
Taylor expanded in x around 0 75.1%
herbie shell --seed 2024163
(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)))))