
(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 98.9%
Final simplification98.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -6.3e-37)
(/ (+ z (/ x (- y t))) z)
(if (<= z -7.2e-115)
(+ 1.0 (/ (/ x y) (- z y)))
(if (<= z -6.5e-143)
(/ (- z (/ x t)) z)
(if (<= z 6.5e-186) (+ 1.0 (/ x (* y (- t y)))) 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.3e-37) {
tmp = (z + (x / (y - t))) / z;
} else if (z <= -7.2e-115) {
tmp = 1.0 + ((x / y) / (z - y));
} else if (z <= -6.5e-143) {
tmp = (z - (x / t)) / z;
} else if (z <= 6.5e-186) {
tmp = 1.0 + (x / (y * (t - 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 (z <= (-6.3d-37)) then
tmp = (z + (x / (y - t))) / z
else if (z <= (-7.2d-115)) then
tmp = 1.0d0 + ((x / y) / (z - y))
else if (z <= (-6.5d-143)) then
tmp = (z - (x / t)) / z
else if (z <= 6.5d-186) then
tmp = 1.0d0 + (x / (y * (t - 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 (z <= -6.3e-37) {
tmp = (z + (x / (y - t))) / z;
} else if (z <= -7.2e-115) {
tmp = 1.0 + ((x / y) / (z - y));
} else if (z <= -6.5e-143) {
tmp = (z - (x / t)) / z;
} else if (z <= 6.5e-186) {
tmp = 1.0 + (x / (y * (t - y)));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.3e-37: tmp = (z + (x / (y - t))) / z elif z <= -7.2e-115: tmp = 1.0 + ((x / y) / (z - y)) elif z <= -6.5e-143: tmp = (z - (x / t)) / z elif z <= 6.5e-186: tmp = 1.0 + (x / (y * (t - y))) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.3e-37) tmp = Float64(Float64(z + Float64(x / Float64(y - t))) / z); elseif (z <= -7.2e-115) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - y))); elseif (z <= -6.5e-143) tmp = Float64(Float64(z - Float64(x / t)) / z); elseif (z <= 6.5e-186) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6.3e-37) tmp = (z + (x / (y - t))) / z; elseif (z <= -7.2e-115) tmp = 1.0 + ((x / y) / (z - y)); elseif (z <= -6.5e-143) tmp = (z - (x / t)) / z; elseif (z <= 6.5e-186) tmp = 1.0 + (x / (y * (t - y))); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.3e-37], N[(N[(z + N[(x / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -7.2e-115], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.5e-143], N[(N[(z - N[(x / t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 6.5e-186], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.3 \cdot 10^{-37}:\\
\;\;\;\;\frac{z + \frac{x}{y - t}}{z}\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-115}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-143}:\\
\;\;\;\;\frac{z - \frac{x}{t}}{z}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-186}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -6.30000000000000023e-37Initial program 99.9%
Taylor expanded in z around inf 98.7%
mul-1-neg98.7%
associate-/r*98.7%
distribute-neg-frac98.7%
Simplified98.7%
Taylor expanded in z around 0 97.4%
sub-neg97.4%
mul-1-neg97.4%
remove-double-neg97.4%
Simplified97.4%
if -6.30000000000000023e-37 < z < -7.20000000000000018e-115Initial program 100.0%
Taylor expanded in t around 0 84.9%
associate-/r*84.9%
Simplified84.9%
if -7.20000000000000018e-115 < z < -6.4999999999999999e-143Initial program 77.9%
Taylor expanded in y around 0 62.1%
Taylor expanded in z around 0 84.2%
if -6.4999999999999999e-143 < z < 6.49999999999999962e-186Initial program 97.7%
Taylor expanded in z around 0 90.7%
if 6.49999999999999962e-186 < z Initial program 99.9%
Taylor expanded in y around 0 60.1%
Taylor expanded in x around 0 77.4%
Final simplification86.5%
(FPCore (x y z t)
:precision binary64
(if (<= z -1e-37)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= z -3e-115)
(+ 1.0 (/ (/ x y) (- z y)))
(if (<= z -6.5e-143)
(/ (- z (/ x t)) z)
(if (<= z 1.5e-187)
(+ 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 <= -1e-37) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= -3e-115) {
tmp = 1.0 + ((x / y) / (z - y));
} else if (z <= -6.5e-143) {
tmp = (z - (x / t)) / z;
} else if (z <= 1.5e-187) {
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 <= (-1d-37)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (z <= (-3d-115)) then
tmp = 1.0d0 + ((x / y) / (z - y))
else if (z <= (-6.5d-143)) then
tmp = (z - (x / t)) / z
else if (z <= 1.5d-187) 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 <= -1e-37) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= -3e-115) {
tmp = 1.0 + ((x / y) / (z - y));
} else if (z <= -6.5e-143) {
tmp = (z - (x / t)) / z;
} else if (z <= 1.5e-187) {
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 <= -1e-37: tmp = 1.0 + ((x / z) / (y - t)) elif z <= -3e-115: tmp = 1.0 + ((x / y) / (z - y)) elif z <= -6.5e-143: tmp = (z - (x / t)) / z elif z <= 1.5e-187: 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 <= -1e-37) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (z <= -3e-115) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - y))); elseif (z <= -6.5e-143) tmp = Float64(Float64(z - Float64(x / t)) / z); elseif (z <= 1.5e-187) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); else tmp = Float64(1.0 - Float64(x / Float64(t * Float64(z - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1e-37) tmp = 1.0 + ((x / z) / (y - t)); elseif (z <= -3e-115) tmp = 1.0 + ((x / y) / (z - y)); elseif (z <= -6.5e-143) tmp = (z - (x / t)) / z; elseif (z <= 1.5e-187) 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, -1e-37], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3e-115], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.5e-143], N[(N[(z - N[(x / t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.5e-187], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-37}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-115}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-143}:\\
\;\;\;\;\frac{z - \frac{x}{t}}{z}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-187}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{t \cdot \left(z - y\right)}\\
\end{array}
\end{array}
if z < -1.00000000000000007e-37Initial program 99.9%
Taylor expanded in z around inf 98.7%
mul-1-neg98.7%
associate-/r*98.7%
distribute-neg-frac98.7%
Simplified98.7%
if -1.00000000000000007e-37 < z < -3.0000000000000002e-115Initial program 100.0%
Taylor expanded in t around 0 84.9%
associate-/r*84.9%
Simplified84.9%
if -3.0000000000000002e-115 < z < -6.4999999999999999e-143Initial program 77.9%
Taylor expanded in y around 0 62.1%
Taylor expanded in z around 0 84.2%
if -6.4999999999999999e-143 < z < 1.50000000000000002e-187Initial program 97.6%
Taylor expanded in z around 0 90.3%
if 1.50000000000000002e-187 < z Initial program 99.9%
Taylor expanded in t around inf 71.9%
associate-*r/71.9%
neg-mul-171.9%
Simplified71.9%
Final simplification84.3%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.75e-38)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= z -2.7e-115)
(+ 1.0 (/ (/ x y) (- z y)))
(if (<= z -3.5e-143)
(+ 1.0 (/ (/ x t) (- y z)))
(if (<= z 2.35e-187)
(+ 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.75e-38) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= -2.7e-115) {
tmp = 1.0 + ((x / y) / (z - y));
} else if (z <= -3.5e-143) {
tmp = 1.0 + ((x / t) / (y - z));
} else if (z <= 2.35e-187) {
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.75d-38)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (z <= (-2.7d-115)) then
tmp = 1.0d0 + ((x / y) / (z - y))
else if (z <= (-3.5d-143)) then
tmp = 1.0d0 + ((x / t) / (y - z))
else if (z <= 2.35d-187) 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.75e-38) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= -2.7e-115) {
tmp = 1.0 + ((x / y) / (z - y));
} else if (z <= -3.5e-143) {
tmp = 1.0 + ((x / t) / (y - z));
} else if (z <= 2.35e-187) {
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.75e-38: tmp = 1.0 + ((x / z) / (y - t)) elif z <= -2.7e-115: tmp = 1.0 + ((x / y) / (z - y)) elif z <= -3.5e-143: tmp = 1.0 + ((x / t) / (y - z)) elif z <= 2.35e-187: 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.75e-38) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (z <= -2.7e-115) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(z - y))); elseif (z <= -3.5e-143) tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); elseif (z <= 2.35e-187) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); else tmp = Float64(1.0 - Float64(x / Float64(t * Float64(z - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.75e-38) tmp = 1.0 + ((x / z) / (y - t)); elseif (z <= -2.7e-115) tmp = 1.0 + ((x / y) / (z - y)); elseif (z <= -3.5e-143) tmp = 1.0 + ((x / t) / (y - z)); elseif (z <= 2.35e-187) 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.75e-38], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.7e-115], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.5e-143], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.35e-187], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-38}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-115}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{z - y}\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-143}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-187}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{t \cdot \left(z - y\right)}\\
\end{array}
\end{array}
if z < -1.7500000000000001e-38Initial program 99.9%
Taylor expanded in z around inf 98.7%
mul-1-neg98.7%
associate-/r*98.7%
distribute-neg-frac98.7%
Simplified98.7%
if -1.7500000000000001e-38 < z < -2.7e-115Initial program 100.0%
Taylor expanded in t around 0 84.9%
associate-/r*84.9%
Simplified84.9%
if -2.7e-115 < z < -3.50000000000000005e-143Initial program 77.9%
clear-num77.7%
associate-/r/68.3%
Applied egg-rr68.3%
associate-*l/77.9%
*-un-lft-identity77.9%
associate-/r*98.7%
Applied egg-rr98.7%
Taylor expanded in t around inf 77.9%
mul-1-neg77.9%
associate-/r*100.0%
distribute-neg-frac100.0%
distribute-neg-frac2100.0%
Simplified100.0%
if -3.50000000000000005e-143 < z < 2.3500000000000001e-187Initial program 97.7%
Taylor expanded in z around 0 90.5%
if 2.3500000000000001e-187 < z Initial program 99.9%
Taylor expanded in t around inf 72.5%
associate-*r/72.5%
neg-mul-172.5%
Simplified72.5%
Final simplification85.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.3e-103) (not (<= y 1.35e-164))) (+ 1.0 (/ x (* y (- t y)))) (/ (- z (/ x t)) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.3e-103) || !(y <= 1.35e-164)) {
tmp = 1.0 + (x / (y * (t - y)));
} else {
tmp = (z - (x / t)) / z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2.3d-103)) .or. (.not. (y <= 1.35d-164))) then
tmp = 1.0d0 + (x / (y * (t - y)))
else
tmp = (z - (x / t)) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.3e-103) || !(y <= 1.35e-164)) {
tmp = 1.0 + (x / (y * (t - y)));
} else {
tmp = (z - (x / t)) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.3e-103) or not (y <= 1.35e-164): tmp = 1.0 + (x / (y * (t - y))) else: tmp = (z - (x / t)) / z return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.3e-103) || !(y <= 1.35e-164)) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); else tmp = Float64(Float64(z - Float64(x / t)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.3e-103) || ~((y <= 1.35e-164))) tmp = 1.0 + (x / (y * (t - y))); else tmp = (z - (x / t)) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.3e-103], N[Not[LessEqual[y, 1.35e-164]], $MachinePrecision]], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - N[(x / t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-103} \lor \neg \left(y \leq 1.35 \cdot 10^{-164}\right):\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{z - \frac{x}{t}}{z}\\
\end{array}
\end{array}
if y < -2.3000000000000001e-103 or 1.3500000000000001e-164 < y Initial program 100.0%
Taylor expanded in z around 0 84.1%
if -2.3000000000000001e-103 < y < 1.3500000000000001e-164Initial program 96.4%
Taylor expanded in y around 0 80.1%
Taylor expanded in z around 0 80.7%
Final simplification83.1%
(FPCore (x y z t) :precision binary64 (if (<= y -3.3e-154) 1.0 (if (<= y 2.1e-108) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.3e-154) {
tmp = 1.0;
} else if (y <= 2.1e-108) {
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.3d-154)) then
tmp = 1.0d0
else if (y <= 2.1d-108) 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.3e-154) {
tmp = 1.0;
} else if (y <= 2.1e-108) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.3e-154: tmp = 1.0 elif y <= 2.1e-108: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.3e-154) tmp = 1.0; elseif (y <= 2.1e-108) 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.3e-154) tmp = 1.0; elseif (y <= 2.1e-108) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.3e-154], 1.0, If[LessEqual[y, 2.1e-108], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-154}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-108}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.30000000000000027e-154 or 2.0999999999999999e-108 < y Initial program 100.0%
Taylor expanded in y around 0 44.8%
Taylor expanded in x around 0 84.5%
if -3.30000000000000027e-154 < y < 2.0999999999999999e-108Initial program 96.7%
Taylor expanded in y around 0 74.2%
Final simplification81.4%
(FPCore (x y z t) :precision binary64 (if (<= y -3.6e-156) 1.0 (if (<= y 1.65e-108) (/ (- z (/ x t)) z) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.6e-156) {
tmp = 1.0;
} else if (y <= 1.65e-108) {
tmp = (z - (x / t)) / z;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.6d-156)) then
tmp = 1.0d0
else if (y <= 1.65d-108) then
tmp = (z - (x / t)) / z
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.6e-156) {
tmp = 1.0;
} else if (y <= 1.65e-108) {
tmp = (z - (x / t)) / z;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.6e-156: tmp = 1.0 elif y <= 1.65e-108: tmp = (z - (x / t)) / z else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.6e-156) tmp = 1.0; elseif (y <= 1.65e-108) tmp = Float64(Float64(z - Float64(x / t)) / z); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.6e-156) tmp = 1.0; elseif (y <= 1.65e-108) tmp = (z - (x / t)) / z; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.6e-156], 1.0, If[LessEqual[y, 1.65e-108], N[(N[(z - N[(x / t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{-156}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-108}:\\
\;\;\;\;\frac{z - \frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -3.59999999999999999e-156 or 1.6500000000000001e-108 < y Initial program 100.0%
Taylor expanded in y around 0 44.8%
Taylor expanded in x around 0 84.5%
if -3.59999999999999999e-156 < y < 1.6500000000000001e-108Initial program 96.7%
Taylor expanded in y around 0 74.2%
Taylor expanded in z around 0 74.7%
Final simplification81.5%
(FPCore (x y z t) :precision binary64 (if (<= t 5.6e-74) (+ 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 <= 5.6e-74) {
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 <= 5.6d-74) 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 <= 5.6e-74) {
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 <= 5.6e-74: 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 <= 5.6e-74) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(z - y)))); else tmp = Float64(1.0 - Float64(x / Float64(t * Float64(z - y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 5.6e-74) 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, 5.6e-74], N[(1.0 + N[(x / N[(y * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(x / N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.6 \cdot 10^{-74}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(z - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{x}{t \cdot \left(z - y\right)}\\
\end{array}
\end{array}
if t < 5.59999999999999976e-74Initial program 98.6%
Taylor expanded in t around 0 80.5%
if 5.59999999999999976e-74 < t Initial program 99.9%
Taylor expanded in t around inf 98.5%
associate-*r/98.5%
neg-mul-198.5%
Simplified98.5%
Final simplification85.4%
(FPCore (x y z t) :precision binary64 (if (<= z -5.2e+71) (+ 1.0 (/ x (* y z))) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+71) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-5.2d+71)) then
tmp = 1.0d0 + (x / (y * z))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+71) {
tmp = 1.0 + (x / (y * z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.2e+71: tmp = 1.0 + (x / (y * z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.2e+71) tmp = Float64(1.0 + Float64(x / Float64(y * z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.2e+71) tmp = 1.0 + (x / (y * z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.2e+71], N[(1.0 + N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+71}:\\
\;\;\;\;1 + \frac{x}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -5.19999999999999983e71Initial program 99.9%
Taylor expanded in z around inf 99.9%
mul-1-neg99.9%
associate-/r*99.9%
distribute-neg-frac99.9%
Simplified99.9%
Taylor expanded in y around inf 88.4%
*-commutative88.4%
Simplified88.4%
if -5.19999999999999983e71 < z Initial program 98.7%
Taylor expanded in y around 0 50.2%
Taylor expanded in x around 0 68.7%
Final simplification72.6%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 98.9%
Taylor expanded in y around 0 53.9%
Taylor expanded in x around 0 71.8%
Final simplification71.8%
herbie shell --seed 2024059
(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)))))