
(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 t) (- z y)))))
double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - t) * (z - 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 - t) * (z - y)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 + (x / ((y - t) * (z - y)));
}
def code(x, y, z, t): return 1.0 + (x / ((y - t) * (z - y)))
function code(x, y, z, t) return Float64(1.0 + Float64(x / Float64(Float64(y - t) * Float64(z - y)))) end
function tmp = code(x, y, z, t) tmp = 1.0 + (x / ((y - t) * (z - y))); end
code[x_, y_, z_, t_] := N[(1.0 + N[(x / N[(N[(y - t), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{x}{\left(y - t\right) \cdot \left(z - y\right)}
\end{array}
Initial program 99.0%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.62e+18) (not (<= y 1600000.0))) (+ 1.0 (/ (/ x y) (- t y))) (+ 1.0 (/ (/ x t) (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.62e+18) || !(y <= 1600000.0)) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 + ((x / t) / (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 ((y <= (-1.62d+18)) .or. (.not. (y <= 1600000.0d0))) then
tmp = 1.0d0 + ((x / y) / (t - y))
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.62e+18) || !(y <= 1600000.0)) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.62e+18) or not (y <= 1600000.0): tmp = 1.0 + ((x / y) / (t - y)) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.62e+18) || !(y <= 1600000.0)) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - y))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.62e+18) || ~((y <= 1600000.0))) tmp = 1.0 + ((x / y) / (t - y)); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.62e+18], N[Not[LessEqual[y, 1600000.0]], $MachinePrecision]], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.62 \cdot 10^{+18} \lor \neg \left(y \leq 1600000\right):\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if y < -1.62e18 or 1.6e6 < y Initial program 100.0%
Taylor expanded in z around 0 96.9%
sub-neg96.9%
associate-/r*96.9%
distribute-neg-frac296.9%
neg-sub096.9%
sub-neg96.9%
+-commutative96.9%
associate--r+96.9%
neg-sub096.9%
remove-double-neg96.9%
Simplified96.9%
if -1.62e18 < y < 1.6e6Initial program 98.1%
Taylor expanded in t around inf 84.9%
associate-/r*84.1%
Simplified84.1%
Final simplification90.4%
(FPCore (x y z t) :precision binary64 (if (<= z -1.35e-47) (+ 1.0 (/ (/ x z) (- y t))) (if (<= z 3e-95) (+ 1.0 (/ x (* y (- t y)))) (+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e-47) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 3e-95) {
tmp = 1.0 + (x / (y * (t - y)));
} else {
tmp = 1.0 + ((x / t) / (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 (z <= (-1.35d-47)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (z <= 3d-95) then
tmp = 1.0d0 + (x / (y * (t - y)))
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e-47) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 3e-95) {
tmp = 1.0 + (x / (y * (t - y)));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.35e-47: tmp = 1.0 + ((x / z) / (y - t)) elif z <= 3e-95: tmp = 1.0 + (x / (y * (t - y))) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.35e-47) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (z <= 3e-95) tmp = Float64(1.0 + Float64(x / Float64(y * Float64(t - y)))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.35e-47) tmp = 1.0 + ((x / z) / (y - t)); elseif (z <= 3e-95) tmp = 1.0 + (x / (y * (t - y))); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.35e-47], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e-95], N[(1.0 + N[(x / N[(y * N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-47}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-95}:\\
\;\;\;\;1 + \frac{x}{y \cdot \left(t - y\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if z < -1.3499999999999999e-47Initial program 99.9%
Taylor expanded in z around inf 97.7%
associate-/r*97.7%
Simplified97.7%
if -1.3499999999999999e-47 < z < 3e-95Initial program 97.6%
*-un-lft-identity97.6%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 91.9%
if 3e-95 < z Initial program 99.9%
Taylor expanded in t around inf 80.9%
associate-/r*79.5%
Simplified79.5%
Final simplification90.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.2e-47)
(+ 1.0 (/ (/ x z) (- y t)))
(if (<= z 2.8e-93)
(+ 1.0 (/ (/ x y) (- t y)))
(+ 1.0 (/ (/ x t) (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.2e-47) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 2.8e-93) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 + ((x / t) / (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 (z <= (-1.2d-47)) then
tmp = 1.0d0 + ((x / z) / (y - t))
else if (z <= 2.8d-93) then
tmp = 1.0d0 + ((x / y) / (t - y))
else
tmp = 1.0d0 + ((x / t) / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.2e-47) {
tmp = 1.0 + ((x / z) / (y - t));
} else if (z <= 2.8e-93) {
tmp = 1.0 + ((x / y) / (t - y));
} else {
tmp = 1.0 + ((x / t) / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.2e-47: tmp = 1.0 + ((x / z) / (y - t)) elif z <= 2.8e-93: tmp = 1.0 + ((x / y) / (t - y)) else: tmp = 1.0 + ((x / t) / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.2e-47) tmp = Float64(1.0 + Float64(Float64(x / z) / Float64(y - t))); elseif (z <= 2.8e-93) tmp = Float64(1.0 + Float64(Float64(x / y) / Float64(t - y))); else tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.2e-47) tmp = 1.0 + ((x / z) / (y - t)); elseif (z <= 2.8e-93) tmp = 1.0 + ((x / y) / (t - y)); else tmp = 1.0 + ((x / t) / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.2e-47], N[(1.0 + N[(N[(x / z), $MachinePrecision] / N[(y - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e-93], N[(1.0 + N[(N[(x / y), $MachinePrecision] / N[(t - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-47}:\\
\;\;\;\;1 + \frac{\frac{x}{z}}{y - t}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-93}:\\
\;\;\;\;1 + \frac{\frac{x}{y}}{t - y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\end{array}
\end{array}
if z < -1.2e-47Initial program 99.9%
Taylor expanded in z around inf 97.7%
associate-/r*97.7%
Simplified97.7%
if -1.2e-47 < z < 2.79999999999999998e-93Initial program 97.6%
Taylor expanded in z around 0 91.9%
sub-neg91.9%
associate-/r*90.6%
distribute-neg-frac290.6%
neg-sub090.6%
sub-neg90.6%
+-commutative90.6%
associate--r+90.6%
neg-sub090.6%
remove-double-neg90.6%
Simplified90.6%
if 2.79999999999999998e-93 < z Initial program 99.9%
Taylor expanded in t around inf 80.9%
associate-/r*79.5%
Simplified79.5%
(FPCore (x y z t) :precision binary64 (if (<= y -2.75e-52) 1.0 (if (<= y 1.25e-42) (+ 1.0 (/ (/ x t) (- y z))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.75e-52) {
tmp = 1.0;
} else if (y <= 1.25e-42) {
tmp = 1.0 + ((x / t) / (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 (y <= (-2.75d-52)) then
tmp = 1.0d0
else if (y <= 1.25d-42) then
tmp = 1.0d0 + ((x / t) / (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 (y <= -2.75e-52) {
tmp = 1.0;
} else if (y <= 1.25e-42) {
tmp = 1.0 + ((x / t) / (y - z));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.75e-52: tmp = 1.0 elif y <= 1.25e-42: tmp = 1.0 + ((x / t) / (y - z)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.75e-52) tmp = 1.0; elseif (y <= 1.25e-42) tmp = Float64(1.0 + Float64(Float64(x / t) / Float64(y - z))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.75e-52) tmp = 1.0; elseif (y <= 1.25e-42) tmp = 1.0 + ((x / t) / (y - z)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.75e-52], 1.0, If[LessEqual[y, 1.25e-42], N[(1.0 + N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.75 \cdot 10^{-52}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-42}:\\
\;\;\;\;1 + \frac{\frac{x}{t}}{y - z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.75e-52 or 1.25000000000000001e-42 < y Initial program 100.0%
Taylor expanded in x around 0 90.2%
if -2.75e-52 < y < 1.25000000000000001e-42Initial program 97.8%
Taylor expanded in t around inf 85.8%
associate-/r*85.0%
Simplified85.0%
(FPCore (x y z t) :precision binary64 (if (<= y -2.3e-135) 1.0 (if (<= y 7e-58) (- 1.0 (/ (/ x z) t)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.3e-135) {
tmp = 1.0;
} else if (y <= 7e-58) {
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 <= (-2.3d-135)) then
tmp = 1.0d0
else if (y <= 7d-58) 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 <= -2.3e-135) {
tmp = 1.0;
} else if (y <= 7e-58) {
tmp = 1.0 - ((x / z) / t);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.3e-135: tmp = 1.0 elif y <= 7e-58: tmp = 1.0 - ((x / z) / t) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.3e-135) tmp = 1.0; elseif (y <= 7e-58) tmp = Float64(1.0 - Float64(Float64(x / z) / t)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.3e-135) tmp = 1.0; elseif (y <= 7e-58) tmp = 1.0 - ((x / z) / t); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.3e-135], 1.0, If[LessEqual[y, 7e-58], N[(1.0 - N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-135}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-58}:\\
\;\;\;\;1 - \frac{\frac{x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.2999999999999999e-135 or 6.9999999999999998e-58 < y Initial program 100.0%
Taylor expanded in x around 0 86.2%
if -2.2999999999999999e-135 < y < 6.9999999999999998e-58Initial program 97.3%
Taylor expanded in z around inf 88.5%
associate-/r*90.6%
Simplified90.6%
Taylor expanded in y around 0 84.2%
neg-mul-184.2%
Simplified84.2%
Final simplification85.5%
(FPCore (x y z t) :precision binary64 (if (<= y -2.9e-134) 1.0 (if (<= y 5.2e-58) (- 1.0 (/ (/ x t) z)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.9e-134) {
tmp = 1.0;
} else if (y <= 5.2e-58) {
tmp = 1.0 - ((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 <= (-2.9d-134)) then
tmp = 1.0d0
else if (y <= 5.2d-58) then
tmp = 1.0d0 - ((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 <= -2.9e-134) {
tmp = 1.0;
} else if (y <= 5.2e-58) {
tmp = 1.0 - ((x / t) / z);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.9e-134: tmp = 1.0 elif y <= 5.2e-58: tmp = 1.0 - ((x / t) / z) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.9e-134) tmp = 1.0; elseif (y <= 5.2e-58) tmp = Float64(1.0 - Float64(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 <= -2.9e-134) tmp = 1.0; elseif (y <= 5.2e-58) tmp = 1.0 - ((x / t) / z); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.9e-134], 1.0, If[LessEqual[y, 5.2e-58], N[(1.0 - N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{-134}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-58}:\\
\;\;\;\;1 - \frac{\frac{x}{t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.89999999999999993e-134 or 5.20000000000000013e-58 < y Initial program 100.0%
Taylor expanded in x around 0 86.2%
if -2.89999999999999993e-134 < y < 5.20000000000000013e-58Initial program 97.3%
*-un-lft-identity97.3%
times-frac95.6%
Applied egg-rr95.6%
Taylor expanded in y around 0 82.1%
associate-/r*81.1%
Simplified81.1%
(FPCore (x y z t) :precision binary64 (if (<= y -2.3e-136) 1.0 (if (<= y 6.5e-60) (- 1.0 (/ x (* z t))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.3e-136) {
tmp = 1.0;
} else if (y <= 6.5e-60) {
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 <= (-2.3d-136)) then
tmp = 1.0d0
else if (y <= 6.5d-60) 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 <= -2.3e-136) {
tmp = 1.0;
} else if (y <= 6.5e-60) {
tmp = 1.0 - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.3e-136: tmp = 1.0 elif y <= 6.5e-60: tmp = 1.0 - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.3e-136) tmp = 1.0; elseif (y <= 6.5e-60) 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 <= -2.3e-136) tmp = 1.0; elseif (y <= 6.5e-60) tmp = 1.0 - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.3e-136], 1.0, If[LessEqual[y, 6.5e-60], N[(1.0 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-136}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-60}:\\
\;\;\;\;1 - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -2.29999999999999998e-136 or 6.49999999999999995e-60 < y Initial program 100.0%
Taylor expanded in x around 0 86.2%
if -2.29999999999999998e-136 < y < 6.49999999999999995e-60Initial program 97.3%
Taylor expanded in y around 0 82.1%
Final simplification84.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.0%
Taylor expanded in x around 0 76.8%
herbie shell --seed 2024180
(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)))))