
(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 13 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))
(if (<= (exp z) 1.01)
(+ x (/ y (- (+ 1.1283791670955126 (* z 1.1283791670955126)) (* 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.01) {
tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (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.01d0) then
tmp = x + (y / ((1.1283791670955126d0 + (z * 1.1283791670955126d0)) - (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.01) {
tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (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.01: tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (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.01) tmp = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 + Float64(z * 1.1283791670955126)) - 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.01) tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (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.01], N[(x + N[(y / N[(N[(1.1283791670955126 + N[(z * 1.1283791670955126), $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.01:\\
\;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot 1.1283791670955126\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 83.9%
Taylor expanded in x around inf 100.0%
if 0.0 < (exp.f64 z) < 1.01000000000000001Initial program 99.8%
Taylor expanded in z around 0 99.8%
*-commutative99.8%
Simplified99.8%
if 1.01000000000000001 < (exp.f64 z) Initial program 96.8%
remove-double-neg96.8%
neg-sub096.8%
associate-+l-96.8%
add096.8%
associate--l+96.8%
associate--r+96.8%
neg-sub096.8%
remove-double-neg96.8%
neg-sub096.8%
distribute-neg-frac296.8%
neg-sub096.8%
associate--r-96.8%
neg-sub096.8%
+-commutative96.8%
sub-neg96.8%
fma-neg100.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.9%
(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 83.9%
Taylor expanded in x around inf 100.0%
if 0.0 < (exp.f64 z) Initial program 98.8%
remove-double-neg98.8%
neg-sub098.8%
associate-+l-98.8%
add098.8%
associate--l+98.8%
associate--r+98.8%
neg-sub098.8%
remove-double-neg98.8%
neg-sub098.8%
distribute-neg-frac298.8%
neg-sub098.8%
associate--r-98.8%
neg-sub098.8%
+-commutative98.8%
sub-neg98.8%
fma-neg99.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) 10000.0)
(+ x (/ y (- (+ 1.1283791670955126 (* z 1.1283791670955126)) (* 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) <= 10000.0) {
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 (exp(z) <= 0.0d0) then
tmp = x + ((-1.0d0) / x)
else if (exp(z) <= 10000.0d0) 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 (Math.exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else if (Math.exp(z) <= 10000.0) {
tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (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) <= 10000.0: tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (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) <= 10000.0) 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 (exp(z) <= 0.0) tmp = x + (-1.0 / x); elseif (exp(z) <= 10000.0) tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (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], 10000.0], 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}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;e^{z} \leq 10000:\\
\;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot 1.1283791670955126\right) - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 83.9%
Taylor expanded in x around inf 100.0%
if 0.0 < (exp.f64 z) < 1e4Initial program 99.8%
Taylor expanded in z around 0 98.7%
*-commutative98.7%
Simplified98.7%
if 1e4 < (exp.f64 z) Initial program 96.7%
Taylor expanded in x around inf 100.0%
Final simplification99.3%
(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 83.9%
Taylor expanded in x around inf 100.0%
if 0.0 < (exp.f64 z) Initial program 98.8%
Final simplification99.1%
(FPCore (x y z)
:precision binary64
(if (<= x -1.25e-5)
x
(if (<= x -4e-62)
(/ -1.0 x)
(if (<= x -2.9e-187)
x
(if (<= x -8.6e-300)
(* y 0.8862269254527579)
(if (<= x 3.35e-305)
(/ -1.0 x)
(if (<= x 1.76e-214)
(* y 0.8862269254527579)
(if (<= x 1.35e-28) (/ -1.0 x) x))))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.25e-5) {
tmp = x;
} else if (x <= -4e-62) {
tmp = -1.0 / x;
} else if (x <= -2.9e-187) {
tmp = x;
} else if (x <= -8.6e-300) {
tmp = y * 0.8862269254527579;
} else if (x <= 3.35e-305) {
tmp = -1.0 / x;
} else if (x <= 1.76e-214) {
tmp = y * 0.8862269254527579;
} else if (x <= 1.35e-28) {
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.25d-5)) then
tmp = x
else if (x <= (-4d-62)) then
tmp = (-1.0d0) / x
else if (x <= (-2.9d-187)) then
tmp = x
else if (x <= (-8.6d-300)) then
tmp = y * 0.8862269254527579d0
else if (x <= 3.35d-305) then
tmp = (-1.0d0) / x
else if (x <= 1.76d-214) then
tmp = y * 0.8862269254527579d0
else if (x <= 1.35d-28) 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.25e-5) {
tmp = x;
} else if (x <= -4e-62) {
tmp = -1.0 / x;
} else if (x <= -2.9e-187) {
tmp = x;
} else if (x <= -8.6e-300) {
tmp = y * 0.8862269254527579;
} else if (x <= 3.35e-305) {
tmp = -1.0 / x;
} else if (x <= 1.76e-214) {
tmp = y * 0.8862269254527579;
} else if (x <= 1.35e-28) {
tmp = -1.0 / x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.25e-5: tmp = x elif x <= -4e-62: tmp = -1.0 / x elif x <= -2.9e-187: tmp = x elif x <= -8.6e-300: tmp = y * 0.8862269254527579 elif x <= 3.35e-305: tmp = -1.0 / x elif x <= 1.76e-214: tmp = y * 0.8862269254527579 elif x <= 1.35e-28: tmp = -1.0 / x else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.25e-5) tmp = x; elseif (x <= -4e-62) tmp = Float64(-1.0 / x); elseif (x <= -2.9e-187) tmp = x; elseif (x <= -8.6e-300) tmp = Float64(y * 0.8862269254527579); elseif (x <= 3.35e-305) tmp = Float64(-1.0 / x); elseif (x <= 1.76e-214) tmp = Float64(y * 0.8862269254527579); elseif (x <= 1.35e-28) 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.25e-5) tmp = x; elseif (x <= -4e-62) tmp = -1.0 / x; elseif (x <= -2.9e-187) tmp = x; elseif (x <= -8.6e-300) tmp = y * 0.8862269254527579; elseif (x <= 3.35e-305) tmp = -1.0 / x; elseif (x <= 1.76e-214) tmp = y * 0.8862269254527579; elseif (x <= 1.35e-28) tmp = -1.0 / x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.25e-5], x, If[LessEqual[x, -4e-62], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, -2.9e-187], x, If[LessEqual[x, -8.6e-300], N[(y * 0.8862269254527579), $MachinePrecision], If[LessEqual[x, 3.35e-305], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 1.76e-214], N[(y * 0.8862269254527579), $MachinePrecision], If[LessEqual[x, 1.35e-28], N[(-1.0 / x), $MachinePrecision], x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-5}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -4 \cdot 10^{-62}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-187}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -8.6 \cdot 10^{-300}:\\
\;\;\;\;y \cdot 0.8862269254527579\\
\mathbf{elif}\;x \leq 3.35 \cdot 10^{-305}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq 1.76 \cdot 10^{-214}:\\
\;\;\;\;y \cdot 0.8862269254527579\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-28}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.25000000000000006e-5 or -4.0000000000000002e-62 < x < -2.89999999999999988e-187 or 1.3499999999999999e-28 < x Initial program 98.5%
Taylor expanded in x around inf 90.3%
if -1.25000000000000006e-5 < x < -4.0000000000000002e-62 or -8.6000000000000001e-300 < x < 3.3500000000000002e-305 or 1.75999999999999997e-214 < x < 1.3499999999999999e-28Initial program 92.6%
Taylor expanded in x around inf 56.2%
Taylor expanded in x around 0 55.8%
if -2.89999999999999988e-187 < x < -8.6000000000000001e-300 or 3.3500000000000002e-305 < x < 1.75999999999999997e-214Initial program 91.6%
remove-double-neg91.6%
neg-sub091.6%
associate-+l-91.6%
add091.6%
associate--l+91.6%
associate--r+91.6%
neg-sub091.6%
remove-double-neg91.6%
neg-sub091.6%
distribute-neg-frac291.6%
neg-sub091.3%
associate--r-91.3%
neg-sub091.8%
+-commutative91.8%
sub-neg91.8%
fma-neg91.8%
*-commutative91.8%
distribute-rgt-neg-in91.8%
metadata-eval91.8%
Simplified91.8%
Taylor expanded in z around 0 64.5%
Taylor expanded in x around 0 55.8%
Final simplification74.0%
(FPCore (x y z)
:precision binary64
(if (<= x -2.5e-5)
x
(if (<= x -7e-63)
(/ -1.0 x)
(if (<= x -1.7e-186)
x
(if (<= x -7.6e-300)
(* y 0.8862269254527579)
(if (<= x 2.4e-308)
(/ -1.0 x)
(if (<= x 3.1e-214)
(/ y 1.1283791670955126)
(if (<= x 1e-27) (/ -1.0 x) x))))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.5e-5) {
tmp = x;
} else if (x <= -7e-63) {
tmp = -1.0 / x;
} else if (x <= -1.7e-186) {
tmp = x;
} else if (x <= -7.6e-300) {
tmp = y * 0.8862269254527579;
} else if (x <= 2.4e-308) {
tmp = -1.0 / x;
} else if (x <= 3.1e-214) {
tmp = y / 1.1283791670955126;
} else if (x <= 1e-27) {
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 <= (-7d-63)) then
tmp = (-1.0d0) / x
else if (x <= (-1.7d-186)) then
tmp = x
else if (x <= (-7.6d-300)) then
tmp = y * 0.8862269254527579d0
else if (x <= 2.4d-308) then
tmp = (-1.0d0) / x
else if (x <= 3.1d-214) then
tmp = y / 1.1283791670955126d0
else if (x <= 1d-27) 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 <= -7e-63) {
tmp = -1.0 / x;
} else if (x <= -1.7e-186) {
tmp = x;
} else if (x <= -7.6e-300) {
tmp = y * 0.8862269254527579;
} else if (x <= 2.4e-308) {
tmp = -1.0 / x;
} else if (x <= 3.1e-214) {
tmp = y / 1.1283791670955126;
} else if (x <= 1e-27) {
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 <= -7e-63: tmp = -1.0 / x elif x <= -1.7e-186: tmp = x elif x <= -7.6e-300: tmp = y * 0.8862269254527579 elif x <= 2.4e-308: tmp = -1.0 / x elif x <= 3.1e-214: tmp = y / 1.1283791670955126 elif x <= 1e-27: 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 <= -7e-63) tmp = Float64(-1.0 / x); elseif (x <= -1.7e-186) tmp = x; elseif (x <= -7.6e-300) tmp = Float64(y * 0.8862269254527579); elseif (x <= 2.4e-308) tmp = Float64(-1.0 / x); elseif (x <= 3.1e-214) tmp = Float64(y / 1.1283791670955126); elseif (x <= 1e-27) 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 <= -7e-63) tmp = -1.0 / x; elseif (x <= -1.7e-186) tmp = x; elseif (x <= -7.6e-300) tmp = y * 0.8862269254527579; elseif (x <= 2.4e-308) tmp = -1.0 / x; elseif (x <= 3.1e-214) tmp = y / 1.1283791670955126; elseif (x <= 1e-27) 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, -7e-63], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, -1.7e-186], x, If[LessEqual[x, -7.6e-300], N[(y * 0.8862269254527579), $MachinePrecision], If[LessEqual[x, 2.4e-308], N[(-1.0 / x), $MachinePrecision], If[LessEqual[x, 3.1e-214], N[(y / 1.1283791670955126), $MachinePrecision], If[LessEqual[x, 1e-27], 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 -7 \cdot 10^{-63}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{-186}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -7.6 \cdot 10^{-300}:\\
\;\;\;\;y \cdot 0.8862269254527579\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-308}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-214}:\\
\;\;\;\;\frac{y}{1.1283791670955126}\\
\mathbf{elif}\;x \leq 10^{-27}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.50000000000000012e-5 or -7.00000000000000006e-63 < x < -1.7e-186 or 1e-27 < x Initial program 98.5%
Taylor expanded in x around inf 90.3%
if -2.50000000000000012e-5 < x < -7.00000000000000006e-63 or -7.60000000000000026e-300 < x < 2.40000000000000008e-308 or 3.10000000000000004e-214 < x < 1e-27Initial program 92.6%
Taylor expanded in x around inf 56.2%
Taylor expanded in x around 0 55.8%
if -1.7e-186 < x < -7.60000000000000026e-300Initial program 91.7%
remove-double-neg91.7%
neg-sub091.7%
associate-+l-91.7%
add091.7%
associate--l+91.7%
associate--r+91.7%
neg-sub091.7%
remove-double-neg91.7%
neg-sub091.7%
distribute-neg-frac291.7%
neg-sub091.7%
associate--r-91.7%
neg-sub092.0%
+-commutative92.0%
sub-neg92.0%
fma-neg92.0%
*-commutative92.0%
distribute-rgt-neg-in92.0%
metadata-eval92.0%
Simplified92.0%
Taylor expanded in z around 0 55.5%
Taylor expanded in x around 0 48.5%
if 2.40000000000000008e-308 < x < 3.10000000000000004e-214Initial program 91.5%
remove-double-neg91.5%
neg-sub091.5%
associate-+l-91.5%
add091.5%
associate--l+91.5%
associate--r+91.5%
neg-sub091.5%
remove-double-neg91.5%
neg-sub091.5%
distribute-neg-frac291.5%
neg-sub090.8%
associate--r-90.8%
neg-sub091.5%
+-commutative91.5%
sub-neg91.5%
fma-neg91.5%
*-commutative91.5%
distribute-rgt-neg-in91.5%
metadata-eval91.5%
Simplified91.5%
Taylor expanded in z around 0 74.7%
Taylor expanded in x around 0 64.2%
*-commutative64.2%
metadata-eval64.2%
distribute-rgt-neg-in64.2%
metadata-eval64.6%
div-inv64.7%
distribute-neg-frac264.7%
metadata-eval64.7%
Applied egg-rr64.7%
Final simplification74.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (/ -1.0 x))) (t_1 (- x (/ y -1.1283791670955126))))
(if (<= z -5e-10)
t_0
(if (<= z -1.6e-203)
t_1
(if (<= z -9e-246)
t_0
(if (<= z 6e-135) t_1 (if (<= z 8e-32) t_0 x)))))))
double code(double x, double y, double z) {
double t_0 = x + (-1.0 / x);
double t_1 = x - (y / -1.1283791670955126);
double tmp;
if (z <= -5e-10) {
tmp = t_0;
} else if (z <= -1.6e-203) {
tmp = t_1;
} else if (z <= -9e-246) {
tmp = t_0;
} else if (z <= 6e-135) {
tmp = t_1;
} else if (z <= 8e-32) {
tmp = 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) :: t_1
real(8) :: tmp
t_0 = x + ((-1.0d0) / x)
t_1 = x - (y / (-1.1283791670955126d0))
if (z <= (-5d-10)) then
tmp = t_0
else if (z <= (-1.6d-203)) then
tmp = t_1
else if (z <= (-9d-246)) then
tmp = t_0
else if (z <= 6d-135) then
tmp = t_1
else if (z <= 8d-32) then
tmp = t_0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (-1.0 / x);
double t_1 = x - (y / -1.1283791670955126);
double tmp;
if (z <= -5e-10) {
tmp = t_0;
} else if (z <= -1.6e-203) {
tmp = t_1;
} else if (z <= -9e-246) {
tmp = t_0;
} else if (z <= 6e-135) {
tmp = t_1;
} else if (z <= 8e-32) {
tmp = t_0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): t_0 = x + (-1.0 / x) t_1 = x - (y / -1.1283791670955126) tmp = 0 if z <= -5e-10: tmp = t_0 elif z <= -1.6e-203: tmp = t_1 elif z <= -9e-246: tmp = t_0 elif z <= 6e-135: tmp = t_1 elif z <= 8e-32: tmp = t_0 else: tmp = x return tmp
function code(x, y, z) t_0 = Float64(x + Float64(-1.0 / x)) t_1 = Float64(x - Float64(y / -1.1283791670955126)) tmp = 0.0 if (z <= -5e-10) tmp = t_0; elseif (z <= -1.6e-203) tmp = t_1; elseif (z <= -9e-246) tmp = t_0; elseif (z <= 6e-135) tmp = t_1; elseif (z <= 8e-32) tmp = t_0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (-1.0 / x); t_1 = x - (y / -1.1283791670955126); tmp = 0.0; if (z <= -5e-10) tmp = t_0; elseif (z <= -1.6e-203) tmp = t_1; elseif (z <= -9e-246) tmp = t_0; elseif (z <= 6e-135) tmp = t_1; elseif (z <= 8e-32) tmp = t_0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x - N[(y / -1.1283791670955126), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e-10], t$95$0, If[LessEqual[z, -1.6e-203], t$95$1, If[LessEqual[z, -9e-246], t$95$0, If[LessEqual[z, 6e-135], t$95$1, If[LessEqual[z, 8e-32], t$95$0, x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{-1}{x}\\
t_1 := x - \frac{y}{-1.1283791670955126}\\
\mathbf{if}\;z \leq -5 \cdot 10^{-10}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-203}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-246}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-32}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.00000000000000031e-10 or -1.6e-203 < z < -8.99999999999999998e-246 or 6.00000000000000024e-135 < z < 8.00000000000000045e-32Initial program 89.8%
Taylor expanded in x around inf 93.7%
if -5.00000000000000031e-10 < z < -1.6e-203 or -8.99999999999999998e-246 < z < 6.00000000000000024e-135Initial program 99.8%
remove-double-neg99.8%
neg-sub099.8%
associate-+l-99.8%
add099.8%
associate--l+99.8%
associate--r+99.8%
neg-sub099.8%
remove-double-neg99.8%
neg-sub099.8%
distribute-neg-frac299.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
sub-neg99.8%
fma-neg99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.5%
Taylor expanded in x around 0 76.4%
if 8.00000000000000045e-32 < z Initial program 97.2%
Taylor expanded in x around inf 94.5%
Final simplification87.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (/ -1.0 x))))
(if (<= z -5.8e-12)
t_0
(if (<= z -1.95e-203)
(+ x (/ y (+ 1.1283791670955126 (* z 1.1283791670955126))))
(if (<= z -3.7e-246)
t_0
(if (<= z 6.5e-134)
(- x (/ y -1.1283791670955126))
(if (<= z 8.8e-32) t_0 x)))))))
double code(double x, double y, double z) {
double t_0 = x + (-1.0 / x);
double tmp;
if (z <= -5.8e-12) {
tmp = t_0;
} else if (z <= -1.95e-203) {
tmp = x + (y / (1.1283791670955126 + (z * 1.1283791670955126)));
} else if (z <= -3.7e-246) {
tmp = t_0;
} else if (z <= 6.5e-134) {
tmp = x - (y / -1.1283791670955126);
} else if (z <= 8.8e-32) {
tmp = 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 = x + ((-1.0d0) / x)
if (z <= (-5.8d-12)) then
tmp = t_0
else if (z <= (-1.95d-203)) then
tmp = x + (y / (1.1283791670955126d0 + (z * 1.1283791670955126d0)))
else if (z <= (-3.7d-246)) then
tmp = t_0
else if (z <= 6.5d-134) then
tmp = x - (y / (-1.1283791670955126d0))
else if (z <= 8.8d-32) then
tmp = t_0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (-1.0 / x);
double tmp;
if (z <= -5.8e-12) {
tmp = t_0;
} else if (z <= -1.95e-203) {
tmp = x + (y / (1.1283791670955126 + (z * 1.1283791670955126)));
} else if (z <= -3.7e-246) {
tmp = t_0;
} else if (z <= 6.5e-134) {
tmp = x - (y / -1.1283791670955126);
} else if (z <= 8.8e-32) {
tmp = t_0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): t_0 = x + (-1.0 / x) tmp = 0 if z <= -5.8e-12: tmp = t_0 elif z <= -1.95e-203: tmp = x + (y / (1.1283791670955126 + (z * 1.1283791670955126))) elif z <= -3.7e-246: tmp = t_0 elif z <= 6.5e-134: tmp = x - (y / -1.1283791670955126) elif z <= 8.8e-32: tmp = t_0 else: tmp = x return tmp
function code(x, y, z) t_0 = Float64(x + Float64(-1.0 / x)) tmp = 0.0 if (z <= -5.8e-12) tmp = t_0; elseif (z <= -1.95e-203) tmp = Float64(x + Float64(y / Float64(1.1283791670955126 + Float64(z * 1.1283791670955126)))); elseif (z <= -3.7e-246) tmp = t_0; elseif (z <= 6.5e-134) tmp = Float64(x - Float64(y / -1.1283791670955126)); elseif (z <= 8.8e-32) tmp = t_0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (-1.0 / x); tmp = 0.0; if (z <= -5.8e-12) tmp = t_0; elseif (z <= -1.95e-203) tmp = x + (y / (1.1283791670955126 + (z * 1.1283791670955126))); elseif (z <= -3.7e-246) tmp = t_0; elseif (z <= 6.5e-134) tmp = x - (y / -1.1283791670955126); elseif (z <= 8.8e-32) tmp = t_0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.8e-12], t$95$0, If[LessEqual[z, -1.95e-203], N[(x + N[(y / N[(1.1283791670955126 + N[(z * 1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.7e-246], t$95$0, If[LessEqual[z, 6.5e-134], N[(x - N[(y / -1.1283791670955126), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e-32], t$95$0, x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{-1}{x}\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{-12}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-203}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 + z \cdot 1.1283791670955126}\\
\mathbf{elif}\;z \leq -3.7 \cdot 10^{-246}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-134}:\\
\;\;\;\;x - \frac{y}{-1.1283791670955126}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-32}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.8000000000000003e-12 or -1.95e-203 < z < -3.7e-246 or 6.4999999999999998e-134 < z < 8.7999999999999999e-32Initial program 89.8%
Taylor expanded in x around inf 93.7%
if -5.8000000000000003e-12 < z < -1.95e-203Initial program 99.7%
Taylor expanded in z around 0 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around 0 81.2%
if -3.7e-246 < z < 6.4999999999999998e-134Initial program 99.9%
remove-double-neg99.9%
neg-sub099.9%
associate-+l-99.9%
add099.9%
associate--l+99.9%
associate--r+99.9%
neg-sub099.9%
remove-double-neg99.9%
neg-sub099.9%
distribute-neg-frac299.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
sub-neg99.9%
fma-neg99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around 0 73.7%
if 8.7999999999999999e-32 < z Initial program 97.2%
Taylor expanded in x around inf 94.5%
Final simplification87.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (/ -1.0 x))))
(if (<= z -2.85e-7)
t_0
(if (<= z -6e-204)
(+ x (* -0.8862269254527579 (- (* z y) y)))
(if (<= z -1.8e-247)
t_0
(if (<= z 2.4e-133)
(- x (/ y -1.1283791670955126))
(if (<= z 2.35e-31) t_0 x)))))))
double code(double x, double y, double z) {
double t_0 = x + (-1.0 / x);
double tmp;
if (z <= -2.85e-7) {
tmp = t_0;
} else if (z <= -6e-204) {
tmp = x + (-0.8862269254527579 * ((z * y) - y));
} else if (z <= -1.8e-247) {
tmp = t_0;
} else if (z <= 2.4e-133) {
tmp = x - (y / -1.1283791670955126);
} else if (z <= 2.35e-31) {
tmp = 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 = x + ((-1.0d0) / x)
if (z <= (-2.85d-7)) then
tmp = t_0
else if (z <= (-6d-204)) then
tmp = x + ((-0.8862269254527579d0) * ((z * y) - y))
else if (z <= (-1.8d-247)) then
tmp = t_0
else if (z <= 2.4d-133) then
tmp = x - (y / (-1.1283791670955126d0))
else if (z <= 2.35d-31) then
tmp = t_0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (-1.0 / x);
double tmp;
if (z <= -2.85e-7) {
tmp = t_0;
} else if (z <= -6e-204) {
tmp = x + (-0.8862269254527579 * ((z * y) - y));
} else if (z <= -1.8e-247) {
tmp = t_0;
} else if (z <= 2.4e-133) {
tmp = x - (y / -1.1283791670955126);
} else if (z <= 2.35e-31) {
tmp = t_0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): t_0 = x + (-1.0 / x) tmp = 0 if z <= -2.85e-7: tmp = t_0 elif z <= -6e-204: tmp = x + (-0.8862269254527579 * ((z * y) - y)) elif z <= -1.8e-247: tmp = t_0 elif z <= 2.4e-133: tmp = x - (y / -1.1283791670955126) elif z <= 2.35e-31: tmp = t_0 else: tmp = x return tmp
function code(x, y, z) t_0 = Float64(x + Float64(-1.0 / x)) tmp = 0.0 if (z <= -2.85e-7) tmp = t_0; elseif (z <= -6e-204) tmp = Float64(x + Float64(-0.8862269254527579 * Float64(Float64(z * y) - y))); elseif (z <= -1.8e-247) tmp = t_0; elseif (z <= 2.4e-133) tmp = Float64(x - Float64(y / -1.1283791670955126)); elseif (z <= 2.35e-31) tmp = t_0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (-1.0 / x); tmp = 0.0; if (z <= -2.85e-7) tmp = t_0; elseif (z <= -6e-204) tmp = x + (-0.8862269254527579 * ((z * y) - y)); elseif (z <= -1.8e-247) tmp = t_0; elseif (z <= 2.4e-133) tmp = x - (y / -1.1283791670955126); elseif (z <= 2.35e-31) tmp = t_0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.85e-7], t$95$0, If[LessEqual[z, -6e-204], N[(x + N[(-0.8862269254527579 * N[(N[(z * y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.8e-247], t$95$0, If[LessEqual[z, 2.4e-133], N[(x - N[(y / -1.1283791670955126), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.35e-31], t$95$0, x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{-1}{x}\\
\mathbf{if}\;z \leq -2.85 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-204}:\\
\;\;\;\;x + -0.8862269254527579 \cdot \left(z \cdot y - y\right)\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-247}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-133}:\\
\;\;\;\;x - \frac{y}{-1.1283791670955126}\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-31}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.8500000000000002e-7 or -5.9999999999999997e-204 < z < -1.7999999999999998e-247 or 2.4e-133 < z < 2.34999999999999993e-31Initial program 89.8%
Taylor expanded in x around inf 93.7%
if -2.8500000000000002e-7 < z < -5.9999999999999997e-204Initial program 99.7%
remove-double-neg99.7%
neg-sub099.7%
associate-+l-99.7%
add099.7%
associate--l+99.7%
associate--r+99.7%
neg-sub099.7%
remove-double-neg99.7%
neg-sub099.7%
distribute-neg-frac299.7%
neg-sub099.7%
associate--r-99.7%
neg-sub099.7%
+-commutative99.7%
sub-neg99.7%
fma-neg99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in z around 0 81.4%
mul-1-neg81.4%
unsub-neg81.4%
Simplified81.4%
if -1.7999999999999998e-247 < z < 2.4e-133Initial program 99.9%
remove-double-neg99.9%
neg-sub099.9%
associate-+l-99.9%
add099.9%
associate--l+99.9%
associate--r+99.9%
neg-sub099.9%
remove-double-neg99.9%
neg-sub099.9%
distribute-neg-frac299.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
sub-neg99.9%
fma-neg99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in x around 0 73.7%
if 2.34999999999999993e-31 < z Initial program 97.2%
Taylor expanded in x around inf 94.5%
Final simplification87.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (/ -1.0 x))))
(if (<= z 6.2e-279)
t_0
(if (<= z 3e-256) (* y 0.8862269254527579) (if (<= z 2.75e-30) t_0 x)))))
double code(double x, double y, double z) {
double t_0 = x + (-1.0 / x);
double tmp;
if (z <= 6.2e-279) {
tmp = t_0;
} else if (z <= 3e-256) {
tmp = y * 0.8862269254527579;
} else if (z <= 2.75e-30) {
tmp = 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 = x + ((-1.0d0) / x)
if (z <= 6.2d-279) then
tmp = t_0
else if (z <= 3d-256) then
tmp = y * 0.8862269254527579d0
else if (z <= 2.75d-30) then
tmp = t_0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (-1.0 / x);
double tmp;
if (z <= 6.2e-279) {
tmp = t_0;
} else if (z <= 3e-256) {
tmp = y * 0.8862269254527579;
} else if (z <= 2.75e-30) {
tmp = t_0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): t_0 = x + (-1.0 / x) tmp = 0 if z <= 6.2e-279: tmp = t_0 elif z <= 3e-256: tmp = y * 0.8862269254527579 elif z <= 2.75e-30: tmp = t_0 else: tmp = x return tmp
function code(x, y, z) t_0 = Float64(x + Float64(-1.0 / x)) tmp = 0.0 if (z <= 6.2e-279) tmp = t_0; elseif (z <= 3e-256) tmp = Float64(y * 0.8862269254527579); elseif (z <= 2.75e-30) tmp = t_0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (-1.0 / x); tmp = 0.0; if (z <= 6.2e-279) tmp = t_0; elseif (z <= 3e-256) tmp = y * 0.8862269254527579; elseif (z <= 2.75e-30) tmp = t_0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 6.2e-279], t$95$0, If[LessEqual[z, 3e-256], N[(y * 0.8862269254527579), $MachinePrecision], If[LessEqual[z, 2.75e-30], t$95$0, x]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{-1}{x}\\
\mathbf{if}\;z \leq 6.2 \cdot 10^{-279}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-256}:\\
\;\;\;\;y \cdot 0.8862269254527579\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{-30}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < 6.1999999999999998e-279 or 2.9999999999999998e-256 < z < 2.74999999999999988e-30Initial program 94.8%
Taylor expanded in x around inf 73.5%
if 6.1999999999999998e-279 < z < 2.9999999999999998e-256Initial program 99.7%
remove-double-neg99.7%
neg-sub099.7%
associate-+l-99.7%
add099.7%
associate--l+99.7%
associate--r+99.7%
neg-sub099.7%
remove-double-neg99.7%
neg-sub099.7%
distribute-neg-frac299.7%
neg-sub099.7%
associate--r-99.7%
neg-sub099.7%
+-commutative99.7%
sub-neg99.7%
fma-neg99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around 0 99.7%
if 2.74999999999999988e-30 < z Initial program 97.2%
Taylor expanded in x around inf 94.5%
Final simplification79.8%
(FPCore (x y z) :precision binary64 (if (<= z -150.0) (+ x (/ -1.0 x)) (if (<= z 215.0) (+ x (/ y (- 1.1283791670955126 (* x y)))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -150.0) {
tmp = x + (-1.0 / x);
} else if (z <= 215.0) {
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 <= (-150.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 215.0d0) 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 <= -150.0) {
tmp = x + (-1.0 / x);
} else if (z <= 215.0) {
tmp = x + (y / (1.1283791670955126 - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -150.0: tmp = x + (-1.0 / x) elif z <= 215.0: tmp = x + (y / (1.1283791670955126 - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -150.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 215.0) 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 <= -150.0) tmp = x + (-1.0 / x); elseif (z <= 215.0) tmp = x + (y / (1.1283791670955126 - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -150.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 215.0], 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 -150:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 215:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -150Initial program 83.9%
Taylor expanded in x around inf 100.0%
if -150 < z < 215Initial program 99.8%
remove-double-neg99.8%
neg-sub099.8%
associate-+l-99.8%
add099.8%
associate--l+99.8%
associate--r+99.8%
neg-sub099.8%
remove-double-neg99.8%
neg-sub099.8%
distribute-neg-frac299.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
sub-neg99.8%
fma-neg99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 98.2%
if 215 < z Initial program 96.7%
Taylor expanded in x around inf 100.0%
Final simplification99.0%
(FPCore (x y z) :precision binary64 (if (<= x -4.6e-187) x (if (<= x 2.45e-213) (* y 0.8862269254527579) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.6e-187) {
tmp = x;
} else if (x <= 2.45e-213) {
tmp = 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 (x <= (-4.6d-187)) then
tmp = x
else if (x <= 2.45d-213) then
tmp = 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 (x <= -4.6e-187) {
tmp = x;
} else if (x <= 2.45e-213) {
tmp = y * 0.8862269254527579;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.6e-187: tmp = x elif x <= 2.45e-213: tmp = y * 0.8862269254527579 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.6e-187) tmp = x; elseif (x <= 2.45e-213) tmp = Float64(y * 0.8862269254527579); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.6e-187) tmp = x; elseif (x <= 2.45e-213) tmp = y * 0.8862269254527579; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.6e-187], x, If[LessEqual[x, 2.45e-213], N[(y * 0.8862269254527579), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{-187}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.45 \cdot 10^{-213}:\\
\;\;\;\;y \cdot 0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.59999999999999996e-187 or 2.4499999999999999e-213 < x Initial program 97.6%
Taylor expanded in x around inf 71.8%
if -4.59999999999999996e-187 < x < 2.4499999999999999e-213Initial program 88.2%
remove-double-neg88.2%
neg-sub088.2%
associate-+l-88.2%
add088.2%
associate--l+88.2%
associate--r+88.2%
neg-sub088.2%
remove-double-neg88.2%
neg-sub088.2%
distribute-neg-frac288.2%
neg-sub087.5%
associate--r-87.5%
neg-sub088.5%
+-commutative88.5%
sub-neg88.5%
fma-neg88.5%
*-commutative88.5%
distribute-rgt-neg-in88.5%
metadata-eval88.5%
Simplified88.5%
Taylor expanded in z around 0 58.0%
Taylor expanded in x around 0 49.1%
Final simplification66.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 60.4%
Final simplification60.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 2024046
(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)))))