
(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 14 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 (pow (/ (- y t) (/ x (- y z))) -1.0)))
double code(double x, double y, double z, double t) {
return 1.0 - pow(((y - t) / (x / (y - z))), -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 - (((y - t) / (x / (y - z))) ** (-1.0d0))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - Math.pow(((y - t) / (x / (y - z))), -1.0);
}
def code(x, y, z, t): return 1.0 - math.pow(((y - t) / (x / (y - z))), -1.0)
function code(x, y, z, t) return Float64(1.0 - (Float64(Float64(y - t) / Float64(x / Float64(y - z))) ^ -1.0)) end
function tmp = code(x, y, z, t) tmp = 1.0 - (((y - t) / (x / (y - z))) ^ -1.0); end
code[x_, y_, z_, t_] := N[(1.0 - N[Power[N[(N[(y - t), $MachinePrecision] / N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - {\left(\frac{y - t}{\frac{x}{y - z}}\right)}^{-1}
\end{array}
Initial program 98.2%
clear-num98.2%
inv-pow98.2%
*-commutative98.2%
associate-/l*98.8%
Applied egg-rr98.8%
Final simplification98.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.5e-39)
1.0
(if (<= y 9.8e-197)
(- 1.0 (/ x (* t z)))
(if (<= y 4.4e-137) (+ 1.0 (/ x (* y z))) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.5e-39) {
tmp = 1.0;
} else if (y <= 9.8e-197) {
tmp = 1.0 - (x / (t * z));
} else if (y <= 4.4e-137) {
tmp = 1.0 + (x / (y * 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 <= (-2.5d-39)) then
tmp = 1.0d0
else if (y <= 9.8d-197) then
tmp = 1.0d0 - (x / (t * z))
else if (y <= 4.4d-137) then
tmp = 1.0d0 + (x / (y * 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 <= -2.5e-39) {
tmp = 1.0;
} else if (y <= 9.8e-197) {
tmp = 1.0 - (x / (t * z));
} else if (y <= 4.4e-137) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.5e-39: tmp = 1.0 elif y <= 9.8e-197: tmp = 1.0 - (x / (t * z)) elif y <= 4.4e-137: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.5e-39) tmp = 1.0; elseif (y <= 9.8e-197) tmp = Float64(1.0 - Float64(x / Float64(t * z))); elseif (y <= 4.4e-137) tmp = Float64(1.0 + Float64(x / Float64(y * z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.5e-39) tmp = 1.0; elseif (y <= 9.8e-197) tmp = 1.0 - (x / (t * z)); elseif (y <= 4.4e-137) tmp = 1.0 + (x / (y * z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.5e-39], 1.0, If[LessEqual[y, 9.8e-197], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e-137], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-39}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-197}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-137}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.4999999999999999e-39 or 4.4000000000000002e-137 < y Initial program 100.0%
Taylor expanded in t around 0 91.2%
Taylor expanded in x around 0 88.4%
if -2.4999999999999999e-39 < y < 9.8000000000000004e-197Initial program 94.2%
Taylor expanded in y around 0 78.2%
if 9.8000000000000004e-197 < y < 4.4000000000000002e-137Initial program 99.7%
Taylor expanded in t around 0 59.8%
Taylor expanded in z around inf 50.4%
+-commutative50.4%
*-commutative50.4%
Simplified50.4%
Final simplification83.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.05e-38)
1.0
(if (<= y 9.8e-197)
(- 1.0 (/ (/ x t) z))
(if (<= y 3.5e-140) (+ 1.0 (/ x (* y z))) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.05e-38) {
tmp = 1.0;
} else if (y <= 9.8e-197) {
tmp = 1.0 - ((x / t) / z);
} else if (y <= 3.5e-140) {
tmp = 1.0 + (x / (y * 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 <= (-1.05d-38)) then
tmp = 1.0d0
else if (y <= 9.8d-197) then
tmp = 1.0d0 - ((x / t) / z)
else if (y <= 3.5d-140) then
tmp = 1.0d0 + (x / (y * 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 <= -1.05e-38) {
tmp = 1.0;
} else if (y <= 9.8e-197) {
tmp = 1.0 - ((x / t) / z);
} else if (y <= 3.5e-140) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.05e-38: tmp = 1.0 elif y <= 9.8e-197: tmp = 1.0 - ((x / t) / z) elif y <= 3.5e-140: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.05e-38) tmp = 1.0; elseif (y <= 9.8e-197) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); elseif (y <= 3.5e-140) tmp = Float64(1.0 + Float64(x / Float64(y * z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.05e-38) tmp = 1.0; elseif (y <= 9.8e-197) tmp = 1.0 - ((x / t) / z); elseif (y <= 3.5e-140) tmp = 1.0 + (x / (y * z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.05e-38], 1.0, If[LessEqual[y, 9.8e-197], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e-140], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-38}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-197}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-140}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.05000000000000006e-38 or 3.4999999999999998e-140 < y Initial program 100.0%
Taylor expanded in t around 0 91.2%
Taylor expanded in x around 0 88.4%
if -1.05000000000000006e-38 < y < 9.8000000000000004e-197Initial program 94.2%
clear-num94.2%
inv-pow94.2%
*-commutative94.2%
associate-/l*96.3%
Applied egg-rr96.3%
Taylor expanded in y around 0 78.2%
associate-/r*78.5%
Simplified78.5%
if 9.8000000000000004e-197 < y < 3.4999999999999998e-140Initial program 99.7%
Taylor expanded in t around 0 59.8%
Taylor expanded in z around inf 50.4%
+-commutative50.4%
*-commutative50.4%
Simplified50.4%
Final simplification83.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -9e-13)
(- 1.0 (/ (/ x y) y))
(if (<= y 9.8e-197)
(- 1.0 (/ (/ x t) z))
(if (<= y 2e-139) (+ 1.0 (/ x (* y z))) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-13) {
tmp = 1.0 - ((x / y) / y);
} else if (y <= 9.8e-197) {
tmp = 1.0 - ((x / t) / z);
} else if (y <= 2e-139) {
tmp = 1.0 + (x / (y * 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 <= (-9d-13)) then
tmp = 1.0d0 - ((x / y) / y)
else if (y <= 9.8d-197) then
tmp = 1.0d0 - ((x / t) / z)
else if (y <= 2d-139) then
tmp = 1.0d0 + (x / (y * 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 <= -9e-13) {
tmp = 1.0 - ((x / y) / y);
} else if (y <= 9.8e-197) {
tmp = 1.0 - ((x / t) / z);
} else if (y <= 2e-139) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9e-13: tmp = 1.0 - ((x / y) / y) elif y <= 9.8e-197: tmp = 1.0 - ((x / t) / z) elif y <= 2e-139: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9e-13) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); elseif (y <= 9.8e-197) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); elseif (y <= 2e-139) tmp = Float64(1.0 + Float64(x / Float64(y * z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9e-13) tmp = 1.0 - ((x / y) / y); elseif (y <= 9.8e-197) tmp = 1.0 - ((x / t) / z); elseif (y <= 2e-139) tmp = 1.0 + (x / (y * z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e-13], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.8e-197], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e-139], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-13}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-197}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-139}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -9e-13Initial program 100.0%
Taylor expanded in t around 0 100.0%
*-commutative100.0%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in y around inf 96.9%
if -9e-13 < y < 9.8000000000000004e-197Initial program 94.8%
clear-num94.8%
inv-pow94.8%
*-commutative94.8%
associate-/l*96.7%
Applied egg-rr96.7%
Taylor expanded in y around 0 78.1%
associate-/r*78.5%
Simplified78.5%
if 9.8000000000000004e-197 < y < 2.00000000000000006e-139Initial program 99.7%
Taylor expanded in t around 0 59.8%
Taylor expanded in z around inf 50.4%
+-commutative50.4%
*-commutative50.4%
Simplified50.4%
if 2.00000000000000006e-139 < y Initial program 99.9%
Taylor expanded in t around 0 85.6%
Taylor expanded in x around 0 85.2%
Final simplification84.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -9.8e-12) (not (<= y 0.225))) (- 1.0 (/ (/ x y) y)) (+ 1.0 (/ x (* (- y t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9.8e-12) || !(y <= 0.225)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 + (x / ((y - 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 <= (-9.8d-12)) .or. (.not. (y <= 0.225d0))) then
tmp = 1.0d0 - ((x / y) / y)
else
tmp = 1.0d0 + (x / ((y - t) * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9.8e-12) || !(y <= 0.225)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 + (x / ((y - t) * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9.8e-12) or not (y <= 0.225): tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 + (x / ((y - t) * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9.8e-12) || !(y <= 0.225)) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = Float64(1.0 + Float64(x / Float64(Float64(y - t) * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -9.8e-12) || ~((y <= 0.225))) tmp = 1.0 - ((x / y) / y); else tmp = 1.0 + (x / ((y - t) * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9.8e-12], N[Not[LessEqual[y, 0.225]], $MachinePrecision]], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.8 \cdot 10^{-12} \lor \neg \left(y \leq 0.225\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - t\right) \cdot z}\\
\end{array}
\end{array}
if y < -9.79999999999999944e-12 or 0.225000000000000006 < y Initial program 100.0%
Taylor expanded in t around 0 97.7%
*-commutative97.7%
associate-/r*97.7%
Simplified97.7%
Taylor expanded in y around inf 95.8%
if -9.79999999999999944e-12 < y < 0.225000000000000006Initial program 96.4%
Taylor expanded in z around inf 78.2%
associate-*r/78.2%
neg-mul-178.2%
*-commutative78.2%
Simplified78.2%
div-inv78.2%
cancel-sign-sub78.2%
div-inv78.2%
+-commutative78.2%
Applied egg-rr78.2%
Final simplification87.0%
(FPCore (x y z t) :precision binary64 (if (<= z -5.2e-71) (+ 1.0 (/ x (* (- y t) z))) (if (<= z 7e-37) (- 1.0 (/ x (* y (- y t)))) (- 1.0 (/ x (* t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e-71) {
tmp = 1.0 + (x / ((y - t) * z));
} else if (z <= 7e-37) {
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 (z <= (-5.2d-71)) then
tmp = 1.0d0 + (x / ((y - t) * z))
else if (z <= 7d-37) 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 (z <= -5.2e-71) {
tmp = 1.0 + (x / ((y - t) * z));
} else if (z <= 7e-37) {
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 z <= -5.2e-71: tmp = 1.0 + (x / ((y - t) * z)) elif z <= 7e-37: 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 (z <= -5.2e-71) tmp = Float64(1.0 + Float64(x / Float64(Float64(y - t) * z))); elseif (z <= 7e-37) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))); else tmp = Float64(1.0 - Float64(x / Float64(t * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.2e-71) tmp = 1.0 + (x / ((y - t) * z)); elseif (z <= 7e-37) 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[LessEqual[z, -5.2e-71], N[(1.0 + N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e-37], N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-71}:\\
\;\;\;\;1 + \frac{x}{\left(y - t\right) \cdot z}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-37}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\
\end{array}
\end{array}
if z < -5.1999999999999997e-71Initial program 99.9%
Taylor expanded in z around inf 96.5%
associate-*r/96.5%
neg-mul-196.5%
*-commutative96.5%
Simplified96.5%
div-inv96.5%
cancel-sign-sub96.5%
div-inv96.5%
+-commutative96.5%
Applied egg-rr96.5%
if -5.1999999999999997e-71 < z < 7.0000000000000003e-37Initial program 95.4%
Taylor expanded in z around 0 86.1%
if 7.0000000000000003e-37 < z Initial program 100.0%
Taylor expanded in y around 0 83.2%
Final simplification88.4%
(FPCore (x y z t) :precision binary64 (if (<= z -3.2e-72) (+ 1.0 (/ x (* (- y t) z))) (if (<= z 2.3e-36) (- 1.0 (/ (/ x y) (- y t))) (- 1.0 (/ x (* t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.2e-72) {
tmp = 1.0 + (x / ((y - t) * z));
} else if (z <= 2.3e-36) {
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 (z <= (-3.2d-72)) then
tmp = 1.0d0 + (x / ((y - t) * z))
else if (z <= 2.3d-36) 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 (z <= -3.2e-72) {
tmp = 1.0 + (x / ((y - t) * z));
} else if (z <= 2.3e-36) {
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 z <= -3.2e-72: tmp = 1.0 + (x / ((y - t) * z)) elif z <= 2.3e-36: 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 (z <= -3.2e-72) tmp = Float64(1.0 + Float64(x / Float64(Float64(y - t) * z))); elseif (z <= 2.3e-36) tmp = Float64(1.0 - Float64(Float64(x / y) / Float64(y - t))); else tmp = Float64(1.0 - Float64(x / Float64(t * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.2e-72) tmp = 1.0 + (x / ((y - t) * z)); elseif (z <= 2.3e-36) 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[LessEqual[z, -3.2e-72], N[(1.0 + N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e-36], N[(1.0 - N[(N[(x / y), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-72}:\\
\;\;\;\;1 + \frac{x}{\left(y - t\right) \cdot z}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-36}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\
\end{array}
\end{array}
if z < -3.19999999999999999e-72Initial program 99.9%
Taylor expanded in z around inf 96.5%
associate-*r/96.5%
neg-mul-196.5%
*-commutative96.5%
Simplified96.5%
div-inv96.5%
cancel-sign-sub96.5%
div-inv96.5%
+-commutative96.5%
Applied egg-rr96.5%
if -3.19999999999999999e-72 < z < 2.29999999999999996e-36Initial program 95.4%
clear-num95.3%
inv-pow95.3%
*-commutative95.3%
associate-/l*97.0%
Applied egg-rr97.0%
Taylor expanded in z around 0 86.1%
associate-/r*86.8%
Simplified86.8%
if 2.29999999999999996e-36 < z Initial program 100.0%
Taylor expanded in y around 0 83.2%
Final simplification88.7%
(FPCore (x y z t) :precision binary64 (if (<= z -3.2e-71) (+ 1.0 (/ x (* (- y t) z))) (if (<= z 4.8e-36) (- 1.0 (/ (/ x (- y t)) y)) (- 1.0 (/ x (* t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.2e-71) {
tmp = 1.0 + (x / ((y - t) * z));
} else if (z <= 4.8e-36) {
tmp = 1.0 - ((x / (y - t)) / y);
} 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 (z <= (-3.2d-71)) then
tmp = 1.0d0 + (x / ((y - t) * z))
else if (z <= 4.8d-36) then
tmp = 1.0d0 - ((x / (y - t)) / y)
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 (z <= -3.2e-71) {
tmp = 1.0 + (x / ((y - t) * z));
} else if (z <= 4.8e-36) {
tmp = 1.0 - ((x / (y - t)) / y);
} else {
tmp = 1.0 - (x / (t * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.2e-71: tmp = 1.0 + (x / ((y - t) * z)) elif z <= 4.8e-36: tmp = 1.0 - ((x / (y - t)) / y) else: tmp = 1.0 - (x / (t * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.2e-71) tmp = Float64(1.0 + Float64(x / Float64(Float64(y - t) * z))); elseif (z <= 4.8e-36) tmp = Float64(1.0 - Float64(Float64(x / Float64(y - t)) / y)); else tmp = Float64(1.0 - Float64(x / Float64(t * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.2e-71) tmp = 1.0 + (x / ((y - t) * z)); elseif (z <= 4.8e-36) tmp = 1.0 - ((x / (y - t)) / y); else tmp = 1.0 - (x / (t * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.2e-71], N[(1.0 + N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e-36], N[(1.0 - N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-71}:\\
\;\;\;\;1 + \frac{x}{\left(y - t\right) \cdot z}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-36}:\\
\;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{t \cdot z}\\
\end{array}
\end{array}
if z < -3.1999999999999999e-71Initial program 99.9%
Taylor expanded in z around inf 96.5%
associate-*r/96.5%
neg-mul-196.5%
*-commutative96.5%
Simplified96.5%
div-inv96.5%
cancel-sign-sub96.5%
div-inv96.5%
+-commutative96.5%
Applied egg-rr96.5%
if -3.1999999999999999e-71 < z < 4.8e-36Initial program 95.4%
Taylor expanded in z around 0 86.1%
*-commutative86.1%
associate-/r*87.9%
Simplified87.9%
if 4.8e-36 < z Initial program 100.0%
Taylor expanded in y around 0 83.2%
Final simplification89.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -5e-71)
(+ 1.0 (/ x (* (- y t) z)))
(if (<= z 6.5e-160)
(- 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 <= -5e-71) {
tmp = 1.0 + (x / ((y - t) * z));
} else if (z <= 6.5e-160) {
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 <= (-5d-71)) then
tmp = 1.0d0 + (x / ((y - t) * z))
else if (z <= 6.5d-160) 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 <= -5e-71) {
tmp = 1.0 + (x / ((y - t) * z));
} else if (z <= 6.5e-160) {
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 <= -5e-71: tmp = 1.0 + (x / ((y - t) * z)) elif z <= 6.5e-160: 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 <= -5e-71) tmp = Float64(1.0 + Float64(x / Float64(Float64(y - t) * z))); elseif (z <= 6.5e-160) tmp = Float64(1.0 - Float64(Float64(x / Float64(y - t)) / y)); else tmp = Float64(1.0 + Float64(x / Float64(t * Float64(y - z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5e-71) tmp = 1.0 + (x / ((y - t) * z)); elseif (z <= 6.5e-160) 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, -5e-71], N[(1.0 + N[(x / N[(N[(y - t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-160], N[(1.0 - N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-71}:\\
\;\;\;\;1 + \frac{x}{\left(y - t\right) \cdot z}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-160}:\\
\;\;\;\;1 - \frac{\frac{x}{y - t}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{t \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if z < -4.99999999999999998e-71Initial program 99.9%
Taylor expanded in z around inf 96.5%
associate-*r/96.5%
neg-mul-196.5%
*-commutative96.5%
Simplified96.5%
div-inv96.5%
cancel-sign-sub96.5%
div-inv96.5%
+-commutative96.5%
Applied egg-rr96.5%
if -4.99999999999999998e-71 < z < 6.4999999999999996e-160Initial program 94.3%
Taylor expanded in z around 0 84.3%
*-commutative84.3%
associate-/r*86.4%
Simplified86.4%
if 6.4999999999999996e-160 < z Initial program 100.0%
Taylor expanded in t around inf 87.1%
associate-*r/87.1%
neg-mul-187.1%
Simplified87.1%
Final simplification89.8%
(FPCore (x y z t) :precision binary64 (+ 1.0 (* (/ x (- y z)) (/ -1.0 (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 + ((x / (y - z)) * (-1.0 / (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)) * ((-1.0d0) / (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + ((x / (y - z)) * (-1.0 / (y - t)));
}
def code(x, y, z, t): return 1.0 + ((x / (y - z)) * (-1.0 / (y - t)))
function code(x, y, z, t) return Float64(1.0 + Float64(Float64(x / Float64(y - z)) * Float64(-1.0 / Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 + ((x / (y - z)) * (-1.0 / (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{x}{y - z} \cdot \frac{-1}{y - t}
\end{array}
Initial program 98.2%
associate-/r*98.8%
div-inv98.8%
Applied egg-rr98.8%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y t) (- y z)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - t) * (y - z)));
}
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) * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - t) * (y - z)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - t) * (y - z)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - t) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - t) * (y - z))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - t\right) \cdot \left(y - z\right)}
\end{array}
Initial program 98.2%
Final simplification98.2%
(FPCore (x y z t) :precision binary64 (if (<= x -1.46e+256) (+ 1.0 (/ x (* y z))) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.46e+256) {
tmp = 1.0 + (x / (y * 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 (x <= (-1.46d+256)) then
tmp = 1.0d0 + (x / (y * 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 (x <= -1.46e+256) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.46e+256: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.46e+256) tmp = Float64(1.0 + Float64(x / Float64(y * z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.46e+256) tmp = 1.0 + (x / (y * z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.46e+256], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.46 \cdot 10^{+256}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.46000000000000004e256Initial program 100.0%
Taylor expanded in t around 0 45.0%
Taylor expanded in z around inf 45.0%
+-commutative45.0%
*-commutative45.0%
Simplified45.0%
if -1.46000000000000004e256 < x Initial program 98.1%
Taylor expanded in t around 0 75.0%
Taylor expanded in x around 0 77.3%
Final simplification76.2%
(FPCore (x y z t) :precision binary64 (if (<= x -1.1e+165) (/ (- x) (* t z)) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.1e+165) {
tmp = -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 (x <= (-1.1d+165)) then
tmp = -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 (x <= -1.1e+165) {
tmp = -x / (t * z);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.1e+165: tmp = -x / (t * z) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.1e+165) tmp = Float64(Float64(-x) / Float64(t * z)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.1e+165) tmp = -x / (t * z); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.1e+165], N[((-x) / N[(t * z), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{+165}:\\
\;\;\;\;\frac{-x}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.1e165Initial program 99.9%
Taylor expanded in z around inf 64.9%
associate-*r/64.9%
neg-mul-164.9%
*-commutative64.9%
Simplified64.9%
Taylor expanded in x around inf 51.9%
associate-/r*43.4%
Simplified43.4%
Taylor expanded in y around 0 47.1%
mul-1-neg47.1%
Simplified47.1%
if -1.1e165 < x Initial program 98.0%
Taylor expanded in t around 0 75.7%
Taylor expanded in x around 0 79.7%
Final simplification76.9%
(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.2%
Taylor expanded in t around 0 74.0%
Taylor expanded in x around 0 75.1%
Final simplification75.1%
herbie shell --seed 2023318
(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)))))