
(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 (if (<= (exp z) 0.0) (+ x (/ -1.0 x)) (- x (/ y (fma x y (* (exp z) -1.1283791670955126))))))
double code(double x, double y, double z) {
double tmp;
if (exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else {
tmp = x - (y / fma(x, y, (exp(z) * -1.1283791670955126)));
}
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 / fma(x, y, Float64(exp(z) * -1.1283791670955126)))); end return 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[(x * y + N[(N[Exp[z], $MachinePrecision] * -1.1283791670955126), $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}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 89.8%
remove-double-neg89.8%
distribute-frac-neg89.8%
unsub-neg89.8%
distribute-frac-neg89.8%
distribute-neg-frac289.8%
neg-sub089.8%
associate--r-89.8%
neg-sub090.1%
+-commutative90.1%
fma-define90.1%
*-commutative90.1%
distribute-rgt-neg-in90.1%
metadata-eval90.1%
Simplified90.1%
Taylor expanded in y around inf 100.0%
if 0.0 < (exp.f64 z) Initial program 97.3%
remove-double-neg97.3%
distribute-frac-neg97.3%
unsub-neg97.3%
distribute-frac-neg97.3%
distribute-neg-frac297.3%
neg-sub097.3%
associate--r-97.3%
neg-sub097.3%
+-commutative97.3%
fma-define99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (<= (exp z) 0.0)
(+ x (/ -1.0 x))
(if (<= (exp z) 1.000000002)
(+
x
(/
y
(-
(+
1.1283791670955126
(*
z
(+
1.1283791670955126
(* z (+ 0.5641895835477563 (* z 0.18806319451591877))))))
(* x y))))
(- x (* (/ y (exp z)) -0.8862269254527579)))))
double code(double x, double y, double z) {
double tmp;
if (exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else if (exp(z) <= 1.000000002) {
tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * (0.5641895835477563 + (z * 0.18806319451591877)))))) - (x * y)));
} else {
tmp = x - ((y / exp(z)) * -0.8862269254527579);
}
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 if (exp(z) <= 1.000000002d0) then
tmp = x + (y / ((1.1283791670955126d0 + (z * (1.1283791670955126d0 + (z * (0.5641895835477563d0 + (z * 0.18806319451591877d0)))))) - (x * y)))
else
tmp = x - ((y / exp(z)) * (-0.8862269254527579d0))
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 if (Math.exp(z) <= 1.000000002) {
tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * (0.5641895835477563 + (z * 0.18806319451591877)))))) - (x * y)));
} else {
tmp = x - ((y / Math.exp(z)) * -0.8862269254527579);
}
return tmp;
}
def code(x, y, z): tmp = 0 if math.exp(z) <= 0.0: tmp = x + (-1.0 / x) elif math.exp(z) <= 1.000000002: tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * (0.5641895835477563 + (z * 0.18806319451591877)))))) - (x * y))) else: tmp = x - ((y / math.exp(z)) * -0.8862269254527579) return tmp
function code(x, y, z) tmp = 0.0 if (exp(z) <= 0.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (exp(z) <= 1.000000002) tmp = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 + Float64(z * Float64(1.1283791670955126 + Float64(z * Float64(0.5641895835477563 + Float64(z * 0.18806319451591877)))))) - Float64(x * y)))); else tmp = Float64(x - Float64(Float64(y / exp(z)) * -0.8862269254527579)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (exp(z) <= 0.0) tmp = x + (-1.0 / x); elseif (exp(z) <= 1.000000002) tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * (0.5641895835477563 + (z * 0.18806319451591877)))))) - (x * y))); else tmp = x - ((y / exp(z)) * -0.8862269254527579); 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], If[LessEqual[N[Exp[z], $MachinePrecision], 1.000000002], N[(x + N[(y / N[(N[(1.1283791670955126 + N[(z * N[(1.1283791670955126 + N[(z * N[(0.5641895835477563 + N[(z * 0.18806319451591877), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / N[Exp[z], $MachinePrecision]), $MachinePrecision] * -0.8862269254527579), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;e^{z} \leq 1.000000002:\\
\;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot \left(1.1283791670955126 + z \cdot \left(0.5641895835477563 + z \cdot 0.18806319451591877\right)\right)\right) - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{e^{z}} \cdot -0.8862269254527579\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 89.8%
remove-double-neg89.8%
distribute-frac-neg89.8%
unsub-neg89.8%
distribute-frac-neg89.8%
distribute-neg-frac289.8%
neg-sub089.8%
associate--r-89.8%
neg-sub090.1%
+-commutative90.1%
fma-define90.1%
*-commutative90.1%
distribute-rgt-neg-in90.1%
metadata-eval90.1%
Simplified90.1%
Taylor expanded in y around inf 100.0%
if 0.0 < (exp.f64 z) < 1.00000000199999994Initial program 99.8%
Taylor expanded in z around 0 99.2%
*-commutative99.2%
Simplified99.2%
if 1.00000000199999994 < (exp.f64 z) Initial program 92.3%
remove-double-neg92.3%
distribute-frac-neg92.3%
unsub-neg92.3%
distribute-frac-neg92.3%
distribute-neg-frac292.3%
neg-sub092.3%
associate--r-92.3%
neg-sub092.3%
+-commutative92.3%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (<= (exp z) 0.0)
(+ x (/ -1.0 x))
(if (<= (exp z) 1.00000006)
(+
x
(/
y
(-
(+
1.1283791670955126
(*
z
(+
1.1283791670955126
(* z (+ 0.5641895835477563 (* z 0.18806319451591877))))))
(* x y))))
x)))
double code(double x, double y, double z) {
double tmp;
if (exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else if (exp(z) <= 1.00000006) {
tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * (0.5641895835477563 + (z * 0.18806319451591877)))))) - (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 (exp(z) <= 0.0d0) then
tmp = x + ((-1.0d0) / x)
else if (exp(z) <= 1.00000006d0) then
tmp = x + (y / ((1.1283791670955126d0 + (z * (1.1283791670955126d0 + (z * (0.5641895835477563d0 + (z * 0.18806319451591877d0)))))) - (x * y)))
else
tmp = x
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 if (Math.exp(z) <= 1.00000006) {
tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * (0.5641895835477563 + (z * 0.18806319451591877)))))) - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if math.exp(z) <= 0.0: tmp = x + (-1.0 / x) elif math.exp(z) <= 1.00000006: tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * (0.5641895835477563 + (z * 0.18806319451591877)))))) - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (exp(z) <= 0.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (exp(z) <= 1.00000006) tmp = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 + Float64(z * Float64(1.1283791670955126 + Float64(z * Float64(0.5641895835477563 + Float64(z * 0.18806319451591877)))))) - Float64(x * y)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (exp(z) <= 0.0) tmp = x + (-1.0 / x); elseif (exp(z) <= 1.00000006) tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * (0.5641895835477563 + (z * 0.18806319451591877)))))) - (x * y))); else tmp = x; 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], If[LessEqual[N[Exp[z], $MachinePrecision], 1.00000006], N[(x + N[(y / N[(N[(1.1283791670955126 + N[(z * N[(1.1283791670955126 + N[(z * N[(0.5641895835477563 + N[(z * 0.18806319451591877), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;e^{z} \leq 1.00000006:\\
\;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot \left(1.1283791670955126 + z \cdot \left(0.5641895835477563 + z \cdot 0.18806319451591877\right)\right)\right) - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 89.8%
remove-double-neg89.8%
distribute-frac-neg89.8%
unsub-neg89.8%
distribute-frac-neg89.8%
distribute-neg-frac289.8%
neg-sub089.8%
associate--r-89.8%
neg-sub090.1%
+-commutative90.1%
fma-define90.1%
*-commutative90.1%
distribute-rgt-neg-in90.1%
metadata-eval90.1%
Simplified90.1%
Taylor expanded in y around inf 100.0%
if 0.0 < (exp.f64 z) < 1.0000000600000001Initial program 99.8%
Taylor expanded in z around 0 99.2%
*-commutative99.2%
Simplified99.2%
if 1.0000000600000001 < (exp.f64 z) Initial program 92.1%
remove-double-neg92.1%
distribute-frac-neg92.1%
unsub-neg92.1%
distribute-frac-neg92.1%
distribute-neg-frac292.1%
neg-sub092.1%
associate--r-92.1%
neg-sub092.1%
+-commutative92.1%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 68.4%
Taylor expanded in x around inf 100.0%
Final simplification99.6%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (/ y (- (* (exp z) 1.1283791670955126) (* x y)))))) (if (<= t_0 2e+196) t_0 (+ x (/ -1.0 x)))))
double code(double x, double y, double z) {
double t_0 = x + (y / ((exp(z) * 1.1283791670955126) - (x * y)));
double tmp;
if (t_0 <= 2e+196) {
tmp = t_0;
} else {
tmp = x + (-1.0 / 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 = x + (y / ((exp(z) * 1.1283791670955126d0) - (x * y)))
if (t_0 <= 2d+196) then
tmp = t_0
else
tmp = x + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (y / ((Math.exp(z) * 1.1283791670955126) - (x * y)));
double tmp;
if (t_0 <= 2e+196) {
tmp = t_0;
} else {
tmp = x + (-1.0 / x);
}
return tmp;
}
def code(x, y, z): t_0 = x + (y / ((math.exp(z) * 1.1283791670955126) - (x * y))) tmp = 0 if t_0 <= 2e+196: tmp = t_0 else: tmp = x + (-1.0 / x) return tmp
function code(x, y, z) t_0 = Float64(x + Float64(y / Float64(Float64(exp(z) * 1.1283791670955126) - Float64(x * y)))) tmp = 0.0 if (t_0 <= 2e+196) tmp = t_0; else tmp = Float64(x + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (y / ((exp(z) * 1.1283791670955126) - (x * y))); tmp = 0.0; if (t_0 <= 2e+196) tmp = t_0; else tmp = x + (-1.0 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y / N[(N[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e+196], t$95$0, N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{+196}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-1}{x}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) < 1.9999999999999999e196Initial program 99.0%
if 1.9999999999999999e196 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) Initial program 73.1%
remove-double-neg73.1%
distribute-frac-neg73.1%
unsub-neg73.1%
distribute-frac-neg73.1%
distribute-neg-frac273.1%
neg-sub073.3%
associate--r-73.3%
neg-sub073.6%
+-commutative73.6%
fma-define88.3%
*-commutative88.3%
distribute-rgt-neg-in88.3%
metadata-eval88.3%
Simplified88.3%
Taylor expanded in y around inf 100.0%
Final simplification99.1%
(FPCore (x y z)
:precision binary64
(if (<= z -1850000.0)
(+ x (/ -1.0 x))
(if (<= z 6.5e-8)
(+
x
(/
y
(-
(+
1.1283791670955126
(* z (+ 1.1283791670955126 (* z 0.5641895835477563))))
(* x y))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1850000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 6.5e-8) {
tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * 0.5641895835477563)))) - (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 <= (-1850000.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 6.5d-8) then
tmp = x + (y / ((1.1283791670955126d0 + (z * (1.1283791670955126d0 + (z * 0.5641895835477563d0)))) - (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 <= -1850000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 6.5e-8) {
tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * 0.5641895835477563)))) - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1850000.0: tmp = x + (-1.0 / x) elif z <= 6.5e-8: tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * 0.5641895835477563)))) - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1850000.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 6.5e-8) tmp = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 + Float64(z * Float64(1.1283791670955126 + Float64(z * 0.5641895835477563)))) - Float64(x * y)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1850000.0) tmp = x + (-1.0 / x); elseif (z <= 6.5e-8) tmp = x + (y / ((1.1283791670955126 + (z * (1.1283791670955126 + (z * 0.5641895835477563)))) - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1850000.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-8], N[(x + N[(y / N[(N[(1.1283791670955126 + N[(z * N[(1.1283791670955126 + N[(z * 0.5641895835477563), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1850000:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-8}:\\
\;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot \left(1.1283791670955126 + z \cdot 0.5641895835477563\right)\right) - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.85e6Initial program 89.6%
remove-double-neg89.6%
distribute-frac-neg89.6%
unsub-neg89.6%
distribute-frac-neg89.6%
distribute-neg-frac289.6%
neg-sub089.6%
associate--r-89.6%
neg-sub089.9%
+-commutative89.9%
fma-define89.9%
*-commutative89.9%
distribute-rgt-neg-in89.9%
metadata-eval89.9%
Simplified89.9%
Taylor expanded in y around inf 100.0%
if -1.85e6 < z < 6.49999999999999997e-8Initial program 99.8%
Taylor expanded in z around 0 99.2%
*-commutative99.2%
Simplified99.2%
if 6.49999999999999997e-8 < z Initial program 92.1%
remove-double-neg92.1%
distribute-frac-neg92.1%
unsub-neg92.1%
distribute-frac-neg92.1%
distribute-neg-frac292.1%
neg-sub092.1%
associate--r-92.1%
neg-sub092.1%
+-commutative92.1%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 68.4%
Taylor expanded in x around inf 100.0%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (<= z -1850000.0)
(+ x (/ -1.0 x))
(if (<= z 6.5e-8)
(+ x (/ y (- (+ 1.1283791670955126 (* z 1.1283791670955126)) (* x y))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1850000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 6.5e-8) {
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 <= (-1850000.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 6.5d-8) 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 <= -1850000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 6.5e-8) {
tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1850000.0: tmp = x + (-1.0 / x) elif z <= 6.5e-8: 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 <= -1850000.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 6.5e-8) 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 <= -1850000.0) tmp = x + (-1.0 / x); elseif (z <= 6.5e-8) 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, -1850000.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-8], 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 -1850000:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-8}:\\
\;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot 1.1283791670955126\right) - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.85e6Initial program 89.6%
remove-double-neg89.6%
distribute-frac-neg89.6%
unsub-neg89.6%
distribute-frac-neg89.6%
distribute-neg-frac289.6%
neg-sub089.6%
associate--r-89.6%
neg-sub089.9%
+-commutative89.9%
fma-define89.9%
*-commutative89.9%
distribute-rgt-neg-in89.9%
metadata-eval89.9%
Simplified89.9%
Taylor expanded in y around inf 100.0%
if -1.85e6 < z < 6.49999999999999997e-8Initial program 99.8%
Taylor expanded in z around 0 99.1%
*-commutative99.1%
Simplified99.1%
if 6.49999999999999997e-8 < z Initial program 92.1%
remove-double-neg92.1%
distribute-frac-neg92.1%
unsub-neg92.1%
distribute-frac-neg92.1%
distribute-neg-frac292.1%
neg-sub092.1%
associate--r-92.1%
neg-sub092.1%
+-commutative92.1%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 68.4%
Taylor expanded in x around inf 100.0%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (<= z -13.0) (+ x (/ -1.0 x)) (if (<= z 6.8e-44) (+ x (* (* y -0.8862269254527579) (+ z -1.0))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -13.0) {
tmp = x + (-1.0 / x);
} else if (z <= 6.8e-44) {
tmp = x + ((y * -0.8862269254527579) * (z + -1.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) :: tmp
if (z <= (-13.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 6.8d-44) then
tmp = x + ((y * (-0.8862269254527579d0)) * (z + (-1.0d0)))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -13.0) {
tmp = x + (-1.0 / x);
} else if (z <= 6.8e-44) {
tmp = x + ((y * -0.8862269254527579) * (z + -1.0));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -13.0: tmp = x + (-1.0 / x) elif z <= 6.8e-44: tmp = x + ((y * -0.8862269254527579) * (z + -1.0)) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -13.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 6.8e-44) tmp = Float64(x + Float64(Float64(y * -0.8862269254527579) * Float64(z + -1.0))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -13.0) tmp = x + (-1.0 / x); elseif (z <= 6.8e-44) tmp = x + ((y * -0.8862269254527579) * (z + -1.0)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -13.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e-44], N[(x + N[(N[(y * -0.8862269254527579), $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -13:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-44}:\\
\;\;\;\;x + \left(y \cdot -0.8862269254527579\right) \cdot \left(z + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -13Initial program 89.9%
remove-double-neg89.9%
distribute-frac-neg89.9%
unsub-neg89.9%
distribute-frac-neg89.9%
distribute-neg-frac289.9%
neg-sub090.0%
associate--r-90.0%
neg-sub090.3%
+-commutative90.3%
fma-define90.3%
*-commutative90.3%
distribute-rgt-neg-in90.3%
metadata-eval90.3%
Simplified90.3%
Taylor expanded in y around inf 100.0%
if -13 < z < 6.80000000000000033e-44Initial program 99.8%
Taylor expanded in z around 0 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in y around 0 76.7%
Taylor expanded in z around 0 76.7%
associate-*r*76.7%
*-commutative76.7%
*-commutative76.7%
metadata-eval76.7%
distribute-rgt-neg-in76.7%
*-rgt-identity76.7%
distribute-rgt-neg-in76.7%
metadata-eval76.7%
distribute-lft-out76.7%
Simplified76.7%
if 6.80000000000000033e-44 < z Initial program 93.0%
remove-double-neg93.0%
distribute-frac-neg93.0%
unsub-neg93.0%
distribute-frac-neg93.0%
distribute-neg-frac293.0%
neg-sub093.0%
associate--r-93.0%
neg-sub093.0%
+-commutative93.0%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 71.7%
Taylor expanded in x around inf 95.9%
Final simplification87.7%
(FPCore (x y z) :precision binary64 (if (<= z -1850000.0) (+ x (/ -1.0 x)) (if (<= z 6.5e-8) (+ x (/ y (- 1.1283791670955126 (* x y)))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1850000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 6.5e-8) {
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 <= (-1850000.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 6.5d-8) 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 <= -1850000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 6.5e-8) {
tmp = x + (y / (1.1283791670955126 - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1850000.0: tmp = x + (-1.0 / x) elif z <= 6.5e-8: tmp = x + (y / (1.1283791670955126 - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1850000.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 6.5e-8) 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 <= -1850000.0) tmp = x + (-1.0 / x); elseif (z <= 6.5e-8) tmp = x + (y / (1.1283791670955126 - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1850000.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-8], 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 -1850000:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-8}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.85e6Initial program 89.6%
remove-double-neg89.6%
distribute-frac-neg89.6%
unsub-neg89.6%
distribute-frac-neg89.6%
distribute-neg-frac289.6%
neg-sub089.6%
associate--r-89.6%
neg-sub089.9%
+-commutative89.9%
fma-define89.9%
*-commutative89.9%
distribute-rgt-neg-in89.9%
metadata-eval89.9%
Simplified89.9%
Taylor expanded in y around inf 100.0%
if -1.85e6 < z < 6.49999999999999997e-8Initial program 99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
unsub-neg99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
fma-define99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 98.9%
if 6.49999999999999997e-8 < z Initial program 92.1%
remove-double-neg92.1%
distribute-frac-neg92.1%
unsub-neg92.1%
distribute-frac-neg92.1%
distribute-neg-frac292.1%
neg-sub092.1%
associate--r-92.1%
neg-sub092.1%
+-commutative92.1%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 68.4%
Taylor expanded in x around inf 100.0%
Final simplification99.4%
(FPCore (x y z) :precision binary64 (if (<= z -5.8) (+ x (/ -1.0 x)) (if (<= z 6.5e-42) (- x (/ y -1.1283791670955126)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.8) {
tmp = x + (-1.0 / x);
} else if (z <= 6.5e-42) {
tmp = x - (y / -1.1283791670955126);
} 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 <= (-5.8d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 6.5d-42) then
tmp = x - (y / (-1.1283791670955126d0))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5.8) {
tmp = x + (-1.0 / x);
} else if (z <= 6.5e-42) {
tmp = x - (y / -1.1283791670955126);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.8: tmp = x + (-1.0 / x) elif z <= 6.5e-42: tmp = x - (y / -1.1283791670955126) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.8) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 6.5e-42) tmp = Float64(x - Float64(y / -1.1283791670955126)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.8) tmp = x + (-1.0 / x); elseif (z <= 6.5e-42) tmp = x - (y / -1.1283791670955126); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.8], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-42], N[(x - N[(y / -1.1283791670955126), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-42}:\\
\;\;\;\;x - \frac{y}{-1.1283791670955126}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.79999999999999982Initial program 89.9%
remove-double-neg89.9%
distribute-frac-neg89.9%
unsub-neg89.9%
distribute-frac-neg89.9%
distribute-neg-frac289.9%
neg-sub090.0%
associate--r-90.0%
neg-sub090.3%
+-commutative90.3%
fma-define90.3%
*-commutative90.3%
distribute-rgt-neg-in90.3%
metadata-eval90.3%
Simplified90.3%
Taylor expanded in y around inf 100.0%
if -5.79999999999999982 < z < 6.4999999999999998e-42Initial program 99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
unsub-neg99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
fma-define99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.2%
Taylor expanded in x around 0 76.7%
if 6.4999999999999998e-42 < z Initial program 93.0%
remove-double-neg93.0%
distribute-frac-neg93.0%
unsub-neg93.0%
distribute-frac-neg93.0%
distribute-neg-frac293.0%
neg-sub093.0%
associate--r-93.0%
neg-sub093.0%
+-commutative93.0%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 71.7%
Taylor expanded in x around inf 95.9%
Final simplification87.7%
(FPCore (x y z) :precision binary64 (if (<= z -1850000.0) (+ x (/ -1.0 x)) x))
double code(double x, double y, double z) {
double tmp;
if (z <= -1850000.0) {
tmp = x + (-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 (z <= (-1850000.0d0)) then
tmp = x + ((-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 (z <= -1850000.0) {
tmp = x + (-1.0 / x);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1850000.0: tmp = x + (-1.0 / x) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1850000.0) tmp = Float64(x + Float64(-1.0 / x)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1850000.0) tmp = x + (-1.0 / x); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1850000.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1850000:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.85e6Initial program 89.6%
remove-double-neg89.6%
distribute-frac-neg89.6%
unsub-neg89.6%
distribute-frac-neg89.6%
distribute-neg-frac289.6%
neg-sub089.6%
associate--r-89.6%
neg-sub089.9%
+-commutative89.9%
fma-define89.9%
*-commutative89.9%
distribute-rgt-neg-in89.9%
metadata-eval89.9%
Simplified89.9%
Taylor expanded in y around inf 100.0%
if -1.85e6 < z Initial program 97.4%
remove-double-neg97.4%
distribute-frac-neg97.4%
unsub-neg97.4%
distribute-frac-neg97.4%
distribute-neg-frac297.4%
neg-sub097.4%
associate--r-97.4%
neg-sub097.4%
+-commutative97.4%
fma-define99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 89.1%
Taylor expanded in x around inf 76.4%
Final simplification81.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.6%
remove-double-neg95.6%
distribute-frac-neg95.6%
unsub-neg95.6%
distribute-frac-neg95.6%
distribute-neg-frac295.6%
neg-sub095.6%
associate--r-95.6%
neg-sub095.6%
+-commutative95.6%
fma-define97.6%
*-commutative97.6%
distribute-rgt-neg-in97.6%
metadata-eval97.6%
Simplified97.6%
Taylor expanded in z around 0 83.6%
Taylor expanded in x around inf 71.5%
Final simplification71.5%
(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 2024079
(FPCore (x y z)
:name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
:precision binary64
:alt
(+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x)))
(+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))