
(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) (- 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.2%
Final simplification99.2%
(FPCore (x y z t)
:precision binary64
(if (<= t -6.8e-221)
(- 1.0 (/ (/ x z) (- t y)))
(if (<= t 9.2e-69)
(+ 1.0 (* x (/ (/ 1.0 y) (- z y))))
(- 1.0 (/ (/ x t) (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -6.8e-221) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (t <= 9.2e-69) {
tmp = 1.0 + (x * ((1.0 / y) / (z - y)));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-6.8d-221)) then
tmp = 1.0d0 - ((x / z) / (t - y))
else if (t <= 9.2d-69) then
tmp = 1.0d0 + (x * ((1.0d0 / y) / (z - y)))
else
tmp = 1.0d0 - ((x / t) / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -6.8e-221) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (t <= 9.2e-69) {
tmp = 1.0 + (x * ((1.0 / y) / (z - y)));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -6.8e-221: tmp = 1.0 - ((x / z) / (t - y)) elif t <= 9.2e-69: tmp = 1.0 + (x * ((1.0 / y) / (z - y))) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -6.8e-221) tmp = Float64(1.0 - Float64(Float64(x / z) / Float64(t - y))); elseif (t <= 9.2e-69) tmp = Float64(1.0 + Float64(x * Float64(Float64(1.0 / y) / Float64(z - y)))); else tmp = Float64(1.0 - Float64(Float64(x / t) / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -6.8e-221) tmp = 1.0 - ((x / z) / (t - y)); elseif (t <= 9.2e-69) tmp = 1.0 + (x * ((1.0 / y) / (z - y))); else tmp = 1.0 - ((x / t) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -6.8e-221], N[(1.0 - N[(N[(x / z), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.2e-69], N[(1.0 + N[(x * N[(N[(1.0 / y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{-221}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t - y}\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{-69}:\\
\;\;\;\;1 + x \cdot \frac{\frac{1}{y}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if t < -6.8000000000000003e-221Initial program 100.0%
Taylor expanded in z around inf 79.5%
+-commutative79.5%
associate-/r*79.3%
Simplified79.3%
if -6.8000000000000003e-221 < t < 9.2000000000000003e-69Initial program 97.1%
clear-num97.0%
associate-/r/97.1%
*-commutative97.1%
associate-/r*97.0%
Applied egg-rr97.0%
Taylor expanded in y around inf 89.4%
if 9.2000000000000003e-69 < t Initial program 100.0%
Taylor expanded in t around inf 97.3%
+-commutative97.3%
associate-/r*97.2%
Simplified97.2%
Final simplification88.0%
(FPCore (x y z t)
:precision binary64
(if (<= t -8e-266)
(- 1.0 (/ (/ x z) (- t y)))
(if (<= t 1.4e-67)
(+ 1.0 (/ (/ x y) (- z y)))
(- 1.0 (/ (/ x t) (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8e-266) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (t <= 1.4e-67) {
tmp = 1.0 + ((x / y) / (z - y));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-8d-266)) then
tmp = 1.0d0 - ((x / z) / (t - y))
else if (t <= 1.4d-67) then
tmp = 1.0d0 + ((x / y) / (z - y))
else
tmp = 1.0d0 - ((x / t) / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8e-266) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (t <= 1.4e-67) {
tmp = 1.0 + ((x / y) / (z - y));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -8e-266: tmp = 1.0 - ((x / z) / (t - y)) elif t <= 1.4e-67: tmp = 1.0 + ((x / y) / (z - y)) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -8e-266) tmp = Float64(1.0 - Float64(Float64(x / z) / Float64(t - y))); elseif (t <= 1.4e-67) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - y))); else tmp = Float64(1.0 - Float64(Float64(x / t) / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -8e-266) tmp = 1.0 - ((x / z) / (t - y)); elseif (t <= 1.4e-67) tmp = 1.0 + ((x / y) / (z - y)); else tmp = 1.0 - ((x / t) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -8e-266], N[(1.0 - N[(N[(x / z), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e-67], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{-266}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t - y}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-67}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if t < -7.9999999999999999e-266Initial program 100.0%
Taylor expanded in z around inf 79.7%
+-commutative79.7%
associate-/r*79.6%
Simplified79.6%
if -7.9999999999999999e-266 < t < 1.40000000000000005e-67Initial program 96.8%
Taylor expanded in t around 0 88.4%
associate-/r*88.4%
Simplified88.4%
if 1.40000000000000005e-67 < t Initial program 100.0%
Taylor expanded in t around inf 97.3%
+-commutative97.3%
associate-/r*97.2%
Simplified97.2%
Final simplification87.6%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.15e-119)
(- 1.0 (/ (/ x z) (- t y)))
(if (<= z -2.3e-273)
(+ 1.0 (/ x (* y (- t y))))
(- 1.0 (/ (/ x t) (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.15e-119) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (z <= -2.3e-273) {
tmp = 1.0 + (x / (y * (t - y)));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.15d-119)) then
tmp = 1.0d0 - ((x / z) / (t - y))
else if (z <= (-2.3d-273)) then
tmp = 1.0d0 + (x / (y * (t - y)))
else
tmp = 1.0d0 - ((x / t) / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.15e-119) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (z <= -2.3e-273) {
tmp = 1.0 + (x / (y * (t - y)));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.15e-119: tmp = 1.0 - ((x / z) / (t - y)) elif z <= -2.3e-273: tmp = 1.0 + (x / (y * (t - y))) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.15e-119) tmp = Float64(1.0 - Float64(Float64(x / z) / Float64(t - y))); elseif (z <= -2.3e-273) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); else tmp = Float64(1.0 - Float64(Float64(x / t) / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.15e-119) tmp = 1.0 - ((x / z) / (t - y)); elseif (z <= -2.3e-273) tmp = 1.0 + (x / (y * (t - y))); else tmp = 1.0 - ((x / t) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.15e-119], N[(1.0 - N[(N[(x / z), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.3e-273], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-119}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t - y}\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-273}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if z < -1.14999999999999997e-119Initial program 99.9%
Taylor expanded in z around inf 97.4%
+-commutative97.4%
associate-/r*96.1%
Simplified96.1%
if -1.14999999999999997e-119 < z < -2.29999999999999981e-273Initial program 99.9%
Taylor expanded in z around 0 96.5%
if -2.29999999999999981e-273 < z Initial program 98.7%
Taylor expanded in t around inf 77.1%
+-commutative77.1%
associate-/r*77.0%
Simplified77.0%
Final simplification85.2%
(FPCore (x y z t) :precision binary64 (if (<= z -1.3e-117) (- 1.0 (/ (/ x z) (- t y))) (if (<= z -7.5e-269) (- 1.0 (/ x (* y y))) (- 1.0 (/ (/ x t) (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.3e-117) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (z <= -7.5e-269) {
tmp = 1.0 - (x / (y * y));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1.3d-117)) then
tmp = 1.0d0 - ((x / z) / (t - y))
else if (z <= (-7.5d-269)) then
tmp = 1.0d0 - (x / (y * y))
else
tmp = 1.0d0 - ((x / t) / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.3e-117) {
tmp = 1.0 - ((x / z) / (t - y));
} else if (z <= -7.5e-269) {
tmp = 1.0 - (x / (y * y));
} else {
tmp = 1.0 - ((x / t) / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.3e-117: tmp = 1.0 - ((x / z) / (t - y)) elif z <= -7.5e-269: tmp = 1.0 - (x / (y * y)) else: tmp = 1.0 - ((x / t) / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.3e-117) tmp = Float64(1.0 - Float64(Float64(x / z) / Float64(t - y))); elseif (z <= -7.5e-269) tmp = Float64(1.0 - Float64(x / Float64(y * y))); else tmp = Float64(1.0 - Float64(Float64(x / t) / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.3e-117) tmp = 1.0 - ((x / z) / (t - y)); elseif (z <= -7.5e-269) tmp = 1.0 - (x / (y * y)); else tmp = 1.0 - ((x / t) / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.3e-117], N[(1.0 - N[(N[(x / z), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.5e-269], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(x / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{-117}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t - y}\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-269}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\end{array}
\end{array}
if z < -1.29999999999999992e-117Initial program 99.9%
Taylor expanded in z around inf 97.4%
+-commutative97.4%
associate-/r*96.1%
Simplified96.1%
if -1.29999999999999992e-117 < z < -7.4999999999999993e-269Initial program 99.9%
Taylor expanded in z around 0 96.4%
Taylor expanded in y around inf 70.6%
if -7.4999999999999993e-269 < z Initial program 98.7%
Taylor expanded in t around inf 77.3%
+-commutative77.3%
associate-/r*77.1%
Simplified77.1%
Final simplification82.3%
(FPCore (x y z t) :precision binary64 (if (<= y -25500.0) 1.0 (if (<= y 30.5) (- 1.0 (/ (/ x t) (- z y))) (- 1.0 (/ x (* y y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -25500.0) {
tmp = 1.0;
} else if (y <= 30.5) {
tmp = 1.0 - ((x / t) / (z - y));
} 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 <= (-25500.0d0)) then
tmp = 1.0d0
else if (y <= 30.5d0) then
tmp = 1.0d0 - ((x / t) / (z - y))
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 <= -25500.0) {
tmp = 1.0;
} else if (y <= 30.5) {
tmp = 1.0 - ((x / t) / (z - y));
} else {
tmp = 1.0 - (x / (y * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -25500.0: tmp = 1.0 elif y <= 30.5: tmp = 1.0 - ((x / t) / (z - y)) else: tmp = 1.0 - (x / (y * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -25500.0) tmp = 1.0; elseif (y <= 30.5) tmp = Float64(1.0 - Float64(Float64(x / t) / Float64(z - y))); else tmp = Float64(1.0 - Float64(x / Float64(y * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -25500.0) tmp = 1.0; elseif (y <= 30.5) tmp = 1.0 - ((x / t) / (z - y)); else tmp = 1.0 - (x / (y * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -25500.0], 1.0, If[LessEqual[y, 30.5], N[(1.0 - N[(N[(x / t), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -25500:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 30.5:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -25500Initial program 100.0%
Taylor expanded in x around 0 94.4%
if -25500 < y < 30.5Initial program 98.5%
Taylor expanded in t around inf 84.8%
+-commutative84.8%
associate-/r*83.9%
Simplified83.9%
if 30.5 < y Initial program 100.0%
Taylor expanded in z around 0 96.2%
Taylor expanded in y around inf 94.6%
Final simplification89.3%
(FPCore (x y z t) :precision binary64 (if (<= y -5.2e-93) 1.0 (if (<= y 1.15e-177) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.2e-93) {
tmp = 1.0;
} else if (y <= 1.15e-177) {
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 <= (-5.2d-93)) then
tmp = 1.0d0
else if (y <= 1.15d-177) 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 <= -5.2e-93) {
tmp = 1.0;
} else if (y <= 1.15e-177) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.2e-93: tmp = 1.0 elif y <= 1.15e-177: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.2e-93) tmp = 1.0; elseif (y <= 1.15e-177) 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 <= -5.2e-93) tmp = 1.0; elseif (y <= 1.15e-177) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.2e-93], 1.0, If[LessEqual[y, 1.15e-177], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{-93}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-177}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -5.1999999999999997e-93 or 1.15000000000000011e-177 < y Initial program 100.0%
Taylor expanded in x around 0 87.2%
if -5.1999999999999997e-93 < y < 1.15000000000000011e-177Initial program 97.2%
Taylor expanded in y around 0 87.5%
Final simplification87.2%
(FPCore (x y z t) :precision binary64 (if (<= z -5.2e-185) 1.0 (if (<= z 1.16e-82) (+ 1.0 (/ x (* y t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e-185) {
tmp = 1.0;
} else if (z <= 1.16e-82) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-5.2d-185)) then
tmp = 1.0d0
else if (z <= 1.16d-82) then
tmp = 1.0d0 + (x / (y * t))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e-185) {
tmp = 1.0;
} else if (z <= 1.16e-82) {
tmp = 1.0 + (x / (y * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.2e-185: tmp = 1.0 elif z <= 1.16e-82: tmp = 1.0 + (x / (y * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.2e-185) tmp = 1.0; elseif (z <= 1.16e-82) tmp = Float64(1.0 + Float64(x / Float64(y * t))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.2e-185) tmp = 1.0; elseif (z <= 1.16e-82) tmp = 1.0 + (x / (y * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.2e-185], 1.0, If[LessEqual[z, 1.16e-82], N[(1.0 + N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-185}:\\
\;\;\;\;1\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-82}:\\
\;\;\;\;1 + \frac{x}{y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -5.1999999999999997e-185 or 1.16e-82 < z Initial program 99.9%
Taylor expanded in x around 0 81.1%
if -5.1999999999999997e-185 < z < 1.16e-82Initial program 97.5%
Taylor expanded in t around inf 79.0%
+-commutative79.0%
associate-/r*80.1%
Simplified80.1%
Taylor expanded in y around inf 74.7%
Final simplification79.3%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.2%
Taylor expanded in x around 0 77.7%
herbie shell --seed 2024135
(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)))))