
(FPCore (x y z) :precision binary64 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (y / ((1.1283791670955126d0 * exp(z)) - (x * y)))
end function
public static double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
}
def code(x, y, z): return x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
function code(x, y, z) return Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y)))) end
function tmp = code(x, y, z) tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y))); end
code[x_, y_, z_] := N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (y / ((1.1283791670955126d0 * exp(z)) - (x * y)))
end function
public static double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
}
def code(x, y, z): return x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
function code(x, y, z) return Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y)))) end
function tmp = code(x, y, z) tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y))); end
code[x_, y_, z_] := N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.1283791670955126 (* x y))))
(if (<= (exp z) 0.0)
(+ x (/ -1.0 x))
(if (<= (exp z) 1.00000000002)
(+ (+ x (/ y t_0)) (/ (* -1.1283791670955126 (* z y)) (* t_0 t_0)))
x))))
double code(double x, double y, double z) {
double t_0 = 1.1283791670955126 - (x * y);
double tmp;
if (exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else if (exp(z) <= 1.00000000002) {
tmp = (x + (y / t_0)) + ((-1.1283791670955126 * (z * y)) / (t_0 * t_0));
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 1.1283791670955126d0 - (x * y)
if (exp(z) <= 0.0d0) then
tmp = x + ((-1.0d0) / x)
else if (exp(z) <= 1.00000000002d0) then
tmp = (x + (y / t_0)) + (((-1.1283791670955126d0) * (z * y)) / (t_0 * t_0))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.1283791670955126 - (x * y);
double tmp;
if (Math.exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else if (Math.exp(z) <= 1.00000000002) {
tmp = (x + (y / t_0)) + ((-1.1283791670955126 * (z * y)) / (t_0 * t_0));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): t_0 = 1.1283791670955126 - (x * y) tmp = 0 if math.exp(z) <= 0.0: tmp = x + (-1.0 / x) elif math.exp(z) <= 1.00000000002: tmp = (x + (y / t_0)) + ((-1.1283791670955126 * (z * y)) / (t_0 * t_0)) else: tmp = x return tmp
function code(x, y, z) t_0 = Float64(1.1283791670955126 - Float64(x * y)) tmp = 0.0 if (exp(z) <= 0.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (exp(z) <= 1.00000000002) tmp = Float64(Float64(x + Float64(y / t_0)) + Float64(Float64(-1.1283791670955126 * Float64(z * y)) / Float64(t_0 * t_0))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.1283791670955126 - (x * y); tmp = 0.0; if (exp(z) <= 0.0) tmp = x + (-1.0 / x); elseif (exp(z) <= 1.00000000002) tmp = (x + (y / t_0)) + ((-1.1283791670955126 * (z * y)) / (t_0 * t_0)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.1283791670955126 - N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Exp[z], $MachinePrecision], 0.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Exp[z], $MachinePrecision], 1.00000000002], N[(N[(x + N[(y / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.1283791670955126 * N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1.1283791670955126 - x \cdot y\\
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;e^{z} \leq 1.00000000002:\\
\;\;\;\;\left(x + \frac{y}{t\_0}\right) + \frac{-1.1283791670955126 \cdot \left(z \cdot y\right)}{t\_0 \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 88.6%
Taylor expanded in y around inf
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
if 0.0 < (exp.f64 z) < 1.00000000002Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.8%
Simplified99.8%
if 1.00000000002 < (exp.f64 z) Initial program 94.9%
Taylor expanded in x around inf
Simplified100.0%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= (exp z) 0.0) (+ x (/ -1.0 x)) (+ x (/ 1.0 (/ (- (* (exp z) 1.1283791670955126) (* x y)) y)))))
double code(double x, double y, double z) {
double tmp;
if (exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else {
tmp = x + (1.0 / (((exp(z) * 1.1283791670955126) - (x * y)) / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (exp(z) <= 0.0d0) then
tmp = x + ((-1.0d0) / x)
else
tmp = x + (1.0d0 / (((exp(z) * 1.1283791670955126d0) - (x * y)) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (Math.exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else {
tmp = x + (1.0 / (((Math.exp(z) * 1.1283791670955126) - (x * y)) / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if math.exp(z) <= 0.0: tmp = x + (-1.0 / x) else: tmp = x + (1.0 / (((math.exp(z) * 1.1283791670955126) - (x * y)) / y)) return tmp
function code(x, y, z) tmp = 0.0 if (exp(z) <= 0.0) tmp = Float64(x + Float64(-1.0 / x)); else tmp = Float64(x + Float64(1.0 / Float64(Float64(Float64(exp(z) * 1.1283791670955126) - Float64(x * y)) / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (exp(z) <= 0.0) tmp = x + (-1.0 / x); else tmp = x + (1.0 / (((exp(z) * 1.1283791670955126) - (x * y)) / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[Exp[z], $MachinePrecision], 0.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(N[(N[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{e^{z} \cdot 1.1283791670955126 - x \cdot y}{y}}\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 88.6%
Taylor expanded in y around inf
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
if 0.0 < (exp.f64 z) Initial program 98.2%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f6498.2%
Applied egg-rr98.2%
Final simplification98.7%
(FPCore (x y z) :precision binary64 (if (<= (exp z) 0.0) (+ x (/ -1.0 x)) (+ x (/ y (- (* (exp z) 1.1283791670955126) (* x y))))))
double code(double x, double y, double z) {
double tmp;
if (exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else {
tmp = x + (y / ((exp(z) * 1.1283791670955126) - (x * y)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (exp(z) <= 0.0d0) then
tmp = x + ((-1.0d0) / x)
else
tmp = x + (y / ((exp(z) * 1.1283791670955126d0) - (x * y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (Math.exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else {
tmp = x + (y / ((Math.exp(z) * 1.1283791670955126) - (x * y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if math.exp(z) <= 0.0: tmp = x + (-1.0 / x) else: tmp = x + (y / ((math.exp(z) * 1.1283791670955126) - (x * y))) return tmp
function code(x, y, z) tmp = 0.0 if (exp(z) <= 0.0) tmp = Float64(x + Float64(-1.0 / x)); else tmp = Float64(x + Float64(y / Float64(Float64(exp(z) * 1.1283791670955126) - Float64(x * y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (exp(z) <= 0.0) tmp = x + (-1.0 / x); else tmp = x + (y / ((exp(z) * 1.1283791670955126) - (x * y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[Exp[z], $MachinePrecision], 0.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 88.6%
Taylor expanded in y around inf
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
if 0.0 < (exp.f64 z) Initial program 98.2%
Final simplification98.7%
(FPCore (x y z)
:precision binary64
(if (<= x -1.9e-148)
x
(if (<= x -9.5e-293)
(/ -1.0 x)
(if (<= x 1.15e-175)
(/ y 1.1283791670955126)
(if (<= x 1.85e-61) (/ -1.0 x) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.9e-148) {
tmp = x;
} else if (x <= -9.5e-293) {
tmp = -1.0 / x;
} else if (x <= 1.15e-175) {
tmp = y / 1.1283791670955126;
} else if (x <= 1.85e-61) {
tmp = -1.0 / x;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.9d-148)) then
tmp = x
else if (x <= (-9.5d-293)) then
tmp = (-1.0d0) / x
else if (x <= 1.15d-175) then
tmp = y / 1.1283791670955126d0
else if (x <= 1.85d-61) then
tmp = (-1.0d0) / x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.9e-148) {
tmp = x;
} else if (x <= -9.5e-293) {
tmp = -1.0 / x;
} else if (x <= 1.15e-175) {
tmp = y / 1.1283791670955126;
} else if (x <= 1.85e-61) {
tmp = -1.0 / x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.9e-148: tmp = x elif x <= -9.5e-293: tmp = -1.0 / x elif x <= 1.15e-175: tmp = y / 1.1283791670955126 elif x <= 1.85e-61: tmp = -1.0 / x else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.9e-148) tmp = x; elseif (x <= -9.5e-293) tmp = Float64(-1.0 / x); elseif (x <= 1.15e-175) tmp = Float64(y / 1.1283791670955126); elseif (x <= 1.85e-61) tmp = Float64(-1.0 / x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.9e-148) tmp = x; elseif (x <= -9.5e-293) tmp = -1.0 / x; elseif (x <= 1.15e-175) tmp = y / 1.1283791670955126; elseif (x <= 1.85e-61) tmp = -1.0 / x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.9e-148], x, If[LessEqual[x, -9.5e-293], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 1.15e-175], N[(y / 1.1283791670955126), $MachinePrecision], If[LessEqual[x, 1.85e-61], N[(-1.0 / x), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{-148}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-293}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-175}:\\
\;\;\;\;\frac{y}{1.1283791670955126}\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-61}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.90000000000000007e-148 or 1.85e-61 < x Initial program 98.0%
Taylor expanded in x around inf
Simplified87.0%
if -1.90000000000000007e-148 < x < -9.50000000000000049e-293 or 1.15e-175 < x < 1.85e-61Initial program 90.5%
Taylor expanded in x around inf
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
*-lowering-*.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6431.9%
Simplified31.9%
Taylor expanded in x around 0
/-lowering-/.f6461.6%
Simplified61.6%
if -9.50000000000000049e-293 < x < 1.15e-175Initial program 89.7%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6459.4%
Simplified59.4%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6451.6%
Simplified51.6%
Taylor expanded in z around 0
Simplified51.2%
(FPCore (x y z)
:precision binary64
(if (<= x -1.05e-148)
x
(if (<= x -1.2e-290)
(/ -1.0 x)
(if (<= x 6.6e-176)
(* y 0.8862269254527579)
(if (<= x 4.5e-61) (/ -1.0 x) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.05e-148) {
tmp = x;
} else if (x <= -1.2e-290) {
tmp = -1.0 / x;
} else if (x <= 6.6e-176) {
tmp = y * 0.8862269254527579;
} else if (x <= 4.5e-61) {
tmp = -1.0 / x;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.05d-148)) then
tmp = x
else if (x <= (-1.2d-290)) then
tmp = (-1.0d0) / x
else if (x <= 6.6d-176) then
tmp = y * 0.8862269254527579d0
else if (x <= 4.5d-61) then
tmp = (-1.0d0) / x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.05e-148) {
tmp = x;
} else if (x <= -1.2e-290) {
tmp = -1.0 / x;
} else if (x <= 6.6e-176) {
tmp = y * 0.8862269254527579;
} else if (x <= 4.5e-61) {
tmp = -1.0 / x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.05e-148: tmp = x elif x <= -1.2e-290: tmp = -1.0 / x elif x <= 6.6e-176: tmp = y * 0.8862269254527579 elif x <= 4.5e-61: tmp = -1.0 / x else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.05e-148) tmp = x; elseif (x <= -1.2e-290) tmp = Float64(-1.0 / x); elseif (x <= 6.6e-176) tmp = Float64(y * 0.8862269254527579); elseif (x <= 4.5e-61) tmp = Float64(-1.0 / x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.05e-148) tmp = x; elseif (x <= -1.2e-290) tmp = -1.0 / x; elseif (x <= 6.6e-176) tmp = y * 0.8862269254527579; elseif (x <= 4.5e-61) tmp = -1.0 / x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.05e-148], x, If[LessEqual[x, -1.2e-290], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 6.6e-176], N[(y * 0.8862269254527579), $MachinePrecision], If[LessEqual[x, 4.5e-61], N[(-1.0 / x), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-148}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{-290}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{-176}:\\
\;\;\;\;y \cdot 0.8862269254527579\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-61}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.05e-148 or 4.5e-61 < x Initial program 98.0%
Taylor expanded in x around inf
Simplified87.0%
if -1.05e-148 < x < -1.2e-290 or 6.60000000000000025e-176 < x < 4.5e-61Initial program 90.5%
Taylor expanded in x around inf
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
*-lowering-*.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6431.9%
Simplified31.9%
Taylor expanded in x around 0
/-lowering-/.f6461.6%
Simplified61.6%
if -1.2e-290 < x < 6.60000000000000025e-176Initial program 89.7%
Taylor expanded in x around 0
*-lowering-*.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f6452.6%
Simplified52.6%
Taylor expanded in z around 0
*-commutativeN/A
*-lowering-*.f6451.1%
Simplified51.1%
(FPCore (x y z)
:precision binary64
(if (<= z -300.0)
(+ x (/ -1.0 x))
(if (<= z 3.8e-11)
(+ x (/ y (- (+ 1.1283791670955126 (* z 1.1283791670955126)) (* x y))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -300.0) {
tmp = x + (-1.0 / x);
} else if (z <= 3.8e-11) {
tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y)));
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-300.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 3.8d-11) then
tmp = x + (y / ((1.1283791670955126d0 + (z * 1.1283791670955126d0)) - (x * y)))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -300.0) {
tmp = x + (-1.0 / x);
} else if (z <= 3.8e-11) {
tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -300.0: tmp = x + (-1.0 / x) elif z <= 3.8e-11: tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -300.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 3.8e-11) tmp = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 + Float64(z * 1.1283791670955126)) - Float64(x * y)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -300.0) tmp = x + (-1.0 / x); elseif (z <= 3.8e-11) tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -300.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-11], N[(x + N[(y / N[(N[(1.1283791670955126 + N[(z * 1.1283791670955126), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -300:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-11}:\\
\;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot 1.1283791670955126\right) - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -300Initial program 88.6%
Taylor expanded in y around inf
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
if -300 < z < 3.7999999999999998e-11Initial program 99.8%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.8%
Simplified99.8%
if 3.7999999999999998e-11 < z Initial program 94.9%
Taylor expanded in x around inf
Simplified100.0%
(FPCore (x y z)
:precision binary64
(if (<= z -2.8e+261)
x
(if (<= z -2.2e+30)
(/ -1.0 x)
(if (<= z 4.1e-101) (+ x (* y 0.8862269254527579)) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.8e+261) {
tmp = x;
} else if (z <= -2.2e+30) {
tmp = -1.0 / x;
} else if (z <= 4.1e-101) {
tmp = x + (y * 0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-2.8d+261)) then
tmp = x
else if (z <= (-2.2d+30)) then
tmp = (-1.0d0) / x
else if (z <= 4.1d-101) then
tmp = x + (y * 0.8862269254527579d0)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.8e+261) {
tmp = x;
} else if (z <= -2.2e+30) {
tmp = -1.0 / x;
} else if (z <= 4.1e-101) {
tmp = x + (y * 0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.8e+261: tmp = x elif z <= -2.2e+30: tmp = -1.0 / x elif z <= 4.1e-101: tmp = x + (y * 0.8862269254527579) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.8e+261) tmp = x; elseif (z <= -2.2e+30) tmp = Float64(-1.0 / x); elseif (z <= 4.1e-101) tmp = Float64(x + Float64(y * 0.8862269254527579)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.8e+261) tmp = x; elseif (z <= -2.2e+30) tmp = -1.0 / x; elseif (z <= 4.1e-101) tmp = x + (y * 0.8862269254527579); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.8e+261], x, If[LessEqual[z, -2.2e+30], N[(-1.0 / x), $MachinePrecision], If[LessEqual[z, 4.1e-101], N[(x + N[(y * 0.8862269254527579), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+261}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{+30}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-101}:\\
\;\;\;\;x + y \cdot 0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.7999999999999998e261 or 4.10000000000000026e-101 < z Initial program 96.5%
Taylor expanded in x around inf
Simplified92.1%
if -2.7999999999999998e261 < z < -2.2e30Initial program 87.6%
Taylor expanded in x around inf
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
*-lowering-*.f64N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6471.4%
Simplified71.4%
Taylor expanded in x around 0
/-lowering-/.f6463.3%
Simplified63.3%
if -2.2e30 < z < 4.10000000000000026e-101Initial program 98.9%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6498.9%
Simplified98.9%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6476.7%
Simplified76.7%
(FPCore (x y z) :precision binary64 (if (<= z -63.0) (+ x (/ -1.0 x)) (if (<= z 3.8e-11) (+ x (/ y (- 1.1283791670955126 (* x y)))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -63.0) {
tmp = x + (-1.0 / x);
} else if (z <= 3.8e-11) {
tmp = x + (y / (1.1283791670955126 - (x * y)));
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-63.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 3.8d-11) then
tmp = x + (y / (1.1283791670955126d0 - (x * y)))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -63.0) {
tmp = x + (-1.0 / x);
} else if (z <= 3.8e-11) {
tmp = x + (y / (1.1283791670955126 - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -63.0: tmp = x + (-1.0 / x) elif z <= 3.8e-11: tmp = x + (y / (1.1283791670955126 - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -63.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 3.8e-11) tmp = Float64(x + Float64(y / Float64(1.1283791670955126 - Float64(x * y)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -63.0) tmp = x + (-1.0 / x); elseif (z <= 3.8e-11) tmp = x + (y / (1.1283791670955126 - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -63.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-11], N[(x + N[(y / N[(1.1283791670955126 - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -63:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-11}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -63Initial program 88.6%
Taylor expanded in y around inf
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
if -63 < z < 3.7999999999999998e-11Initial program 99.8%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.8%
Simplified99.8%
if 3.7999999999999998e-11 < z Initial program 94.9%
Taylor expanded in x around inf
Simplified100.0%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= z -3.65e-9) (+ x (/ -1.0 x)) (if (<= z 3.15e-100) (+ x (/ 1.0 (/ 1.1283791670955126 y))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.65e-9) {
tmp = x + (-1.0 / x);
} else if (z <= 3.15e-100) {
tmp = x + (1.0 / (1.1283791670955126 / y));
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-3.65d-9)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 3.15d-100) then
tmp = x + (1.0d0 / (1.1283791670955126d0 / y))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.65e-9) {
tmp = x + (-1.0 / x);
} else if (z <= 3.15e-100) {
tmp = x + (1.0 / (1.1283791670955126 / y));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.65e-9: tmp = x + (-1.0 / x) elif z <= 3.15e-100: tmp = x + (1.0 / (1.1283791670955126 / y)) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.65e-9) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 3.15e-100) tmp = Float64(x + Float64(1.0 / Float64(1.1283791670955126 / y))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.65e-9) tmp = x + (-1.0 / x); elseif (z <= 3.15e-100) tmp = x + (1.0 / (1.1283791670955126 / y)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.65e-9], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.15e-100], N[(x + N[(1.0 / N[(1.1283791670955126 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.65 \cdot 10^{-9}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{-100}:\\
\;\;\;\;x + \frac{1}{\frac{1.1283791670955126}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.65000000000000001e-9Initial program 89.1%
Taylor expanded in y around inf
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
if -3.65000000000000001e-9 < z < 3.1499999999999998e-100Initial program 99.8%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.7%
Simplified99.7%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6479.6%
Simplified79.6%
metadata-evalN/A
div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f6479.7%
Applied egg-rr79.7%
if 3.1499999999999998e-100 < z Initial program 96.0%
Taylor expanded in x around inf
Simplified94.9%
(FPCore (x y z) :precision binary64 (if (<= z -6.8e-9) (+ x (/ -1.0 x)) (if (<= z 3.5e-99) (+ x (* y 0.8862269254527579)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -6.8e-9) {
tmp = x + (-1.0 / x);
} else if (z <= 3.5e-99) {
tmp = x + (y * 0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-6.8d-9)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 3.5d-99) then
tmp = x + (y * 0.8862269254527579d0)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -6.8e-9) {
tmp = x + (-1.0 / x);
} else if (z <= 3.5e-99) {
tmp = x + (y * 0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -6.8e-9: tmp = x + (-1.0 / x) elif z <= 3.5e-99: tmp = x + (y * 0.8862269254527579) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -6.8e-9) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 3.5e-99) tmp = Float64(x + Float64(y * 0.8862269254527579)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -6.8e-9) tmp = x + (-1.0 / x); elseif (z <= 3.5e-99) tmp = x + (y * 0.8862269254527579); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -6.8e-9], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e-99], N[(x + N[(y * 0.8862269254527579), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-9}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-99}:\\
\;\;\;\;x + y \cdot 0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.7999999999999997e-9Initial program 89.1%
Taylor expanded in y around inf
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
if -6.7999999999999997e-9 < z < 3.4999999999999999e-99Initial program 99.8%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.7%
Simplified99.7%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6479.6%
Simplified79.6%
if 3.4999999999999999e-99 < z Initial program 96.0%
Taylor expanded in x around inf
Simplified94.9%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 95.5%
Taylor expanded in x around inf
Simplified68.4%
(FPCore (x y z) :precision binary64 (+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x))))
double code(double x, double y, double z) {
return x + (1.0 / (((1.1283791670955126 / y) * exp(z)) - x));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (1.0d0 / (((1.1283791670955126d0 / y) * exp(z)) - x))
end function
public static double code(double x, double y, double z) {
return x + (1.0 / (((1.1283791670955126 / y) * Math.exp(z)) - x));
}
def code(x, y, z): return x + (1.0 / (((1.1283791670955126 / y) * math.exp(z)) - x))
function code(x, y, z) return Float64(x + Float64(1.0 / Float64(Float64(Float64(1.1283791670955126 / y) * exp(z)) - x))) end
function tmp = code(x, y, z) tmp = x + (1.0 / (((1.1283791670955126 / y) * exp(z)) - x)); end
code[x_, y_, z_] := N[(x + N[(1.0 / N[(N[(N[(1.1283791670955126 / y), $MachinePrecision] * N[Exp[z], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{1}{\frac{1.1283791670955126}{y} \cdot e^{z} - x}
\end{array}
herbie shell --seed 2024161
(FPCore (x y z)
:name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ 1 (- (* (/ 5641895835477563/5000000000000000 y) (exp z)) x))))
(+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))