
(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 14 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.7%
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%
(FPCore (x y z)
:precision binary64
(if (<= (exp z) 0.0)
(- x (/ 1.0 x))
(if (<= (exp z) 1.00000002)
(+
x
(/
y
(+
1.1283791670955126
(-
(*
z
(-
1.1283791670955126
(* z (- (* z -0.18806319451591877) 0.5641895835477563))))
(* x y)))))
(- x (/ (* y -0.8862269254527579) (exp z))))))
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.00000002) {
tmp = x + (y / (1.1283791670955126 + ((z * (1.1283791670955126 - (z * ((z * -0.18806319451591877) - 0.5641895835477563)))) - (x * y))));
} else {
tmp = x - ((y * -0.8862269254527579) / exp(z));
}
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.00000002d0) then
tmp = x + (y / (1.1283791670955126d0 + ((z * (1.1283791670955126d0 - (z * ((z * (-0.18806319451591877d0)) - 0.5641895835477563d0)))) - (x * y))))
else
tmp = x - ((y * (-0.8862269254527579d0)) / exp(z))
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.00000002) {
tmp = x + (y / (1.1283791670955126 + ((z * (1.1283791670955126 - (z * ((z * -0.18806319451591877) - 0.5641895835477563)))) - (x * y))));
} else {
tmp = x - ((y * -0.8862269254527579) / Math.exp(z));
}
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.00000002: tmp = x + (y / (1.1283791670955126 + ((z * (1.1283791670955126 - (z * ((z * -0.18806319451591877) - 0.5641895835477563)))) - (x * y)))) else: tmp = x - ((y * -0.8862269254527579) / math.exp(z)) 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.00000002) tmp = Float64(x + Float64(y / Float64(1.1283791670955126 + Float64(Float64(z * Float64(1.1283791670955126 - Float64(z * Float64(Float64(z * -0.18806319451591877) - 0.5641895835477563)))) - Float64(x * y))))); else tmp = Float64(x - Float64(Float64(y * -0.8862269254527579) / exp(z))); 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.00000002) tmp = x + (y / (1.1283791670955126 + ((z * (1.1283791670955126 - (z * ((z * -0.18806319451591877) - 0.5641895835477563)))) - (x * y)))); else tmp = x - ((y * -0.8862269254527579) / exp(z)); 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.00000002], N[(x + N[(y / N[(1.1283791670955126 + N[(N[(z * N[(1.1283791670955126 - N[(z * N[(N[(z * -0.18806319451591877), $MachinePrecision] - 0.5641895835477563), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * -0.8862269254527579), $MachinePrecision] / N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x - \frac{1}{x}\\
\mathbf{elif}\;e^{z} \leq 1.00000002:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 + \left(z \cdot \left(1.1283791670955126 - z \cdot \left(z \cdot -0.18806319451591877 - 0.5641895835477563\right)\right) - x \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot -0.8862269254527579}{e^{z}}\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 89.7%
Taylor expanded in y around inf 100.0%
if 0.0 < (exp.f64 z) < 1.0000000200000001Initial 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.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 99.8%
if 1.0000000200000001 < (exp.f64 z) Initial program 91.2%
remove-double-neg91.2%
distribute-frac-neg91.2%
unsub-neg91.2%
distribute-frac-neg91.2%
distribute-neg-frac291.2%
neg-sub091.2%
associate--r-91.2%
neg-sub091.2%
+-commutative91.2%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
associate-*r/100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (<= (exp z) 0.0)
(- x (/ 1.0 x))
(if (<= (exp z) 1.2)
(+
x
(/
y
(+
1.1283791670955126
(-
(*
z
(-
1.1283791670955126
(* z (- (* z -0.18806319451591877) 0.5641895835477563))))
(* 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.2) {
tmp = x + (y / (1.1283791670955126 + ((z * (1.1283791670955126 - (z * ((z * -0.18806319451591877) - 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 (exp(z) <= 0.0d0) then
tmp = x - (1.0d0 / x)
else if (exp(z) <= 1.2d0) then
tmp = x + (y / (1.1283791670955126d0 + ((z * (1.1283791670955126d0 - (z * ((z * (-0.18806319451591877d0)) - 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 (Math.exp(z) <= 0.0) {
tmp = x - (1.0 / x);
} else if (Math.exp(z) <= 1.2) {
tmp = x + (y / (1.1283791670955126 + ((z * (1.1283791670955126 - (z * ((z * -0.18806319451591877) - 0.5641895835477563)))) - (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.2: tmp = x + (y / (1.1283791670955126 + ((z * (1.1283791670955126 - (z * ((z * -0.18806319451591877) - 0.5641895835477563)))) - (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.2) tmp = Float64(x + Float64(y / Float64(1.1283791670955126 + Float64(Float64(z * Float64(1.1283791670955126 - Float64(z * Float64(Float64(z * -0.18806319451591877) - 0.5641895835477563)))) - 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.2) tmp = x + (y / (1.1283791670955126 + ((z * (1.1283791670955126 - (z * ((z * -0.18806319451591877) - 0.5641895835477563)))) - (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.2], N[(x + N[(y / N[(1.1283791670955126 + N[(N[(z * N[(1.1283791670955126 - N[(z * N[(N[(z * -0.18806319451591877), $MachinePrecision] - 0.5641895835477563), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $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.2:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 + \left(z \cdot \left(1.1283791670955126 - z \cdot \left(z \cdot -0.18806319451591877 - 0.5641895835477563\right)\right) - x \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 89.7%
Taylor expanded in y around inf 100.0%
if 0.0 < (exp.f64 z) < 1.19999999999999996Initial 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.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 99.4%
if 1.19999999999999996 < (exp.f64 z) Initial program 90.9%
Taylor expanded in x around inf 100.0%
Final simplification99.7%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (/ y (- (* (exp z) 1.1283791670955126) (* x y)))))) (if (<= t_0 1e+292) 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 <= 1e+292) {
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 <= 1d+292) 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 <= 1e+292) {
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 <= 1e+292: 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 <= 1e+292) 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 <= 1e+292) 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, 1e+292], 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 10^{+292}:\\
\;\;\;\;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)))) < 1e292Initial program 98.3%
if 1e292 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) Initial program 28.7%
Taylor expanded in y around inf 100.0%
Final simplification98.4%
(FPCore (x y z)
:precision binary64
(if (<= z -3600000000000.0)
(- x (/ 1.0 x))
(if (<= z 0.27)
(+
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 <= -3600000000000.0) {
tmp = x - (1.0 / x);
} else if (z <= 0.27) {
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 <= (-3600000000000.0d0)) then
tmp = x - (1.0d0 / x)
else if (z <= 0.27d0) 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 <= -3600000000000.0) {
tmp = x - (1.0 / x);
} else if (z <= 0.27) {
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 <= -3600000000000.0: tmp = x - (1.0 / x) elif z <= 0.27: 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 <= -3600000000000.0) tmp = Float64(x - Float64(1.0 / x)); elseif (z <= 0.27) tmp = Float64(x + Float64(y / Float64(1.1283791670955126 + Float64(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 <= -3600000000000.0) tmp = x - (1.0 / x); elseif (z <= 0.27) 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, -3600000000000.0], N[(x - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.27], N[(x + N[(y / N[(1.1283791670955126 + N[(N[(z * N[(1.1283791670955126 - N[(z * -0.5641895835477563), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3600000000000:\\
\;\;\;\;x - \frac{1}{x}\\
\mathbf{elif}\;z \leq 0.27:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 + \left(z \cdot \left(1.1283791670955126 - z \cdot -0.5641895835477563\right) - x \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.6e12Initial program 89.2%
Taylor expanded in y around inf 100.0%
if -3.6e12 < z < 0.27000000000000002Initial program 99.9%
remove-double-neg99.9%
distribute-frac-neg99.9%
unsub-neg99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
fma-define99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 99.2%
if 0.27000000000000002 < z Initial program 90.9%
Taylor expanded in x around inf 100.0%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (<= x -2.8e-5)
x
(if (<= x -9.6e-155)
(/ -1.0 x)
(if (<= x 1.6e-227)
(- x (* y -0.8862269254527579))
(if (<= x 1.3e-18) (/ -1.0 x) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.8e-5) {
tmp = x;
} else if (x <= -9.6e-155) {
tmp = -1.0 / x;
} else if (x <= 1.6e-227) {
tmp = x - (y * -0.8862269254527579);
} else if (x <= 1.3e-18) {
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 <= (-2.8d-5)) then
tmp = x
else if (x <= (-9.6d-155)) then
tmp = (-1.0d0) / x
else if (x <= 1.6d-227) then
tmp = x - (y * (-0.8862269254527579d0))
else if (x <= 1.3d-18) 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 <= -2.8e-5) {
tmp = x;
} else if (x <= -9.6e-155) {
tmp = -1.0 / x;
} else if (x <= 1.6e-227) {
tmp = x - (y * -0.8862269254527579);
} else if (x <= 1.3e-18) {
tmp = -1.0 / x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.8e-5: tmp = x elif x <= -9.6e-155: tmp = -1.0 / x elif x <= 1.6e-227: tmp = x - (y * -0.8862269254527579) elif x <= 1.3e-18: tmp = -1.0 / x else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.8e-5) tmp = x; elseif (x <= -9.6e-155) tmp = Float64(-1.0 / x); elseif (x <= 1.6e-227) tmp = Float64(x - Float64(y * -0.8862269254527579)); elseif (x <= 1.3e-18) tmp = Float64(-1.0 / x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.8e-5) tmp = x; elseif (x <= -9.6e-155) tmp = -1.0 / x; elseif (x <= 1.6e-227) tmp = x - (y * -0.8862269254527579); elseif (x <= 1.3e-18) tmp = -1.0 / x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.8e-5], x, If[LessEqual[x, -9.6e-155], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 1.6e-227], N[(x - N[(y * -0.8862269254527579), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e-18], N[(-1.0 / x), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{-5}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -9.6 \cdot 10^{-155}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-227}:\\
\;\;\;\;x - y \cdot -0.8862269254527579\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.79999999999999996e-5 or 1.3e-18 < x Initial program 96.4%
Taylor expanded in x around inf 97.3%
if -2.79999999999999996e-5 < x < -9.600000000000001e-155 or 1.60000000000000005e-227 < x < 1.3e-18Initial program 95.5%
Taylor expanded in y around inf 61.1%
Taylor expanded in x around 0 60.7%
if -9.600000000000001e-155 < x < 1.60000000000000005e-227Initial program 91.6%
remove-double-neg91.6%
distribute-frac-neg91.6%
unsub-neg91.6%
distribute-frac-neg91.6%
distribute-neg-frac291.6%
neg-sub091.5%
associate--r-91.5%
neg-sub091.9%
+-commutative91.9%
fma-define91.9%
*-commutative91.9%
distribute-rgt-neg-in91.9%
metadata-eval91.9%
Simplified91.9%
Taylor expanded in z around 0 51.7%
Taylor expanded in y around 0 43.5%
*-commutative43.5%
Simplified43.5%
(FPCore (x y z)
:precision binary64
(if (<= x -2.5e-5)
x
(if (<= x -1.95e-155)
(/ -1.0 x)
(if (<= x 1.1e-261)
(/ y 1.1283791670955126)
(if (<= x 2e-21) (/ -1.0 x) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.5e-5) {
tmp = x;
} else if (x <= -1.95e-155) {
tmp = -1.0 / x;
} else if (x <= 1.1e-261) {
tmp = y / 1.1283791670955126;
} else if (x <= 2e-21) {
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 <= (-2.5d-5)) then
tmp = x
else if (x <= (-1.95d-155)) then
tmp = (-1.0d0) / x
else if (x <= 1.1d-261) then
tmp = y / 1.1283791670955126d0
else if (x <= 2d-21) 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 <= -2.5e-5) {
tmp = x;
} else if (x <= -1.95e-155) {
tmp = -1.0 / x;
} else if (x <= 1.1e-261) {
tmp = y / 1.1283791670955126;
} else if (x <= 2e-21) {
tmp = -1.0 / x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.5e-5: tmp = x elif x <= -1.95e-155: tmp = -1.0 / x elif x <= 1.1e-261: tmp = y / 1.1283791670955126 elif x <= 2e-21: tmp = -1.0 / x else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.5e-5) tmp = x; elseif (x <= -1.95e-155) tmp = Float64(-1.0 / x); elseif (x <= 1.1e-261) tmp = Float64(y / 1.1283791670955126); elseif (x <= 2e-21) tmp = Float64(-1.0 / x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.5e-5) tmp = x; elseif (x <= -1.95e-155) tmp = -1.0 / x; elseif (x <= 1.1e-261) tmp = y / 1.1283791670955126; elseif (x <= 2e-21) tmp = -1.0 / x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.5e-5], x, If[LessEqual[x, -1.95e-155], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 1.1e-261], N[(y / 1.1283791670955126), $MachinePrecision], If[LessEqual[x, 2e-21], N[(-1.0 / x), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{-5}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.95 \cdot 10^{-155}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-261}:\\
\;\;\;\;\frac{y}{1.1283791670955126}\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-21}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.50000000000000012e-5 or 1.99999999999999982e-21 < x Initial program 96.4%
Taylor expanded in x around inf 97.3%
if -2.50000000000000012e-5 < x < -1.9500000000000002e-155 or 1.1000000000000001e-261 < x < 1.99999999999999982e-21Initial program 94.3%
Taylor expanded in y around inf 60.0%
Taylor expanded in x around 0 59.6%
if -1.9500000000000002e-155 < x < 1.1000000000000001e-261Initial program 93.3%
remove-double-neg93.3%
distribute-frac-neg93.3%
unsub-neg93.3%
distribute-frac-neg93.3%
distribute-neg-frac293.3%
neg-sub093.1%
associate--r-93.1%
neg-sub093.5%
+-commutative93.5%
fma-define93.5%
*-commutative93.5%
distribute-rgt-neg-in93.5%
metadata-eval93.5%
Simplified93.5%
Taylor expanded in z around 0 52.8%
Taylor expanded in x around 0 42.6%
metadata-eval42.6%
distribute-lft-neg-in42.6%
*-commutative42.6%
metadata-eval43.0%
div-inv43.0%
distribute-neg-frac243.0%
metadata-eval43.0%
Applied egg-rr43.0%
(FPCore (x y z)
:precision binary64
(if (<= x -3.6e-5)
x
(if (<= x -1.82e-155)
(/ -1.0 x)
(if (<= x 2.7e-262)
(* y 0.8862269254527579)
(if (<= x 5e-25) (/ -1.0 x) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.6e-5) {
tmp = x;
} else if (x <= -1.82e-155) {
tmp = -1.0 / x;
} else if (x <= 2.7e-262) {
tmp = y * 0.8862269254527579;
} else if (x <= 5e-25) {
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 <= (-3.6d-5)) then
tmp = x
else if (x <= (-1.82d-155)) then
tmp = (-1.0d0) / x
else if (x <= 2.7d-262) then
tmp = y * 0.8862269254527579d0
else if (x <= 5d-25) 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 <= -3.6e-5) {
tmp = x;
} else if (x <= -1.82e-155) {
tmp = -1.0 / x;
} else if (x <= 2.7e-262) {
tmp = y * 0.8862269254527579;
} else if (x <= 5e-25) {
tmp = -1.0 / x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.6e-5: tmp = x elif x <= -1.82e-155: tmp = -1.0 / x elif x <= 2.7e-262: tmp = y * 0.8862269254527579 elif x <= 5e-25: tmp = -1.0 / x else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.6e-5) tmp = x; elseif (x <= -1.82e-155) tmp = Float64(-1.0 / x); elseif (x <= 2.7e-262) tmp = Float64(y * 0.8862269254527579); elseif (x <= 5e-25) tmp = Float64(-1.0 / x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.6e-5) tmp = x; elseif (x <= -1.82e-155) tmp = -1.0 / x; elseif (x <= 2.7e-262) tmp = y * 0.8862269254527579; elseif (x <= 5e-25) tmp = -1.0 / x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.6e-5], x, If[LessEqual[x, -1.82e-155], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 2.7e-262], N[(y * 0.8862269254527579), $MachinePrecision], If[LessEqual[x, 5e-25], N[(-1.0 / x), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{-5}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.82 \cdot 10^{-155}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-262}:\\
\;\;\;\;y \cdot 0.8862269254527579\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-25}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.60000000000000009e-5 or 4.99999999999999962e-25 < x Initial program 96.4%
Taylor expanded in x around inf 97.3%
if -3.60000000000000009e-5 < x < -1.82000000000000006e-155 or 2.7000000000000001e-262 < x < 4.99999999999999962e-25Initial program 94.3%
Taylor expanded in y around inf 60.0%
Taylor expanded in x around 0 59.6%
if -1.82000000000000006e-155 < x < 2.7000000000000001e-262Initial program 93.3%
remove-double-neg93.3%
distribute-frac-neg93.3%
unsub-neg93.3%
distribute-frac-neg93.3%
distribute-neg-frac293.3%
neg-sub093.1%
associate--r-93.1%
neg-sub093.5%
+-commutative93.5%
fma-define93.5%
*-commutative93.5%
distribute-rgt-neg-in93.5%
metadata-eval93.5%
Simplified93.5%
Taylor expanded in z around 0 52.8%
Taylor expanded in x around 0 42.6%
Final simplification77.5%
(FPCore (x y z)
:precision binary64
(if (<= z -3600000000000.0)
(- x (/ 1.0 x))
(if (<= z 0.27)
(+ x (/ y (- 1.1283791670955126 (+ (* x y) (* z -1.1283791670955126)))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3600000000000.0) {
tmp = x - (1.0 / x);
} else if (z <= 0.27) {
tmp = x + (y / (1.1283791670955126 - ((x * y) + (z * -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 <= (-3600000000000.0d0)) then
tmp = x - (1.0d0 / x)
else if (z <= 0.27d0) then
tmp = x + (y / (1.1283791670955126d0 - ((x * y) + (z * (-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 <= -3600000000000.0) {
tmp = x - (1.0 / x);
} else if (z <= 0.27) {
tmp = x + (y / (1.1283791670955126 - ((x * y) + (z * -1.1283791670955126))));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3600000000000.0: tmp = x - (1.0 / x) elif z <= 0.27: tmp = x + (y / (1.1283791670955126 - ((x * y) + (z * -1.1283791670955126)))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3600000000000.0) tmp = Float64(x - Float64(1.0 / x)); elseif (z <= 0.27) tmp = Float64(x + Float64(y / Float64(1.1283791670955126 - Float64(Float64(x * y) + Float64(z * -1.1283791670955126))))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3600000000000.0) tmp = x - (1.0 / x); elseif (z <= 0.27) tmp = x + (y / (1.1283791670955126 - ((x * y) + (z * -1.1283791670955126)))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3600000000000.0], N[(x - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.27], N[(x + N[(y / N[(1.1283791670955126 - N[(N[(x * y), $MachinePrecision] + N[(z * -1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3600000000000:\\
\;\;\;\;x - \frac{1}{x}\\
\mathbf{elif}\;z \leq 0.27:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 - \left(x \cdot y + z \cdot -1.1283791670955126\right)}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.6e12Initial program 89.2%
Taylor expanded in y around inf 100.0%
if -3.6e12 < z < 0.27000000000000002Initial program 99.9%
remove-double-neg99.9%
distribute-frac-neg99.9%
unsub-neg99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
fma-define99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 99.0%
if 0.27000000000000002 < z Initial program 90.9%
Taylor expanded in x around inf 100.0%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (<= z -3600000000000.0) (- x (/ 1.0 x)) (if (<= z 0.27) (+ x (/ y (- 1.1283791670955126 (* x y)))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3600000000000.0) {
tmp = x - (1.0 / x);
} else if (z <= 0.27) {
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 <= (-3600000000000.0d0)) then
tmp = x - (1.0d0 / x)
else if (z <= 0.27d0) 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 <= -3600000000000.0) {
tmp = x - (1.0 / x);
} else if (z <= 0.27) {
tmp = x + (y / (1.1283791670955126 - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3600000000000.0: tmp = x - (1.0 / x) elif z <= 0.27: tmp = x + (y / (1.1283791670955126 - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3600000000000.0) tmp = Float64(x - Float64(1.0 / x)); elseif (z <= 0.27) 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 <= -3600000000000.0) tmp = x - (1.0 / x); elseif (z <= 0.27) tmp = x + (y / (1.1283791670955126 - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3600000000000.0], N[(x - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.27], 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 -3600000000000:\\
\;\;\;\;x - \frac{1}{x}\\
\mathbf{elif}\;z \leq 0.27:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.6e12Initial program 89.2%
Taylor expanded in y around inf 100.0%
if -3.6e12 < z < 0.27000000000000002Initial program 99.9%
remove-double-neg99.9%
distribute-frac-neg99.9%
unsub-neg99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
fma-define99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 98.7%
if 0.27000000000000002 < z Initial program 90.9%
Taylor expanded in x around inf 100.0%
Final simplification99.3%
(FPCore (x y z) :precision binary64 (if (<= z -1.45e-192) (- x (/ 1.0 x)) (if (<= z 0.082) (- x (* (* y 0.8862269254527579) (+ z -1.0))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.45e-192) {
tmp = x - (1.0 / x);
} else if (z <= 0.082) {
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 <= (-1.45d-192)) then
tmp = x - (1.0d0 / x)
else if (z <= 0.082d0) 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 <= -1.45e-192) {
tmp = x - (1.0 / x);
} else if (z <= 0.082) {
tmp = x - ((y * 0.8862269254527579) * (z + -1.0));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.45e-192: tmp = x - (1.0 / x) elif z <= 0.082: tmp = x - ((y * 0.8862269254527579) * (z + -1.0)) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.45e-192) tmp = Float64(x - Float64(1.0 / x)); elseif (z <= 0.082) 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 <= -1.45e-192) tmp = x - (1.0 / x); elseif (z <= 0.082) tmp = x - ((y * 0.8862269254527579) * (z + -1.0)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.45e-192], N[(x - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.082], 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 -1.45 \cdot 10^{-192}:\\
\;\;\;\;x - \frac{1}{x}\\
\mathbf{elif}\;z \leq 0.082:\\
\;\;\;\;x - \left(y \cdot 0.8862269254527579\right) \cdot \left(z + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.45000000000000008e-192Initial program 93.8%
Taylor expanded in y around inf 94.8%
if -1.45000000000000008e-192 < z < 0.0820000000000000034Initial 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 y around 0 77.2%
associate-*r/77.2%
Simplified77.2%
Taylor expanded in z around 0 76.5%
*-commutative76.5%
Simplified76.5%
Taylor expanded in z around 0 76.4%
metadata-eval76.4%
associate-*r*76.4%
*-commutative76.4%
associate-*r*76.4%
distribute-lft-out76.4%
*-commutative76.4%
Simplified76.4%
if 0.0820000000000000034 < z Initial program 90.9%
Taylor expanded in x around inf 100.0%
Final simplification89.4%
(FPCore (x y z) :precision binary64 (if (<= z -2.05e-190) (- x (/ 1.0 x)) (if (<= z 0.055) (- x (/ y -1.1283791670955126)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.05e-190) {
tmp = x - (1.0 / x);
} else if (z <= 0.055) {
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 <= (-2.05d-190)) then
tmp = x - (1.0d0 / x)
else if (z <= 0.055d0) 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 <= -2.05e-190) {
tmp = x - (1.0 / x);
} else if (z <= 0.055) {
tmp = x - (y / -1.1283791670955126);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.05e-190: tmp = x - (1.0 / x) elif z <= 0.055: tmp = x - (y / -1.1283791670955126) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.05e-190) tmp = Float64(x - Float64(1.0 / x)); elseif (z <= 0.055) 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 <= -2.05e-190) tmp = x - (1.0 / x); elseif (z <= 0.055) tmp = x - (y / -1.1283791670955126); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.05e-190], N[(x - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.055], N[(x - N[(y / -1.1283791670955126), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{-190}:\\
\;\;\;\;x - \frac{1}{x}\\
\mathbf{elif}\;z \leq 0.055:\\
\;\;\;\;x - \frac{y}{-1.1283791670955126}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.0500000000000001e-190Initial program 93.8%
Taylor expanded in y around inf 94.8%
if -2.0500000000000001e-190 < z < 0.0550000000000000003Initial 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.8%
Taylor expanded in x around 0 76.3%
if 0.0550000000000000003 < z Initial program 90.9%
Taylor expanded in x around inf 100.0%
(FPCore (x y z) :precision binary64 (if (<= z -2.4e-184) (- x (/ 1.0 x)) (if (<= z 0.05) (- x (* y -0.8862269254527579)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.4e-184) {
tmp = x - (1.0 / x);
} else if (z <= 0.05) {
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.4d-184)) then
tmp = x - (1.0d0 / x)
else if (z <= 0.05d0) 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.4e-184) {
tmp = x - (1.0 / x);
} else if (z <= 0.05) {
tmp = x - (y * -0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.4e-184: tmp = x - (1.0 / x) elif z <= 0.05: tmp = x - (y * -0.8862269254527579) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.4e-184) tmp = Float64(x - Float64(1.0 / x)); elseif (z <= 0.05) 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.4e-184) tmp = x - (1.0 / x); elseif (z <= 0.05) tmp = x - (y * -0.8862269254527579); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.4e-184], N[(x - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.05], N[(x - N[(y * -0.8862269254527579), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-184}:\\
\;\;\;\;x - \frac{1}{x}\\
\mathbf{elif}\;z \leq 0.05:\\
\;\;\;\;x - y \cdot -0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.40000000000000024e-184Initial program 93.8%
Taylor expanded in y around inf 94.8%
if -2.40000000000000024e-184 < z < 0.050000000000000003Initial 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.8%
Taylor expanded in y around 0 76.1%
*-commutative76.1%
Simplified76.1%
if 0.050000000000000003 < z Initial program 90.9%
Taylor expanded in x around inf 100.0%
(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.3%
Taylor expanded in x around inf 67.3%
(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 2024165
(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)))))