
(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)) (/ -1.0 (- y z)))))
double code(double x, double y, double z, double t) {
return 1.0 + ((x / (y - t)) * (-1.0 / (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)) * ((-1.0d0) / (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + ((x / (y - t)) * (-1.0 / (y - z)));
}
def code(x, y, z, t): return 1.0 + ((x / (y - t)) * (-1.0 / (y - z)))
function code(x, y, z, t) return Float64(1.0 + Float64(Float64(x / Float64(y - t)) * Float64(-1.0 / Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = 1.0 + ((x / (y - t)) * (-1.0 / (y - z))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{x}{y - t} \cdot \frac{-1}{y - z}
\end{array}
Initial program 99.2%
*-un-lft-identity99.2%
times-frac99.5%
Applied egg-rr99.5%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (/ x (* y (- y t))))))
(if (<= y -5.4e-14)
t_1
(if (<= y -1.5e-122)
(+ 1.0 (/ x (* y z)))
(if (or (<= y -3.7e-162) (not (<= y 9.6e-45)))
t_1
(- 1.0 (/ x (* z t))))))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / (y * (y - t)));
double tmp;
if (y <= -5.4e-14) {
tmp = t_1;
} else if (y <= -1.5e-122) {
tmp = 1.0 + (x / (y * z));
} else if ((y <= -3.7e-162) || !(y <= 9.6e-45)) {
tmp = t_1;
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - (x / (y * (y - t)))
if (y <= (-5.4d-14)) then
tmp = t_1
else if (y <= (-1.5d-122)) then
tmp = 1.0d0 + (x / (y * z))
else if ((y <= (-3.7d-162)) .or. (.not. (y <= 9.6d-45))) then
tmp = t_1
else
tmp = 1.0d0 - (x / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - (x / (y * (y - t)));
double tmp;
if (y <= -5.4e-14) {
tmp = t_1;
} else if (y <= -1.5e-122) {
tmp = 1.0 + (x / (y * z));
} else if ((y <= -3.7e-162) || !(y <= 9.6e-45)) {
tmp = t_1;
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 - (x / (y * (y - t))) tmp = 0 if y <= -5.4e-14: tmp = t_1 elif y <= -1.5e-122: tmp = 1.0 + (x / (y * z)) elif (y <= -3.7e-162) or not (y <= 9.6e-45): tmp = t_1 else: tmp = 1.0 - (x / (z * t)) return tmp
function code(x, y, z, t) t_1 = Float64(1.0 - Float64(x / Float64(y * Float64(y - t)))) tmp = 0.0 if (y <= -5.4e-14) tmp = t_1; elseif (y <= -1.5e-122) tmp = Float64(1.0 + Float64(x / Float64(y * z))); elseif ((y <= -3.7e-162) || !(y <= 9.6e-45)) tmp = t_1; else tmp = Float64(1.0 - Float64(x / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 - (x / (y * (y - t))); tmp = 0.0; if (y <= -5.4e-14) tmp = t_1; elseif (y <= -1.5e-122) tmp = 1.0 + (x / (y * z)); elseif ((y <= -3.7e-162) || ~((y <= 9.6e-45))) tmp = t_1; else tmp = 1.0 - (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(x / N[(y * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.4e-14], t$95$1, If[LessEqual[y, -1.5e-122], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -3.7e-162], N[Not[LessEqual[y, 9.6e-45]], $MachinePrecision]], t$95$1, N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \frac{x}{y \cdot \left(y - t\right)}\\
\mathbf{if}\;y \leq -5.4 \cdot 10^{-14}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-122}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{elif}\;y \leq -3.7 \cdot 10^{-162} \lor \neg \left(y \leq 9.6 \cdot 10^{-45}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -5.3999999999999997e-14 or -1.50000000000000002e-122 < y < -3.7000000000000002e-162 or 9.5999999999999996e-45 < y Initial program 99.9%
Taylor expanded in z around 0 87.5%
if -5.3999999999999997e-14 < y < -1.50000000000000002e-122Initial program 99.9%
Taylor expanded in t around 0 62.2%
Taylor expanded in y around 0 49.7%
associate-*r/49.7%
neg-mul-149.7%
*-commutative49.7%
Simplified49.7%
if -3.7000000000000002e-162 < y < 9.5999999999999996e-45Initial program 97.7%
Taylor expanded in y around 0 87.2%
Final simplification83.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (/ (/ x y) y))))
(if (<= y -2.2e-13)
t_1
(if (<= y -1.25e-144)
(+ 1.0 (/ x (* y z)))
(if (<= y 2.9e-43) (- 1.0 (/ x (* z t))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - ((x / y) / y);
double tmp;
if (y <= -2.2e-13) {
tmp = t_1;
} else if (y <= -1.25e-144) {
tmp = 1.0 + (x / (y * z));
} else if (y <= 2.9e-43) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - ((x / y) / y)
if (y <= (-2.2d-13)) then
tmp = t_1
else if (y <= (-1.25d-144)) then
tmp = 1.0d0 + (x / (y * z))
else if (y <= 2.9d-43) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - ((x / y) / y);
double tmp;
if (y <= -2.2e-13) {
tmp = t_1;
} else if (y <= -1.25e-144) {
tmp = 1.0 + (x / (y * z));
} else if (y <= 2.9e-43) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 - ((x / y) / y) tmp = 0 if y <= -2.2e-13: tmp = t_1 elif y <= -1.25e-144: tmp = 1.0 + (x / (y * z)) elif y <= 2.9e-43: tmp = 1.0 - (x / (z * t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 - Float64(Float64(x / y) / y)) tmp = 0.0 if (y <= -2.2e-13) tmp = t_1; elseif (y <= -1.25e-144) tmp = Float64(1.0 + Float64(x / Float64(y * z))); elseif (y <= 2.9e-43) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 - ((x / y) / y); tmp = 0.0; if (y <= -2.2e-13) tmp = t_1; elseif (y <= -1.25e-144) tmp = 1.0 + (x / (y * z)); elseif (y <= 2.9e-43) tmp = 1.0 - (x / (z * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e-13], t$95$1, If[LessEqual[y, -1.25e-144], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e-43], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \frac{\frac{x}{y}}{y}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.25 \cdot 10^{-144}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-43}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.19999999999999997e-13 or 2.9000000000000001e-43 < y Initial program 100.0%
Taylor expanded in z around 0 90.8%
*-commutative90.8%
associate-/r*90.8%
Simplified90.8%
Taylor expanded in y around inf 84.7%
if -2.19999999999999997e-13 < y < -1.2499999999999999e-144Initial program 99.9%
Taylor expanded in t around 0 63.8%
Taylor expanded in y around 0 50.3%
associate-*r/50.3%
neg-mul-150.3%
*-commutative50.3%
Simplified50.3%
if -1.2499999999999999e-144 < y < 2.9000000000000001e-43Initial program 97.8%
Taylor expanded in y around 0 86.7%
Final simplification81.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (/ (/ x y) y))))
(if (<= y -1.38e-12)
t_1
(if (<= y -1.5e-144)
(+ 1.0 (/ (/ x z) y))
(if (<= y 1.7e-43) (- 1.0 (/ x (* z t))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - ((x / y) / y);
double tmp;
if (y <= -1.38e-12) {
tmp = t_1;
} else if (y <= -1.5e-144) {
tmp = 1.0 + ((x / z) / y);
} else if (y <= 1.7e-43) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - ((x / y) / y)
if (y <= (-1.38d-12)) then
tmp = t_1
else if (y <= (-1.5d-144)) then
tmp = 1.0d0 + ((x / z) / y)
else if (y <= 1.7d-43) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - ((x / y) / y);
double tmp;
if (y <= -1.38e-12) {
tmp = t_1;
} else if (y <= -1.5e-144) {
tmp = 1.0 + ((x / z) / y);
} else if (y <= 1.7e-43) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 - ((x / y) / y) tmp = 0 if y <= -1.38e-12: tmp = t_1 elif y <= -1.5e-144: tmp = 1.0 + ((x / z) / y) elif y <= 1.7e-43: tmp = 1.0 - (x / (z * t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 - Float64(Float64(x / y) / y)) tmp = 0.0 if (y <= -1.38e-12) tmp = t_1; elseif (y <= -1.5e-144) tmp = Float64(1.0 + Float64(Float64(x / z) / y)); elseif (y <= 1.7e-43) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 - ((x / y) / y); tmp = 0.0; if (y <= -1.38e-12) tmp = t_1; elseif (y <= -1.5e-144) tmp = 1.0 + ((x / z) / y); elseif (y <= 1.7e-43) tmp = 1.0 - (x / (z * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.38e-12], t$95$1, If[LessEqual[y, -1.5e-144], N[(1.0 + N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-43], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \frac{\frac{x}{y}}{y}\\
\mathbf{if}\;y \leq -1.38 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-144}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-43}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.37999999999999998e-12 or 1.7e-43 < y Initial program 100.0%
Taylor expanded in z around 0 90.8%
*-commutative90.8%
associate-/r*90.8%
Simplified90.8%
Taylor expanded in y around inf 84.7%
if -1.37999999999999998e-12 < y < -1.4999999999999999e-144Initial program 99.9%
Taylor expanded in t around 0 63.8%
Taylor expanded in y around 0 50.3%
associate-*r/50.3%
neg-mul-150.3%
*-commutative50.3%
Simplified50.3%
Taylor expanded in x around 0 50.3%
associate-*r/50.3%
*-commutative50.3%
associate-/r*50.3%
neg-mul-150.3%
Simplified50.3%
if -1.4999999999999999e-144 < y < 1.7e-43Initial program 97.8%
Taylor expanded in y around 0 86.7%
Final simplification81.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.5e-144) (not (<= y 3.2e-45))) (- 1.0 (/ x (* y (- y z)))) (- 1.0 (/ x (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.5e-144) || !(y <= 3.2e-45)) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2.5d-144)) .or. (.not. (y <= 3.2d-45))) then
tmp = 1.0d0 - (x / (y * (y - z)))
else
tmp = 1.0d0 - (x / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.5e-144) || !(y <= 3.2e-45)) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.5e-144) or not (y <= 3.2e-45): tmp = 1.0 - (x / (y * (y - z))) else: tmp = 1.0 - (x / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.5e-144) || !(y <= 3.2e-45)) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); else tmp = Float64(1.0 - Float64(x / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.5e-144) || ~((y <= 3.2e-45))) tmp = 1.0 - (x / (y * (y - z))); else tmp = 1.0 - (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.5e-144], N[Not[LessEqual[y, 3.2e-45]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-144} \lor \neg \left(y \leq 3.2 \cdot 10^{-45}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -2.4999999999999999e-144 or 3.20000000000000007e-45 < y Initial program 100.0%
Taylor expanded in t around 0 89.3%
if -2.4999999999999999e-144 < y < 3.20000000000000007e-45Initial program 97.8%
Taylor expanded in y around 0 86.7%
Final simplification88.4%
(FPCore (x y z t)
:precision binary64
(if (<= t -2.25e-7)
(- 1.0 (/ (/ x t) z))
(if (<= t 3.7e-106)
(- 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 <= -2.25e-7) {
tmp = 1.0 - ((x / t) / z);
} else if (t <= 3.7e-106) {
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 <= (-2.25d-7)) then
tmp = 1.0d0 - ((x / t) / z)
else if (t <= 3.7d-106) 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 <= -2.25e-7) {
tmp = 1.0 - ((x / t) / z);
} else if (t <= 3.7e-106) {
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 <= -2.25e-7: tmp = 1.0 - ((x / t) / z) elif t <= 3.7e-106: 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 <= -2.25e-7) tmp = Float64(1.0 - Float64(Float64(x / t) / z)); elseif (t <= 3.7e-106) tmp = Float64(1.0 - Float64(Float64(x / Float64(y - 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 <= -2.25e-7) tmp = 1.0 - ((x / t) / z); elseif (t <= 3.7e-106) 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, -2.25e-7], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e-106], N[(1.0 - N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $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 -2.25 \cdot 10^{-7}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-106}:\\
\;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -2.2499999999999999e-7Initial program 99.9%
Taylor expanded in t around inf 96.2%
associate-*r/96.2%
neg-mul-196.2%
Simplified96.2%
Taylor expanded in y around 0 72.5%
associate-/r*72.5%
Simplified72.5%
if -2.2499999999999999e-7 < t < 3.69999999999999979e-106Initial program 98.0%
Taylor expanded in t around 0 83.6%
*-commutative83.6%
associate-/r*84.6%
Simplified84.6%
if 3.69999999999999979e-106 < t Initial program 99.9%
Taylor expanded in t around inf 94.9%
associate-*r/94.9%
neg-mul-194.9%
Simplified94.9%
Final simplification83.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.2e+52) (not (<= y 2e+85))) (- 1.0 (/ x (* y z))) (- 1.0 (/ x (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.2e+52) || !(y <= 2e+85)) {
tmp = 1.0 - (x / (y * z));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-4.2d+52)) .or. (.not. (y <= 2d+85))) then
tmp = 1.0d0 - (x / (y * z))
else
tmp = 1.0d0 - (x / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.2e+52) || !(y <= 2e+85)) {
tmp = 1.0 - (x / (y * z));
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.2e+52) or not (y <= 2e+85): tmp = 1.0 - (x / (y * z)) else: tmp = 1.0 - (x / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.2e+52) || !(y <= 2e+85)) tmp = Float64(1.0 - Float64(x / Float64(y * z))); else tmp = Float64(1.0 - Float64(x / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.2e+52) || ~((y <= 2e+85))) tmp = 1.0 - (x / (y * z)); else tmp = 1.0 - (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.2e+52], N[Not[LessEqual[y, 2e+85]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+52} \lor \neg \left(y \leq 2 \cdot 10^{+85}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -4.2e52 or 2e85 < y Initial program 100.0%
Taylor expanded in t around 0 99.4%
Taylor expanded in y around 0 72.4%
associate-*r/72.4%
neg-mul-172.4%
*-commutative72.4%
Simplified72.4%
expm1-log1p-u71.6%
expm1-udef71.6%
add-sqr-sqrt37.5%
sqrt-unprod57.9%
sqr-neg57.9%
sqrt-unprod34.3%
add-sqr-sqrt71.8%
associate-/r*71.8%
Applied egg-rr71.8%
expm1-def71.8%
expm1-log1p72.3%
associate-/l/72.4%
Simplified72.4%
if -4.2e52 < y < 2e85Initial program 98.7%
Taylor expanded in y around 0 71.3%
Final simplification71.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.8e-101) (not (<= y 6e-44))) (- 1.0 (/ (/ x y) y)) (- 1.0 (/ x (* z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.8e-101) || !(y <= 6e-44)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-3.8d-101)) .or. (.not. (y <= 6d-44))) then
tmp = 1.0d0 - ((x / y) / y)
else
tmp = 1.0d0 - (x / (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.8e-101) || !(y <= 6e-44)) {
tmp = 1.0 - ((x / y) / y);
} else {
tmp = 1.0 - (x / (z * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.8e-101) or not (y <= 6e-44): tmp = 1.0 - ((x / y) / y) else: tmp = 1.0 - (x / (z * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.8e-101) || !(y <= 6e-44)) tmp = Float64(1.0 - Float64(Float64(x / y) / y)); else tmp = Float64(1.0 - Float64(x / Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.8e-101) || ~((y <= 6e-44))) tmp = 1.0 - ((x / y) / y); else tmp = 1.0 - (x / (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.8e-101], N[Not[LessEqual[y, 6e-44]], $MachinePrecision]], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{-101} \lor \neg \left(y \leq 6 \cdot 10^{-44}\right):\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\end{array}
\end{array}
if y < -3.8000000000000001e-101 or 6.0000000000000005e-44 < y Initial program 100.0%
Taylor expanded in z around 0 88.9%
*-commutative88.9%
associate-/r*88.9%
Simplified88.9%
Taylor expanded in y around inf 82.6%
if -3.8000000000000001e-101 < y < 6.0000000000000005e-44Initial program 98.1%
Taylor expanded in y around 0 79.8%
Final simplification81.4%
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* (- y z) (- y t)))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / ((y - z) * (y - t)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / ((y - z) * (y - t)));
}
def code(x, y, z, t): return 1.0 - (x / ((y - z) * (y - t)))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(Float64(y - z) * Float64(y - t)))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / ((y - z) * (y - t))); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(N[(y - z), $MachinePrecision] * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{\left(y - z\right) \cdot \left(y - t\right)}
\end{array}
Initial program 99.2%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (- 1.0 (/ x (* z t))))
double code(double x, double y, double z, double t) {
return 1.0 - (x / (z * t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - (x / (z * t))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 - (x / (z * t));
}
def code(x, y, z, t): return 1.0 - (x / (z * t))
function code(x, y, z, t) return Float64(1.0 - Float64(x / Float64(z * t))) end
function tmp = code(x, y, z, t) tmp = 1.0 - (x / (z * t)); end
code[x_, y_, z_, t_] := N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{x}{z \cdot t}
\end{array}
Initial program 99.2%
Taylor expanded in y around 0 60.8%
Final simplification60.8%
herbie shell --seed 2023320
(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)))))