
(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 9 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) (- 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.5%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6e-98) (not (<= y 3.5e-78))) (- 1.0 (/ x (* y (- y z)))) (+ 1.0 (* x (/ (/ -1.0 t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6e-98) || !(y <= 3.5e-78)) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 + (x * ((-1.0 / 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 <= (-6d-98)) .or. (.not. (y <= 3.5d-78))) then
tmp = 1.0d0 - (x / (y * (y - z)))
else
tmp = 1.0d0 + (x * (((-1.0d0) / t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6e-98) || !(y <= 3.5e-78)) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 + (x * ((-1.0 / t) / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6e-98) or not (y <= 3.5e-78): tmp = 1.0 - (x / (y * (y - z))) else: tmp = 1.0 + (x * ((-1.0 / t) / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6e-98) || !(y <= 3.5e-78)) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); else tmp = Float64(1.0 + Float64(x * Float64(Float64(-1.0 / t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -6e-98) || ~((y <= 3.5e-78))) tmp = 1.0 - (x / (y * (y - z))); else tmp = 1.0 + (x * ((-1.0 / t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6e-98], N[Not[LessEqual[y, 3.5e-78]], $MachinePrecision]], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(N[(-1.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{-98} \lor \neg \left(y \leq 3.5 \cdot 10^{-78}\right):\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \frac{\frac{-1}{t}}{z}\\
\end{array}
\end{array}
if y < -6e-98 or 3.4999999999999999e-78 < y Initial program 99.9%
Taylor expanded in t around 0 93.1%
if -6e-98 < y < 3.4999999999999999e-78Initial program 98.9%
clear-num98.9%
associate-/r/98.9%
*-commutative98.9%
associate-/r*98.8%
Applied egg-rr98.8%
Taylor expanded in y around 0 80.8%
associate-/r*80.8%
Simplified80.8%
Final simplification88.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.65e-126) (not (<= t 1.36e-76))) (+ 1.0 (/ x (* (- y z) t))) (- 1.0 (/ x (* y (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.65e-126) || !(t <= 1.36e-76)) {
tmp = 1.0 + (x / ((y - z) * t));
} else {
tmp = 1.0 - (x / (y * (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 ((t <= (-2.65d-126)) .or. (.not. (t <= 1.36d-76))) then
tmp = 1.0d0 + (x / ((y - z) * t))
else
tmp = 1.0d0 - (x / (y * (y - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.65e-126) || !(t <= 1.36e-76)) {
tmp = 1.0 + (x / ((y - z) * t));
} else {
tmp = 1.0 - (x / (y * (y - z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.65e-126) or not (t <= 1.36e-76): tmp = 1.0 + (x / ((y - z) * t)) else: tmp = 1.0 - (x / (y * (y - z))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.65e-126) || !(t <= 1.36e-76)) tmp = Float64(1.0 + Float64(x / Float64(Float64(y - z) * t))); else tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.65e-126) || ~((t <= 1.36e-76))) tmp = 1.0 + (x / ((y - z) * t)); else tmp = 1.0 - (x / (y * (y - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.65e-126], N[Not[LessEqual[t, 1.36e-76]], $MachinePrecision]], N[(1.0 + N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.65 \cdot 10^{-126} \lor \neg \left(t \leq 1.36 \cdot 10^{-76}\right):\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\end{array}
\end{array}
if t < -2.64999999999999997e-126 or 1.35999999999999993e-76 < t Initial program 99.9%
Taylor expanded in t around inf 95.7%
associate-*r/95.7%
neg-mul-195.7%
Simplified95.7%
if -2.64999999999999997e-126 < t < 1.35999999999999993e-76Initial program 98.7%
Taylor expanded in t around 0 86.1%
Final simplification92.6%
(FPCore (x y z t) :precision binary64 (if (<= y -4.1e-38) (- 1.0 (/ x (* y y))) (if (<= y 8.8e-103) (+ 1.0 (* x (/ (/ -1.0 t) z))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.1e-38) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 8.8e-103) {
tmp = 1.0 + (x * ((-1.0 / 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 <= (-4.1d-38)) then
tmp = 1.0d0 - (x / (y * y))
else if (y <= 8.8d-103) then
tmp = 1.0d0 + (x * (((-1.0d0) / 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 <= -4.1e-38) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 8.8e-103) {
tmp = 1.0 + (x * ((-1.0 / t) / z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.1e-38: tmp = 1.0 - (x / (y * y)) elif y <= 8.8e-103: tmp = 1.0 + (x * ((-1.0 / t) / z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.1e-38) tmp = Float64(1.0 - Float64(x / Float64(y * y))); elseif (y <= 8.8e-103) tmp = Float64(1.0 + Float64(x * Float64(Float64(-1.0 / t) / z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.1e-38) tmp = 1.0 - (x / (y * y)); elseif (y <= 8.8e-103) tmp = 1.0 + (x * ((-1.0 / t) / z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.1e-38], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.8e-103], N[(1.0 + N[(x * N[(N[(-1.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{-38}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{-103}:\\
\;\;\;\;1 + x \cdot \frac{\frac{-1}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -4.0999999999999998e-38Initial program 99.9%
Taylor expanded in y around inf 90.7%
unpow290.7%
Simplified90.7%
if -4.0999999999999998e-38 < y < 8.7999999999999997e-103Initial program 98.9%
clear-num98.9%
associate-/r/98.9%
*-commutative98.9%
associate-/r*98.9%
Applied egg-rr98.9%
Taylor expanded in y around 0 78.4%
associate-/r*78.4%
Simplified78.4%
if 8.7999999999999997e-103 < y Initial program 100.0%
Taylor expanded in y around inf 86.3%
unpow286.3%
associate-/r*86.3%
Simplified86.3%
Taylor expanded in x around 0 90.8%
Final simplification85.7%
(FPCore (x y z t) :precision binary64 (if (<= y -6.5e-39) (+ 1.0 (/ -1.0 (* y (/ y x)))) (if (<= y 4e-103) (+ 1.0 (* x (/ (/ -1.0 t) z))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.5e-39) {
tmp = 1.0 + (-1.0 / (y * (y / x)));
} else if (y <= 4e-103) {
tmp = 1.0 + (x * ((-1.0 / 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 <= (-6.5d-39)) then
tmp = 1.0d0 + ((-1.0d0) / (y * (y / x)))
else if (y <= 4d-103) then
tmp = 1.0d0 + (x * (((-1.0d0) / 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 <= -6.5e-39) {
tmp = 1.0 + (-1.0 / (y * (y / x)));
} else if (y <= 4e-103) {
tmp = 1.0 + (x * ((-1.0 / t) / z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.5e-39: tmp = 1.0 + (-1.0 / (y * (y / x))) elif y <= 4e-103: tmp = 1.0 + (x * ((-1.0 / t) / z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.5e-39) tmp = Float64(1.0 + Float64(-1.0 / Float64(y * Float64(y / x)))); elseif (y <= 4e-103) tmp = Float64(1.0 + Float64(x * Float64(Float64(-1.0 / t) / z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.5e-39) tmp = 1.0 + (-1.0 / (y * (y / x))); elseif (y <= 4e-103) tmp = 1.0 + (x * ((-1.0 / t) / z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.5e-39], N[(1.0 + N[(-1.0 / N[(y * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e-103], N[(1.0 + N[(x * N[(N[(-1.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{-39}:\\
\;\;\;\;1 + \frac{-1}{y \cdot \frac{y}{x}}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-103}:\\
\;\;\;\;1 + x \cdot \frac{\frac{-1}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -6.50000000000000027e-39Initial program 99.9%
Taylor expanded in y around inf 90.7%
unpow290.7%
associate-/r*90.7%
Simplified90.7%
clear-num90.6%
inv-pow90.6%
div-inv90.7%
clear-num90.7%
Applied egg-rr90.7%
unpow-190.7%
Simplified90.7%
if -6.50000000000000027e-39 < y < 3.99999999999999983e-103Initial program 98.9%
clear-num98.9%
associate-/r/98.9%
*-commutative98.9%
associate-/r*98.9%
Applied egg-rr98.9%
Taylor expanded in y around 0 78.4%
associate-/r*78.4%
Simplified78.4%
if 3.99999999999999983e-103 < y Initial program 100.0%
Taylor expanded in y around inf 86.3%
unpow286.3%
associate-/r*86.3%
Simplified86.3%
Taylor expanded in x around 0 90.8%
Final simplification85.7%
(FPCore (x y z t)
:precision binary64
(if (<= t -3.6e-188)
(+ 1.0 (/ x (* z (- y t))))
(if (<= t 1.08e-76)
(- 1.0 (/ x (* y (- y z))))
(+ 1.0 (/ x (* (- y z) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.6e-188) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 1.08e-76) {
tmp = 1.0 - (x / (y * (y - z)));
} 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.6d-188)) then
tmp = 1.0d0 + (x / (z * (y - t)))
else if (t <= 1.08d-76) then
tmp = 1.0d0 - (x / (y * (y - z)))
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.6e-188) {
tmp = 1.0 + (x / (z * (y - t)));
} else if (t <= 1.08e-76) {
tmp = 1.0 - (x / (y * (y - z)));
} else {
tmp = 1.0 + (x / ((y - z) * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.6e-188: tmp = 1.0 + (x / (z * (y - t))) elif t <= 1.08e-76: tmp = 1.0 - (x / (y * (y - z))) else: tmp = 1.0 + (x / ((y - z) * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.6e-188) tmp = Float64(1.0 + Float64(x / Float64(z * Float64(y - t)))); elseif (t <= 1.08e-76) tmp = Float64(1.0 - Float64(x / Float64(y * Float64(y - z)))); 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.6e-188) tmp = 1.0 + (x / (z * (y - t))); elseif (t <= 1.08e-76) tmp = 1.0 - (x / (y * (y - z))); else tmp = 1.0 + (x / ((y - z) * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.6e-188], N[(1.0 + N[(x / N[(z * N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.08e-76], N[(1.0 - N[(x / N[(y * N[(y - z), $MachinePrecision]), $MachinePrecision]), $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.6 \cdot 10^{-188}:\\
\;\;\;\;1 + \frac{x}{z \cdot \left(y - t\right)}\\
\mathbf{elif}\;t \leq 1.08 \cdot 10^{-76}:\\
\;\;\;\;1 - \frac{x}{y \cdot \left(y - z\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{\left(y - z\right) \cdot t}\\
\end{array}
\end{array}
if t < -3.5999999999999997e-188Initial program 99.9%
Taylor expanded in z around inf 81.5%
associate-*r/81.5%
neg-mul-181.5%
Simplified81.5%
if -3.5999999999999997e-188 < t < 1.08e-76Initial program 98.3%
Taylor expanded in t around 0 88.0%
if 1.08e-76 < t Initial program 99.9%
Taylor expanded in t around inf 95.2%
associate-*r/95.2%
neg-mul-195.2%
Simplified95.2%
Final simplification88.3%
(FPCore (x y z t) :precision binary64 (if (<= y -1.35e-60) 1.0 (if (<= y 8.5e-103) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.35e-60) {
tmp = 1.0;
} else if (y <= 8.5e-103) {
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.35d-60)) then
tmp = 1.0d0
else if (y <= 8.5d-103) 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.35e-60) {
tmp = 1.0;
} else if (y <= 8.5e-103) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.35e-60: tmp = 1.0 elif y <= 8.5e-103: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.35e-60) tmp = 1.0; elseif (y <= 8.5e-103) 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.35e-60) tmp = 1.0; elseif (y <= 8.5e-103) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.35e-60], 1.0, If[LessEqual[y, 8.5e-103], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{-60}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-103}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -1.35e-60 or 8.50000000000000032e-103 < y Initial program 99.9%
Taylor expanded in y around inf 87.2%
unpow287.2%
associate-/r*87.2%
Simplified87.2%
Taylor expanded in x around 0 87.8%
if -1.35e-60 < y < 8.50000000000000032e-103Initial program 98.9%
Taylor expanded in y around 0 79.2%
Final simplification84.4%
(FPCore (x y z t) :precision binary64 (if (<= y -3.1e-37) (- 1.0 (/ x (* y y))) (if (<= y 7.2e-103) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e-37) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 7.2e-103) {
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.1d-37)) then
tmp = 1.0d0 - (x / (y * y))
else if (y <= 7.2d-103) 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.1e-37) {
tmp = 1.0 - (x / (y * y));
} else if (y <= 7.2e-103) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.1e-37: tmp = 1.0 - (x / (y * y)) elif y <= 7.2e-103: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.1e-37) tmp = Float64(1.0 - Float64(x / Float64(y * y))); elseif (y <= 7.2e-103) 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.1e-37) tmp = 1.0 - (x / (y * y)); elseif (y <= 7.2e-103) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.1e-37], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e-103], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-37}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-103}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.09999999999999993e-37Initial program 99.9%
Taylor expanded in y around inf 90.7%
unpow290.7%
Simplified90.7%
if -3.09999999999999993e-37 < y < 7.1999999999999996e-103Initial program 98.9%
Taylor expanded in y around 0 78.5%
if 7.1999999999999996e-103 < y Initial program 100.0%
Taylor expanded in y around inf 86.3%
unpow286.3%
associate-/r*86.3%
Simplified86.3%
Taylor expanded in x around 0 90.8%
Final simplification85.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.5%
Taylor expanded in y around inf 57.5%
unpow257.5%
associate-/r*57.5%
Simplified57.5%
Taylor expanded in x around 0 76.4%
Final simplification76.4%
herbie shell --seed 2023230
(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)))))