
(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 z) (- t y)))))
double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + (x / ((y - z) * (t - y)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - z) * (t - y)));
}
def code(x, y, z, t): return 1.0 + (x / ((y - z) * (t - y)))
function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(Float64(y - z) * Float64(t - y)))) end
function tmp = code(x, y, z, t) tmp = 1.0 + (x / ((y - z) * (t - y))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{x}{\left(y - z\right) \cdot \left(t - y\right)}
\end{array}
Initial program 99.7%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (if (<= z -1.8e+168) 1.0 (if (<= z -1.45e+32) (+ 1.0 (/ (/ x z) y)) (+ 1.0 (/ x (* y (- t y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e+168) {
tmp = 1.0;
} else if (z <= -1.45e+32) {
tmp = 1.0 + ((x / z) / y);
} else {
tmp = 1.0 + (x / (y * (t - y)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.8d+168)) then
tmp = 1.0d0
else if (z <= (-1.45d+32)) then
tmp = 1.0d0 + ((x / z) / y)
else
tmp = 1.0d0 + (x / (y * (t - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.8e+168) {
tmp = 1.0;
} else if (z <= -1.45e+32) {
tmp = 1.0 + ((x / z) / y);
} else {
tmp = 1.0 + (x / (y * (t - y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.8e+168: tmp = 1.0 elif z <= -1.45e+32: tmp = 1.0 + ((x / z) / y) else: tmp = 1.0 + (x / (y * (t - y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.8e+168) tmp = 1.0; elseif (z <= -1.45e+32) tmp = Float64(1.0 + Float64(Float64(x / z) / y)); else tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.8e+168) tmp = 1.0; elseif (z <= -1.45e+32) tmp = 1.0 + ((x / z) / y); else tmp = 1.0 + (x / (y * (t - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.8e+168], 1.0, If[LessEqual[z, -1.45e+32], N[(1.0 + N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+168}:\\
\;\;\;\;1\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{+32}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\end{array}
\end{array}
if z < -1.8e168Initial program 99.9%
Taylor expanded in t around inf 80.0%
associate-*r/80.0%
neg-mul-180.0%
Simplified80.0%
Taylor expanded in y around inf 52.8%
associate-*r/52.8%
mul-1-neg52.8%
Simplified52.8%
add-sqr-sqrt22.5%
sqrt-unprod54.2%
sqr-neg54.2%
sqrt-unprod30.1%
add-sqr-sqrt52.5%
*-un-lft-identity52.5%
*-commutative52.5%
associate-/r*52.4%
Applied egg-rr52.4%
*-lft-identity52.4%
associate-/l/52.5%
Simplified52.5%
Taylor expanded in x around 0 87.4%
if -1.8e168 < z < -1.45000000000000001e32Initial program 99.9%
Taylor expanded in t around 0 81.8%
Taylor expanded in y around 0 79.5%
associate-*r/79.5%
mul-1-neg79.5%
*-commutative79.5%
Simplified79.5%
div-inv79.5%
cancel-sign-sub79.5%
div-inv79.5%
+-commutative79.5%
associate-/r*79.6%
Applied egg-rr79.6%
if -1.45000000000000001e32 < z Initial program 99.6%
Taylor expanded in z around 0 80.5%
Final simplification81.4%
(FPCore (x y z t)
:precision binary64
(if (<= t -2.1e-14)
1.0
(if (<= t 4.8e-29)
(+ 1.0 (/ x (* y (- z y))))
(+ 1.0 (/ x (* y (- t y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.1e-14) {
tmp = 1.0;
} else if (t <= 4.8e-29) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 + (x / (y * (t - y)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-2.1d-14)) then
tmp = 1.0d0
else if (t <= 4.8d-29) then
tmp = 1.0d0 + (x / (y * (z - y)))
else
tmp = 1.0d0 + (x / (y * (t - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.1e-14) {
tmp = 1.0;
} else if (t <= 4.8e-29) {
tmp = 1.0 + (x / (y * (z - y)));
} else {
tmp = 1.0 + (x / (y * (t - y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.1e-14: tmp = 1.0 elif t <= 4.8e-29: tmp = 1.0 + (x / (y * (z - y))) else: tmp = 1.0 + (x / (y * (t - y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.1e-14) tmp = 1.0; elseif (t <= 4.8e-29) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); else tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.1e-14) tmp = 1.0; elseif (t <= 4.8e-29) tmp = 1.0 + (x / (y * (z - y))); else tmp = 1.0 + (x / (y * (t - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.1e-14], 1.0, If[LessEqual[t, 4.8e-29], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{-14}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-29}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\end{array}
\end{array}
if t < -2.0999999999999999e-14Initial program 100.0%
Taylor expanded in t around inf 94.4%
associate-*r/94.4%
neg-mul-194.4%
Simplified94.4%
Taylor expanded in y around inf 72.9%
associate-*r/72.9%
mul-1-neg72.9%
Simplified72.9%
add-sqr-sqrt37.3%
sqrt-unprod61.4%
sqr-neg61.4%
sqrt-unprod34.0%
add-sqr-sqrt66.3%
*-un-lft-identity66.3%
*-commutative66.3%
associate-/r*66.2%
Applied egg-rr66.2%
*-lft-identity66.2%
associate-/l/66.3%
Simplified66.3%
Taylor expanded in x around 0 83.7%
if -2.0999999999999999e-14 < t < 4.79999999999999984e-29Initial program 99.3%
Taylor expanded in t around 0 90.7%
if 4.79999999999999984e-29 < t Initial program 99.9%
Taylor expanded in z around 0 87.9%
Final simplification87.9%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.5e-13)
1.0
(if (<= t 2.1e-15)
(- 1.0 (/ (/ x (- y z)) y))
(+ 1.0 (/ x (* y (- t y)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.5e-13) {
tmp = 1.0;
} else if (t <= 2.1e-15) {
tmp = 1.0 - ((x / (y - z)) / y);
} else {
tmp = 1.0 + (x / (y * (t - y)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.5d-13)) then
tmp = 1.0d0
else if (t <= 2.1d-15) then
tmp = 1.0d0 - ((x / (y - z)) / y)
else
tmp = 1.0d0 + (x / (y * (t - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.5e-13) {
tmp = 1.0;
} else if (t <= 2.1e-15) {
tmp = 1.0 - ((x / (y - z)) / y);
} else {
tmp = 1.0 + (x / (y * (t - y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.5e-13: tmp = 1.0 elif t <= 2.1e-15: tmp = 1.0 - ((x / (y - z)) / y) else: tmp = 1.0 + (x / (y * (t - y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.5e-13) tmp = 1.0; elseif (t <= 2.1e-15) tmp = Float64(1.0 - Float64(Float64(x / Float64(y - z)) / y)); else tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.5e-13) tmp = 1.0; elseif (t <= 2.1e-15) tmp = 1.0 - ((x / (y - z)) / y); else tmp = 1.0 + (x / (y * (t - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.5e-13], 1.0, If[LessEqual[t, 2.1e-15], N[(1.0 - N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{-13}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-15}:\\
\;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\end{array}
\end{array}
if t < -1.49999999999999992e-13Initial program 100.0%
Taylor expanded in t around inf 94.4%
associate-*r/94.4%
neg-mul-194.4%
Simplified94.4%
Taylor expanded in y around inf 72.9%
associate-*r/72.9%
mul-1-neg72.9%
Simplified72.9%
add-sqr-sqrt37.3%
sqrt-unprod61.4%
sqr-neg61.4%
sqrt-unprod34.0%
add-sqr-sqrt66.3%
*-un-lft-identity66.3%
*-commutative66.3%
associate-/r*66.2%
Applied egg-rr66.2%
*-lft-identity66.2%
associate-/l/66.3%
Simplified66.3%
Taylor expanded in x around 0 83.7%
if -1.49999999999999992e-13 < t < 2.09999999999999981e-15Initial program 99.3%
clear-num99.3%
associate-/r/99.0%
Applied egg-rr99.0%
Taylor expanded in t around 0 90.9%
*-lft-identity90.9%
times-frac91.0%
associate-*l/91.0%
*-lft-identity91.0%
Simplified91.0%
if 2.09999999999999981e-15 < t Initial program 99.9%
Taylor expanded in z around 0 87.3%
Final simplification87.9%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.25e-13)
1.0
(if (<= t 600000000000.0)
(- 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 <= -1.25e-13) {
tmp = 1.0;
} else if (t <= 600000000000.0) {
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 <= (-1.25d-13)) then
tmp = 1.0d0
else if (t <= 600000000000.0d0) 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 <= -1.25e-13) {
tmp = 1.0;
} else if (t <= 600000000000.0) {
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 <= -1.25e-13: tmp = 1.0 elif t <= 600000000000.0: 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 <= -1.25e-13) tmp = 1.0; elseif (t <= 600000000000.0) 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 <= -1.25e-13) tmp = 1.0; elseif (t <= 600000000000.0) 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, -1.25e-13], 1.0, If[LessEqual[t, 600000000000.0], 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 -1.25 \cdot 10^{-13}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 600000000000:\\
\;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -1.24999999999999997e-13Initial program 100.0%
Taylor expanded in t around inf 94.4%
associate-*r/94.4%
neg-mul-194.4%
Simplified94.4%
Taylor expanded in y around inf 72.9%
associate-*r/72.9%
mul-1-neg72.9%
Simplified72.9%
add-sqr-sqrt37.3%
sqrt-unprod61.4%
sqr-neg61.4%
sqrt-unprod34.0%
add-sqr-sqrt66.3%
*-un-lft-identity66.3%
*-commutative66.3%
associate-/r*66.2%
Applied egg-rr66.2%
*-lft-identity66.2%
associate-/l/66.3%
Simplified66.3%
Taylor expanded in x around 0 83.7%
if -1.24999999999999997e-13 < t < 6e11Initial program 99.3%
clear-num99.3%
associate-/r/99.1%
Applied egg-rr99.1%
Taylor expanded in t around 0 91.3%
*-lft-identity91.3%
times-frac91.3%
associate-*l/91.3%
*-lft-identity91.3%
Simplified91.3%
if 6e11 < t Initial program 100.0%
Taylor expanded in t around inf 97.2%
associate-*r/97.2%
neg-mul-197.2%
Simplified97.2%
Final simplification90.3%
(FPCore (x y z t)
:precision binary64
(if (<= t -3.1e-104)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= t 330000000000.0)
(- 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 <= -3.1e-104) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 330000000000.0) {
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 <= (-3.1d-104)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (t <= 330000000000.0d0) 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 <= -3.1e-104) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (t <= 330000000000.0) {
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 <= -3.1e-104: tmp = 1.0 + ((x / z) / (y - t)) elif t <= 330000000000.0: 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 <= -3.1e-104) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (t <= 330000000000.0) 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 <= -3.1e-104) tmp = 1.0 + ((x / z) / (y - t)); elseif (t <= 330000000000.0) 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, -3.1e-104], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 330000000000.0], 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 -3.1 \cdot 10^{-104}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;t \leq 330000000000:\\
\;\;\;\;1 - \frac{\frac{x}{y - z}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -3.09999999999999976e-104Initial program 100.0%
Taylor expanded in z around inf 79.9%
mul-1-neg79.9%
associate-/r*78.0%
distribute-neg-frac78.0%
Simplified78.0%
if -3.09999999999999976e-104 < t < 3.3e11Initial program 99.2%
clear-num99.2%
associate-/r/98.9%
Applied egg-rr98.9%
Taylor expanded in t around 0 91.7%
*-lft-identity91.7%
times-frac91.7%
associate-*l/91.8%
*-lft-identity91.8%
Simplified91.8%
if 3.3e11 < t Initial program 100.0%
Taylor expanded in t around inf 97.2%
associate-*r/97.2%
neg-mul-197.2%
Simplified97.2%
Final simplification87.9%
(FPCore (x y z t) :precision binary64 (if (<= t -1.9e-115) 1.0 (if (<= t 8.2e-162) (+ 1.0 (/ (/ x z) y)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.9e-115) {
tmp = 1.0;
} else if (t <= 8.2e-162) {
tmp = 1.0 + ((x / 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 (t <= (-1.9d-115)) then
tmp = 1.0d0
else if (t <= 8.2d-162) then
tmp = 1.0d0 + ((x / 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 (t <= -1.9e-115) {
tmp = 1.0;
} else if (t <= 8.2e-162) {
tmp = 1.0 + ((x / z) / y);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.9e-115: tmp = 1.0 elif t <= 8.2e-162: tmp = 1.0 + ((x / z) / y) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.9e-115) tmp = 1.0; elseif (t <= 8.2e-162) tmp = Float64(1.0 + Float64(Float64(x / z) / y)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.9e-115) tmp = 1.0; elseif (t <= 8.2e-162) tmp = 1.0 + ((x / z) / y); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.9e-115], 1.0, If[LessEqual[t, 8.2e-162], N[(1.0 + N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-115}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{-162}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -1.89999999999999996e-115 or 8.20000000000000039e-162 < t Initial program 99.6%
Taylor expanded in t around inf 87.9%
associate-*r/87.9%
neg-mul-187.9%
Simplified87.9%
Taylor expanded in y around inf 69.9%
associate-*r/69.9%
mul-1-neg69.9%
Simplified69.9%
add-sqr-sqrt35.4%
sqrt-unprod62.0%
sqr-neg62.0%
sqrt-unprod31.2%
add-sqr-sqrt62.9%
*-un-lft-identity62.9%
*-commutative62.9%
associate-/r*62.9%
Applied egg-rr62.9%
*-lft-identity62.9%
associate-/l/62.9%
Simplified62.9%
Taylor expanded in x around 0 83.2%
if -1.89999999999999996e-115 < t < 8.20000000000000039e-162Initial program 99.9%
Taylor expanded in t around 0 93.0%
Taylor expanded in y around 0 74.1%
associate-*r/74.1%
mul-1-neg74.1%
*-commutative74.1%
Simplified74.1%
div-inv74.1%
cancel-sign-sub74.1%
div-inv74.1%
+-commutative74.1%
associate-/r*74.1%
Applied egg-rr74.1%
Final simplification80.8%
(FPCore (x y z t) :precision binary64 (if (<= y -3.2e-93) 1.0 (if (<= y 1.6e-133) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.2e-93) {
tmp = 1.0;
} else if (y <= 1.6e-133) {
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 <= (-3.2d-93)) then
tmp = 1.0d0
else if (y <= 1.6d-133) 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 <= -3.2e-93) {
tmp = 1.0;
} else if (y <= 1.6e-133) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.2e-93: tmp = 1.0 elif y <= 1.6e-133: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.2e-93) tmp = 1.0; elseif (y <= 1.6e-133) 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 <= -3.2e-93) tmp = 1.0; elseif (y <= 1.6e-133) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.2e-93], 1.0, If[LessEqual[y, 1.6e-133], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{-93}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-133}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.1999999999999999e-93 or 1.60000000000000006e-133 < y Initial program 99.9%
Taylor expanded in t around inf 68.6%
associate-*r/68.6%
neg-mul-168.6%
Simplified68.6%
Taylor expanded in y around inf 62.8%
associate-*r/62.8%
mul-1-neg62.8%
Simplified62.8%
add-sqr-sqrt30.7%
sqrt-unprod56.2%
sqr-neg56.2%
sqrt-unprod31.0%
add-sqr-sqrt60.8%
*-un-lft-identity60.8%
*-commutative60.8%
associate-/r*60.9%
Applied egg-rr60.9%
*-lft-identity60.9%
associate-/l/60.8%
Simplified60.8%
Taylor expanded in x around 0 84.4%
if -3.1999999999999999e-93 < y < 1.60000000000000006e-133Initial program 98.9%
Taylor expanded in y around 0 76.3%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (<= y -3.1e-89) 1.0 (if (<= y 9.8e-34) (- 1.0 (/ x (* z t))) (- 1.0 (/ (/ x y) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e-89) {
tmp = 1.0;
} else if (y <= 9.8e-34) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 - ((x / 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 (y <= (-3.1d-89)) then
tmp = 1.0d0
else if (y <= 9.8d-34) then
tmp = 1.0d0 - (x / (z * t))
else
tmp = 1.0d0 - ((x / y) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e-89) {
tmp = 1.0;
} else if (y <= 9.8e-34) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0 - ((x / y) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.1e-89: tmp = 1.0 elif y <= 9.8e-34: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 - ((x / y) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.1e-89) tmp = 1.0; elseif (y <= 9.8e-34) tmp = Float64(1.0 - Float64(x / Float64(z * t))); else tmp = Float64(1.0 - Float64(Float64(x / y) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.1e-89) tmp = 1.0; elseif (y <= 9.8e-34) tmp = 1.0 - (x / (z * t)); else tmp = 1.0 - ((x / y) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.1e-89], 1.0, If[LessEqual[y, 9.8e-34], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-89}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-34}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -3.09999999999999996e-89Initial program 99.9%
Taylor expanded in t around inf 70.1%
associate-*r/70.1%
neg-mul-170.1%
Simplified70.1%
Taylor expanded in y around inf 65.3%
associate-*r/65.3%
mul-1-neg65.3%
Simplified65.3%
add-sqr-sqrt26.9%
sqrt-unprod58.4%
sqr-neg58.4%
sqrt-unprod37.2%
add-sqr-sqrt64.4%
*-un-lft-identity64.4%
*-commutative64.4%
associate-/r*64.4%
Applied egg-rr64.4%
*-lft-identity64.4%
associate-/l/64.4%
Simplified64.4%
Taylor expanded in x around 0 87.6%
if -3.09999999999999996e-89 < y < 9.79999999999999925e-34Initial program 99.1%
Taylor expanded in y around 0 71.7%
if 9.79999999999999925e-34 < y Initial program 100.0%
clear-num100.0%
associate-/r/100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 100.0%
*-lft-identity100.0%
times-frac99.9%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in y around inf 90.5%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.7%
Taylor expanded in t around inf 74.2%
associate-*r/74.2%
neg-mul-174.2%
Simplified74.2%
Taylor expanded in y around inf 56.6%
associate-*r/56.6%
mul-1-neg56.6%
Simplified56.6%
add-sqr-sqrt28.2%
sqrt-unprod53.1%
sqr-neg53.1%
sqrt-unprod27.6%
add-sqr-sqrt52.3%
*-un-lft-identity52.3%
*-commutative52.3%
associate-/r*52.3%
Applied egg-rr52.3%
*-lft-identity52.3%
associate-/l/52.3%
Simplified52.3%
Taylor expanded in x around 0 77.1%
Final simplification77.1%
herbie shell --seed 2024130
(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)))))