
(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 98.6%
Final simplification98.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.65e-48) (not (<= y 3400000.0))) (- 1.0 (/ x (* y (- y t)))) (- 1.0 (/ (/ x t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.65e-48) || !(y <= 3400000.0)) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.65d-48)) .or. (.not. (y <= 3400000.0d0))) then
tmp = 1.0d0 - (x / (y * (y - t)))
else
tmp = 1.0d0 - ((x / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.65e-48) || !(y <= 3400000.0)) {
tmp = 1.0 - (x / (y * (y - t)));
} else {
tmp = 1.0 - ((x / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.65e-48) or not (y <= 3400000.0): tmp = 1.0 - (x / (y * (y - t))) else: tmp = 1.0 - ((x / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.65e-48) || !(y <= 3400000.0)) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); else tmp = Float64(1.0 - Float64(Float64(x / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.65e-48) || ~((y <= 3400000.0))) tmp = 1.0 - (x / (y * (y - t))); else tmp = 1.0 - ((x / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.65e-48], N[Not[LessEqual[y, 3400000.0]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{-48} \lor \neg \left(y \leq 3400000\right):\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\end{array}
\end{array}
if y < -1.65e-48 or 3.4e6 < y Initial program 100.0%
Taylor expanded in z around 0 95.7%
if -1.65e-48 < y < 3.4e6Initial program 97.1%
Taylor expanded in y around 0 72.9%
associate-/r*74.1%
div-inv74.1%
Applied egg-rr74.1%
un-div-inv74.1%
Applied egg-rr74.1%
Final simplification85.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.8e-110) (not (<= t 6.8e-144))) (- 1.0 (/ x (* t (- z y)))) (+ 1.0 (/ (/ x (- z y)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.8e-110) || !(t <= 6.8e-144)) {
tmp = 1.0 - (x / (t * (z - y)));
} else {
tmp = 1.0 + ((x / (z - 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 ((t <= (-2.8d-110)) .or. (.not. (t <= 6.8d-144))) then
tmp = 1.0d0 - (x / (t * (z - y)))
else
tmp = 1.0d0 + ((x / (z - y)) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.8e-110) || !(t <= 6.8e-144)) {
tmp = 1.0 - (x / (t * (z - y)));
} else {
tmp = 1.0 + ((x / (z - y)) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.8e-110) or not (t <= 6.8e-144): tmp = 1.0 - (x / (t * (z - y))) else: tmp = 1.0 + ((x / (z - y)) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.8e-110) || !(t <= 6.8e-144)) tmp = Float64(1.0 - Float64(x / Float64(t * Float64(z - y)))); else tmp = Float64(1.0 + Float64(Float64(x / Float64(z - y)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.8e-110) || ~((t <= 6.8e-144))) tmp = 1.0 - (x / (t * (z - y))); else tmp = 1.0 + ((x / (z - y)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.8e-110], N[Not[LessEqual[t, 6.8e-144]], $MachinePrecision]], N[(1.0 - N[(x / N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-110} \lor \neg \left(t \leq 6.8 \cdot 10^{-144}\right):\\
\;\;\;\;1 - \frac{x}{t \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{z - y}}{y}\\
\end{array}
\end{array}
if t < -2.8e-110 or 6.80000000000000035e-144 < t Initial program 99.6%
Taylor expanded in t around inf 93.5%
associate-*r/93.5%
neg-mul-193.5%
Simplified93.5%
if -2.8e-110 < t < 6.80000000000000035e-144Initial program 95.8%
clear-num95.7%
associate-/r/95.8%
Applied egg-rr95.8%
Taylor expanded in t around 0 92.9%
*-lft-identity92.9%
times-frac92.8%
associate-*l/92.9%
*-lft-identity92.9%
Simplified92.9%
Final simplification93.4%
(FPCore (x y z t)
:precision binary64
(if (<= t -2.5e-206)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 1.3e-143)
(+ 1.0 (/ (/ x (- z y)) y))
(- 1.0 (/ x (* t (- z y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.5e-206) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.3e-143) {
tmp = 1.0 + ((x / (z - y)) / 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 (t <= (-2.5d-206)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 1.3d-143) then
tmp = 1.0d0 + ((x / (z - y)) / 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 (t <= -2.5e-206) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 1.3e-143) {
tmp = 1.0 + ((x / (z - y)) / y);
} else {
tmp = 1.0 - (x / (t * (z - y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.5e-206: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 1.3e-143: tmp = 1.0 + ((x / (z - y)) / y) else: tmp = 1.0 - (x / (t * (z - y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.5e-206) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 1.3e-143) tmp = Float64(1.0 + Float64(Float64(x / Float64(z - y)) / y)); else tmp = Float64(1.0 - Float64(x / Float64(t * Float64(z - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.5e-206) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 1.3e-143) tmp = 1.0 + ((x / (z - y)) / y); else tmp = 1.0 - (x / (t * (z - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.5e-206], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e-143], N[(1.0 + N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{-206}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-143}:\\
\;\;\;\;1 + \frac{\frac{x}{z - y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{t \cdot \left(z - y\right)}\\
\end{array}
\end{array}
if t < -2.5e-206Initial program 97.9%
Taylor expanded in z around inf 74.7%
mul-1-neg74.7%
associate-/r*76.5%
distribute-neg-frac76.5%
Simplified76.5%
if -2.5e-206 < t < 1.29999999999999994e-143Initial program 97.8%
clear-num97.8%
associate-/r/97.8%
Applied egg-rr97.8%
Taylor expanded in t around 0 95.6%
*-lft-identity95.6%
times-frac95.5%
associate-*l/95.6%
*-lft-identity95.6%
Simplified95.6%
if 1.29999999999999994e-143 < t Initial program 99.9%
Taylor expanded in t around inf 95.1%
associate-*r/95.1%
neg-mul-195.1%
Simplified95.1%
Final simplification86.8%
(FPCore (x y z t)
:precision binary64
(if (<= t -3.7e-205)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 2.55e-61)
(+ 1.0 (/ x (* y (- z y))))
(- 1.0 (/ (/ x t) (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.7e-205) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 2.55e-61) {
tmp = 1.0 + (x / (y * (z - 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 (t <= (-3.7d-205)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 2.55d-61) then
tmp = 1.0d0 + (x / (y * (z - 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 (t <= -3.7e-205) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 2.55e-61) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.7e-205: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 2.55e-61: tmp = 1.0 + (x / (y * (z - y))) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.7e-205) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 2.55e-61) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - 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 (t <= -3.7e-205) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 2.55e-61) tmp = 1.0 + (x / (y * (z - y))); else tmp = 1.0 - ((x / t) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.7e-205], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e-61], N[(1.0 + N[(x / N[(y * N[(z - 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}\;t \leq -3.7 \cdot 10^{-205}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-61}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if t < -3.7000000000000001e-205Initial program 97.9%
Taylor expanded in z around inf 74.7%
mul-1-neg74.7%
associate-/r*76.5%
distribute-neg-frac76.5%
Simplified76.5%
if -3.7000000000000001e-205 < t < 2.54999999999999984e-61Initial program 98.3%
Taylor expanded in t around 0 94.5%
if 2.54999999999999984e-61 < t Initial program 99.8%
clear-num99.8%
associate-/r/99.9%
Applied egg-rr99.9%
associate-*l/99.8%
*-un-lft-identity99.8%
*-commutative99.8%
associate-/r*100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 96.8%
associate-*r/96.8%
mul-1-neg96.8%
Simplified96.8%
Final simplification87.1%
(FPCore (x y z t) :precision binary64 (if (<= z -3.3e-165) 1.0 (if (<= z 5.3e-104) (+ 1.0 (/ x (* y t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.3e-165) {
tmp = 1.0;
} else if (z <= 5.3e-104) {
tmp = 1.0 + (x / (y * 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 (z <= (-3.3d-165)) then
tmp = 1.0d0
else if (z <= 5.3d-104) then
tmp = 1.0d0 + (x / (y * 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 (z <= -3.3e-165) {
tmp = 1.0;
} else if (z <= 5.3e-104) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.3e-165: tmp = 1.0 elif z <= 5.3e-104: tmp = 1.0 + (x / (y * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.3e-165) tmp = 1.0; elseif (z <= 5.3e-104) tmp = Float64(1.0 + Float64(x / Float64(y * t))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.3e-165) tmp = 1.0; elseif (z <= 5.3e-104) tmp = 1.0 + (x / (y * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.3e-165], 1.0, If[LessEqual[z, 5.3e-104], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{-165}:\\
\;\;\;\;1\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{-104}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -3.2999999999999998e-165 or 5.30000000000000018e-104 < z Initial program 99.4%
Taylor expanded in z around 0 62.4%
Taylor expanded in x around 0 79.5%
if -3.2999999999999998e-165 < z < 5.30000000000000018e-104Initial program 96.2%
Taylor expanded in z around 0 86.6%
Taylor expanded in t around inf 71.8%
+-commutative71.8%
*-commutative71.8%
Simplified71.8%
Final simplification77.6%
(FPCore (x y z t) :precision binary64 (if (<= z -5.1e-164) 1.0 (if (<= z 7.5e-99) (+ 1.0 (/ (/ x t) y)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.1e-164) {
tmp = 1.0;
} else if (z <= 7.5e-99) {
tmp = 1.0 + ((x / t) / 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 (z <= (-5.1d-164)) then
tmp = 1.0d0
else if (z <= 7.5d-99) then
tmp = 1.0d0 + ((x / t) / 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 (z <= -5.1e-164) {
tmp = 1.0;
} else if (z <= 7.5e-99) {
tmp = 1.0 + ((x / t) / y);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.1e-164: tmp = 1.0 elif z <= 7.5e-99: tmp = 1.0 + ((x / t) / y) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.1e-164) tmp = 1.0; elseif (z <= 7.5e-99) tmp = Float64(1.0 + Float64(Float64(x / t) / y)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.1e-164) tmp = 1.0; elseif (z <= 7.5e-99) tmp = 1.0 + ((x / t) / y); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.1e-164], 1.0, If[LessEqual[z, 7.5e-99], N[(1.0 + N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.1 \cdot 10^{-164}:\\
\;\;\;\;1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-99}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -5.10000000000000036e-164 or 7.4999999999999999e-99 < z Initial program 99.4%
Taylor expanded in z around 0 62.4%
Taylor expanded in x around 0 79.5%
if -5.10000000000000036e-164 < z < 7.4999999999999999e-99Initial program 96.2%
Taylor expanded in z around 0 86.6%
Taylor expanded in t around inf 71.8%
+-commutative71.8%
*-commutative71.8%
Simplified71.8%
Taylor expanded in x around 0 71.8%
associate-/r*73.2%
Simplified73.2%
Final simplification77.9%
(FPCore (x y z t) :precision binary64 (if (<= y -1.66e-99) 1.0 (if (<= y 1.8e-55) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.66e-99) {
tmp = 1.0;
} else if (y <= 1.8e-55) {
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 <= (-1.66d-99)) then
tmp = 1.0d0
else if (y <= 1.8d-55) 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 <= -1.66e-99) {
tmp = 1.0;
} else if (y <= 1.8e-55) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.66e-99: tmp = 1.0 elif y <= 1.8e-55: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.66e-99) tmp = 1.0; elseif (y <= 1.8e-55) 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 <= -1.66e-99) tmp = 1.0; elseif (y <= 1.8e-55) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.66e-99], 1.0, If[LessEqual[y, 1.8e-55], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.66 \cdot 10^{-99}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-55}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.6599999999999999e-99 or 1.8e-55 < y Initial program 100.0%
Taylor expanded in z around 0 89.8%
Taylor expanded in x around 0 89.5%
if -1.6599999999999999e-99 < y < 1.8e-55Initial program 96.4%
Taylor expanded in y around 0 74.3%
Final simplification83.7%
(FPCore (x y z t) :precision binary64 (if (<= y -5.6e-99) 1.0 (if (<= y 1.3e-54) (- 1.0 (/ (/ x t) z)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.6e-99) {
tmp = 1.0;
} else if (y <= 1.3e-54) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-5.6d-99)) then
tmp = 1.0d0
else if (y <= 1.3d-54) then
tmp = 1.0d0 - ((x / t) / z)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.6e-99) {
tmp = 1.0;
} else if (y <= 1.3e-54) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.6e-99: tmp = 1.0 elif y <= 1.3e-54: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.6e-99) tmp = 1.0; elseif (y <= 1.3e-54) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5.6e-99) tmp = 1.0; elseif (y <= 1.3e-54) tmp = 1.0 - ((x / t) / z); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.6e-99], 1.0, If[LessEqual[y, 1.3e-54], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{-99}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-54}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -5.6000000000000001e-99 or 1.30000000000000001e-54 < y Initial program 100.0%
Taylor expanded in z around 0 89.8%
Taylor expanded in x around 0 89.5%
if -5.6000000000000001e-99 < y < 1.30000000000000001e-54Initial program 96.4%
Taylor expanded in y around 0 74.3%
associate-/r*75.8%
div-inv75.8%
Applied egg-rr75.8%
un-div-inv75.8%
Applied egg-rr75.8%
Final simplification84.3%
(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.6%
Taylor expanded in z around 0 68.5%
Taylor expanded in x around 0 74.4%
Final simplification74.4%
herbie shell --seed 2024096
(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)))))