
(FPCore (x y) :precision binary64 (/ (exp (* x (log (/ x (+ x y))))) x))
double code(double x, double y) {
return exp((x * log((x / (x + y))))) / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = exp((x * log((x / (x + y))))) / x
end function
public static double code(double x, double y) {
return Math.exp((x * Math.log((x / (x + y))))) / x;
}
def code(x, y): return math.exp((x * math.log((x / (x + y))))) / x
function code(x, y) return Float64(exp(Float64(x * log(Float64(x / Float64(x + y))))) / x) end
function tmp = code(x, y) tmp = exp((x * log((x / (x + y))))) / x; end
code[x_, y_] := N[(N[Exp[N[(x * N[Log[N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (exp (* x (log (/ x (+ x y))))) x))
double code(double x, double y) {
return exp((x * log((x / (x + y))))) / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = exp((x * log((x / (x + y))))) / x
end function
public static double code(double x, double y) {
return Math.exp((x * Math.log((x / (x + y))))) / x;
}
def code(x, y): return math.exp((x * math.log((x / (x + y))))) / x
function code(x, y) return Float64(exp(Float64(x * log(Float64(x / Float64(x + y))))) / x) end
function tmp = code(x, y) tmp = exp((x * log((x / (x + y))))) / x; end
code[x_, y_] := N[(N[Exp[N[(x * N[Log[N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\end{array}
(FPCore (x y) :precision binary64 (if (or (<= x -6e+44) (not (<= x 5.0))) (/ (exp (- y)) x) (/ (pow (exp x) (log (/ x (+ x y)))) x)))
double code(double x, double y) {
double tmp;
if ((x <= -6e+44) || !(x <= 5.0)) {
tmp = exp(-y) / x;
} else {
tmp = pow(exp(x), log((x / (x + y)))) / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-6d+44)) .or. (.not. (x <= 5.0d0))) then
tmp = exp(-y) / x
else
tmp = (exp(x) ** log((x / (x + y)))) / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -6e+44) || !(x <= 5.0)) {
tmp = Math.exp(-y) / x;
} else {
tmp = Math.pow(Math.exp(x), Math.log((x / (x + y)))) / x;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -6e+44) or not (x <= 5.0): tmp = math.exp(-y) / x else: tmp = math.pow(math.exp(x), math.log((x / (x + y)))) / x return tmp
function code(x, y) tmp = 0.0 if ((x <= -6e+44) || !(x <= 5.0)) tmp = Float64(exp(Float64(-y)) / x); else tmp = Float64((exp(x) ^ log(Float64(x / Float64(x + y)))) / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -6e+44) || ~((x <= 5.0))) tmp = exp(-y) / x; else tmp = (exp(x) ^ log((x / (x + y)))) / x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -6e+44], N[Not[LessEqual[x, 5.0]], $MachinePrecision]], N[(N[Exp[(-y)], $MachinePrecision] / x), $MachinePrecision], N[(N[Power[N[Exp[x], $MachinePrecision], N[Log[N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{+44} \lor \neg \left(x \leq 5\right):\\
\;\;\;\;\frac{e^{-y}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(e^{x}\right)}^{\log \left(\frac{x}{x + y}\right)}}{x}\\
\end{array}
\end{array}
if x < -5.99999999999999974e44 or 5 < x Initial program 72.7%
*-commutative72.7%
exp-to-pow72.7%
Simplified72.7%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
if -5.99999999999999974e44 < x < 5Initial program 84.5%
exp-prod99.7%
Simplified99.7%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (or (<= x -650000.0) (not (<= x 0.65))) (/ (exp (- y)) x) (/ 1.0 x)))
double code(double x, double y) {
double tmp;
if ((x <= -650000.0) || !(x <= 0.65)) {
tmp = exp(-y) / x;
} else {
tmp = 1.0 / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-650000.0d0)) .or. (.not. (x <= 0.65d0))) then
tmp = exp(-y) / x
else
tmp = 1.0d0 / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -650000.0) || !(x <= 0.65)) {
tmp = Math.exp(-y) / x;
} else {
tmp = 1.0 / x;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -650000.0) or not (x <= 0.65): tmp = math.exp(-y) / x else: tmp = 1.0 / x return tmp
function code(x, y) tmp = 0.0 if ((x <= -650000.0) || !(x <= 0.65)) tmp = Float64(exp(Float64(-y)) / x); else tmp = Float64(1.0 / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -650000.0) || ~((x <= 0.65))) tmp = exp(-y) / x; else tmp = 1.0 / x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -650000.0], N[Not[LessEqual[x, 0.65]], $MachinePrecision]], N[(N[Exp[(-y)], $MachinePrecision] / x), $MachinePrecision], N[(1.0 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -650000 \lor \neg \left(x \leq 0.65\right):\\
\;\;\;\;\frac{e^{-y}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x}\\
\end{array}
\end{array}
if x < -6.5e5 or 0.650000000000000022 < x Initial program 74.4%
*-commutative74.4%
exp-to-pow74.4%
Simplified74.4%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
if -6.5e5 < x < 0.650000000000000022Initial program 83.3%
exp-prod99.7%
Simplified99.7%
Taylor expanded in x around 0 99.0%
Final simplification99.5%
(FPCore (x y)
:precision binary64
(if (<= x -1.6e+145)
(/ 1.0 (+ x (* y (+ x (* y (- x (* x (- 0.5 (* 0.5 (/ -1.0 x))))))))))
(if (<= x -650000.0)
(+
(/ 1.0 x)
(*
y
(+ (* y (- (* -0.16666666666666666 (/ y x)) (/ -0.5 x))) (/ -1.0 x))))
(if (<= x 3.8e+41)
(/ 1.0 x)
(/ 1.0 (+ x (* y (+ x (* y (+ x (* x y)))))))))))
double code(double x, double y) {
double tmp;
if (x <= -1.6e+145) {
tmp = 1.0 / (x + (y * (x + (y * (x - (x * (0.5 - (0.5 * (-1.0 / x)))))))));
} else if (x <= -650000.0) {
tmp = (1.0 / x) + (y * ((y * ((-0.16666666666666666 * (y / x)) - (-0.5 / x))) + (-1.0 / x)));
} else if (x <= 3.8e+41) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x + (y * (x + (y * (x + (x * y))))));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.6d+145)) then
tmp = 1.0d0 / (x + (y * (x + (y * (x - (x * (0.5d0 - (0.5d0 * ((-1.0d0) / x)))))))))
else if (x <= (-650000.0d0)) then
tmp = (1.0d0 / x) + (y * ((y * (((-0.16666666666666666d0) * (y / x)) - ((-0.5d0) / x))) + ((-1.0d0) / x)))
else if (x <= 3.8d+41) then
tmp = 1.0d0 / x
else
tmp = 1.0d0 / (x + (y * (x + (y * (x + (x * y))))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.6e+145) {
tmp = 1.0 / (x + (y * (x + (y * (x - (x * (0.5 - (0.5 * (-1.0 / x)))))))));
} else if (x <= -650000.0) {
tmp = (1.0 / x) + (y * ((y * ((-0.16666666666666666 * (y / x)) - (-0.5 / x))) + (-1.0 / x)));
} else if (x <= 3.8e+41) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x + (y * (x + (y * (x + (x * y))))));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.6e+145: tmp = 1.0 / (x + (y * (x + (y * (x - (x * (0.5 - (0.5 * (-1.0 / x))))))))) elif x <= -650000.0: tmp = (1.0 / x) + (y * ((y * ((-0.16666666666666666 * (y / x)) - (-0.5 / x))) + (-1.0 / x))) elif x <= 3.8e+41: tmp = 1.0 / x else: tmp = 1.0 / (x + (y * (x + (y * (x + (x * y)))))) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.6e+145) tmp = Float64(1.0 / Float64(x + Float64(y * Float64(x + Float64(y * Float64(x - Float64(x * Float64(0.5 - Float64(0.5 * Float64(-1.0 / x)))))))))); elseif (x <= -650000.0) tmp = Float64(Float64(1.0 / x) + Float64(y * Float64(Float64(y * Float64(Float64(-0.16666666666666666 * Float64(y / x)) - Float64(-0.5 / x))) + Float64(-1.0 / x)))); elseif (x <= 3.8e+41) tmp = Float64(1.0 / x); else tmp = Float64(1.0 / Float64(x + Float64(y * Float64(x + Float64(y * Float64(x + Float64(x * y))))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.6e+145) tmp = 1.0 / (x + (y * (x + (y * (x - (x * (0.5 - (0.5 * (-1.0 / x))))))))); elseif (x <= -650000.0) tmp = (1.0 / x) + (y * ((y * ((-0.16666666666666666 * (y / x)) - (-0.5 / x))) + (-1.0 / x))); elseif (x <= 3.8e+41) tmp = 1.0 / x; else tmp = 1.0 / (x + (y * (x + (y * (x + (x * y)))))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.6e+145], N[(1.0 / N[(x + N[(y * N[(x + N[(y * N[(x - N[(x * N[(0.5 - N[(0.5 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -650000.0], N[(N[(1.0 / x), $MachinePrecision] + N[(y * N[(N[(y * N[(N[(-0.16666666666666666 * N[(y / x), $MachinePrecision]), $MachinePrecision] - N[(-0.5 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.8e+41], N[(1.0 / x), $MachinePrecision], N[(1.0 / N[(x + N[(y * N[(x + N[(y * N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{+145}:\\
\;\;\;\;\frac{1}{x + y \cdot \left(x + y \cdot \left(x - x \cdot \left(0.5 - 0.5 \cdot \frac{-1}{x}\right)\right)\right)}\\
\mathbf{elif}\;x \leq -650000:\\
\;\;\;\;\frac{1}{x} + y \cdot \left(y \cdot \left(-0.16666666666666666 \cdot \frac{y}{x} - \frac{-0.5}{x}\right) + \frac{-1}{x}\right)\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+41}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x + y \cdot \left(x + y \cdot \left(x + x \cdot y\right)\right)}\\
\end{array}
\end{array}
if x < -1.60000000000000004e145Initial program 62.1%
exp-prod62.1%
Simplified62.1%
clear-num62.1%
add-exp-log0.0%
add-exp-log0.0%
div-exp0.0%
pow-exp0.0%
add-log-exp0.0%
log-pow0.0%
div-exp0.0%
add-exp-log62.1%
add-exp-log62.1%
inv-pow62.1%
Applied egg-rr62.1%
unpow-162.1%
Simplified62.1%
Taylor expanded in y around 0 83.2%
if -1.60000000000000004e145 < x < -6.5e5Initial program 85.5%
*-commutative85.5%
exp-to-pow85.5%
Simplified85.5%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 81.2%
un-div-inv81.2%
frac-2neg81.2%
metadata-eval81.2%
Applied egg-rr81.2%
if -6.5e5 < x < 3.8000000000000001e41Initial program 83.2%
exp-prod98.9%
Simplified98.9%
Taylor expanded in x around 0 98.2%
if 3.8000000000000001e41 < x Initial program 76.4%
exp-prod76.4%
Simplified76.4%
Taylor expanded in x around inf 53.9%
mul-1-neg53.9%
unsub-neg53.9%
Simplified53.9%
Taylor expanded in y around inf 53.8%
clear-num53.8%
inv-pow53.8%
sub-neg53.8%
metadata-eval53.8%
Applied egg-rr53.8%
unpow-153.8%
distribute-lft-in53.8%
*-commutative53.8%
rgt-mult-inverse53.9%
mul-1-neg53.9%
unsub-neg53.9%
Simplified53.9%
Taylor expanded in y around 0 84.0%
neg-mul-184.0%
neg-mul-184.0%
Simplified84.0%
Final simplification90.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (* y (+ x (* x y))))))
(if (<= x -3.2e+146)
(/ 1.0 t_0)
(if (<= x -650000.0)
(+
(/ 1.0 x)
(*
y
(+ (* y (- (* -0.16666666666666666 (/ y x)) (/ -0.5 x))) (/ -1.0 x))))
(if (<= x 2.9e+41) (/ 1.0 x) (/ 1.0 (+ x (* y t_0))))))))
double code(double x, double y) {
double t_0 = x + (y * (x + (x * y)));
double tmp;
if (x <= -3.2e+146) {
tmp = 1.0 / t_0;
} else if (x <= -650000.0) {
tmp = (1.0 / x) + (y * ((y * ((-0.16666666666666666 * (y / x)) - (-0.5 / x))) + (-1.0 / x)));
} else if (x <= 2.9e+41) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x + (y * t_0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y * (x + (x * y)))
if (x <= (-3.2d+146)) then
tmp = 1.0d0 / t_0
else if (x <= (-650000.0d0)) then
tmp = (1.0d0 / x) + (y * ((y * (((-0.16666666666666666d0) * (y / x)) - ((-0.5d0) / x))) + ((-1.0d0) / x)))
else if (x <= 2.9d+41) then
tmp = 1.0d0 / x
else
tmp = 1.0d0 / (x + (y * t_0))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (y * (x + (x * y)));
double tmp;
if (x <= -3.2e+146) {
tmp = 1.0 / t_0;
} else if (x <= -650000.0) {
tmp = (1.0 / x) + (y * ((y * ((-0.16666666666666666 * (y / x)) - (-0.5 / x))) + (-1.0 / x)));
} else if (x <= 2.9e+41) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x + (y * t_0));
}
return tmp;
}
def code(x, y): t_0 = x + (y * (x + (x * y))) tmp = 0 if x <= -3.2e+146: tmp = 1.0 / t_0 elif x <= -650000.0: tmp = (1.0 / x) + (y * ((y * ((-0.16666666666666666 * (y / x)) - (-0.5 / x))) + (-1.0 / x))) elif x <= 2.9e+41: tmp = 1.0 / x else: tmp = 1.0 / (x + (y * t_0)) return tmp
function code(x, y) t_0 = Float64(x + Float64(y * Float64(x + Float64(x * y)))) tmp = 0.0 if (x <= -3.2e+146) tmp = Float64(1.0 / t_0); elseif (x <= -650000.0) tmp = Float64(Float64(1.0 / x) + Float64(y * Float64(Float64(y * Float64(Float64(-0.16666666666666666 * Float64(y / x)) - Float64(-0.5 / x))) + Float64(-1.0 / x)))); elseif (x <= 2.9e+41) tmp = Float64(1.0 / x); else tmp = Float64(1.0 / Float64(x + Float64(y * t_0))); end return tmp end
function tmp_2 = code(x, y) t_0 = x + (y * (x + (x * y))); tmp = 0.0; if (x <= -3.2e+146) tmp = 1.0 / t_0; elseif (x <= -650000.0) tmp = (1.0 / x) + (y * ((y * ((-0.16666666666666666 * (y / x)) - (-0.5 / x))) + (-1.0 / x))); elseif (x <= 2.9e+41) tmp = 1.0 / x; else tmp = 1.0 / (x + (y * t_0)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y * N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.2e+146], N[(1.0 / t$95$0), $MachinePrecision], If[LessEqual[x, -650000.0], N[(N[(1.0 / x), $MachinePrecision] + N[(y * N[(N[(y * N[(N[(-0.16666666666666666 * N[(y / x), $MachinePrecision]), $MachinePrecision] - N[(-0.5 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e+41], N[(1.0 / x), $MachinePrecision], N[(1.0 / N[(x + N[(y * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + y \cdot \left(x + x \cdot y\right)\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{+146}:\\
\;\;\;\;\frac{1}{t\_0}\\
\mathbf{elif}\;x \leq -650000:\\
\;\;\;\;\frac{1}{x} + y \cdot \left(y \cdot \left(-0.16666666666666666 \cdot \frac{y}{x} - \frac{-0.5}{x}\right) + \frac{-1}{x}\right)\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+41}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x + y \cdot t\_0}\\
\end{array}
\end{array}
if x < -3.2e146Initial program 62.1%
exp-prod62.1%
Simplified62.1%
Taylor expanded in x around inf 60.0%
mul-1-neg60.0%
unsub-neg60.0%
Simplified60.0%
Taylor expanded in y around inf 59.9%
clear-num59.8%
inv-pow59.8%
sub-neg59.8%
metadata-eval59.8%
Applied egg-rr59.8%
unpow-159.8%
distribute-lft-in59.8%
*-commutative59.8%
rgt-mult-inverse60.0%
mul-1-neg60.0%
unsub-neg60.0%
Simplified60.0%
Taylor expanded in y around 0 83.2%
neg-mul-183.2%
Simplified83.2%
if -3.2e146 < x < -6.5e5Initial program 85.5%
*-commutative85.5%
exp-to-pow85.5%
Simplified85.5%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 81.2%
un-div-inv81.2%
frac-2neg81.2%
metadata-eval81.2%
Applied egg-rr81.2%
if -6.5e5 < x < 2.89999999999999988e41Initial program 83.2%
exp-prod98.9%
Simplified98.9%
Taylor expanded in x around 0 98.2%
if 2.89999999999999988e41 < x Initial program 76.4%
exp-prod76.4%
Simplified76.4%
Taylor expanded in x around inf 53.9%
mul-1-neg53.9%
unsub-neg53.9%
Simplified53.9%
Taylor expanded in y around inf 53.8%
clear-num53.8%
inv-pow53.8%
sub-neg53.8%
metadata-eval53.8%
Applied egg-rr53.8%
unpow-153.8%
distribute-lft-in53.8%
*-commutative53.8%
rgt-mult-inverse53.9%
mul-1-neg53.9%
unsub-neg53.9%
Simplified53.9%
Taylor expanded in y around 0 84.0%
neg-mul-184.0%
neg-mul-184.0%
Simplified84.0%
Final simplification90.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (* y (+ x (* x y))))))
(if (<= x -8e+146)
(/ 1.0 t_0)
(if (<= x -650000.0)
(+
(/ 1.0 x)
(/ (* y (+ -1.0 (* y (+ 0.5 (* y -0.16666666666666666))))) x))
(if (<= x 2.9e+41) (/ 1.0 x) (/ 1.0 (+ x (* y t_0))))))))
double code(double x, double y) {
double t_0 = x + (y * (x + (x * y)));
double tmp;
if (x <= -8e+146) {
tmp = 1.0 / t_0;
} else if (x <= -650000.0) {
tmp = (1.0 / x) + ((y * (-1.0 + (y * (0.5 + (y * -0.16666666666666666))))) / x);
} else if (x <= 2.9e+41) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x + (y * t_0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y * (x + (x * y)))
if (x <= (-8d+146)) then
tmp = 1.0d0 / t_0
else if (x <= (-650000.0d0)) then
tmp = (1.0d0 / x) + ((y * ((-1.0d0) + (y * (0.5d0 + (y * (-0.16666666666666666d0)))))) / x)
else if (x <= 2.9d+41) then
tmp = 1.0d0 / x
else
tmp = 1.0d0 / (x + (y * t_0))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (y * (x + (x * y)));
double tmp;
if (x <= -8e+146) {
tmp = 1.0 / t_0;
} else if (x <= -650000.0) {
tmp = (1.0 / x) + ((y * (-1.0 + (y * (0.5 + (y * -0.16666666666666666))))) / x);
} else if (x <= 2.9e+41) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x + (y * t_0));
}
return tmp;
}
def code(x, y): t_0 = x + (y * (x + (x * y))) tmp = 0 if x <= -8e+146: tmp = 1.0 / t_0 elif x <= -650000.0: tmp = (1.0 / x) + ((y * (-1.0 + (y * (0.5 + (y * -0.16666666666666666))))) / x) elif x <= 2.9e+41: tmp = 1.0 / x else: tmp = 1.0 / (x + (y * t_0)) return tmp
function code(x, y) t_0 = Float64(x + Float64(y * Float64(x + Float64(x * y)))) tmp = 0.0 if (x <= -8e+146) tmp = Float64(1.0 / t_0); elseif (x <= -650000.0) tmp = Float64(Float64(1.0 / x) + Float64(Float64(y * Float64(-1.0 + Float64(y * Float64(0.5 + Float64(y * -0.16666666666666666))))) / x)); elseif (x <= 2.9e+41) tmp = Float64(1.0 / x); else tmp = Float64(1.0 / Float64(x + Float64(y * t_0))); end return tmp end
function tmp_2 = code(x, y) t_0 = x + (y * (x + (x * y))); tmp = 0.0; if (x <= -8e+146) tmp = 1.0 / t_0; elseif (x <= -650000.0) tmp = (1.0 / x) + ((y * (-1.0 + (y * (0.5 + (y * -0.16666666666666666))))) / x); elseif (x <= 2.9e+41) tmp = 1.0 / x; else tmp = 1.0 / (x + (y * t_0)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y * N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8e+146], N[(1.0 / t$95$0), $MachinePrecision], If[LessEqual[x, -650000.0], N[(N[(1.0 / x), $MachinePrecision] + N[(N[(y * N[(-1.0 + N[(y * N[(0.5 + N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e+41], N[(1.0 / x), $MachinePrecision], N[(1.0 / N[(x + N[(y * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + y \cdot \left(x + x \cdot y\right)\\
\mathbf{if}\;x \leq -8 \cdot 10^{+146}:\\
\;\;\;\;\frac{1}{t\_0}\\
\mathbf{elif}\;x \leq -650000:\\
\;\;\;\;\frac{1}{x} + \frac{y \cdot \left(-1 + y \cdot \left(0.5 + y \cdot -0.16666666666666666\right)\right)}{x}\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+41}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x + y \cdot t\_0}\\
\end{array}
\end{array}
if x < -7.99999999999999947e146Initial program 62.1%
exp-prod62.1%
Simplified62.1%
Taylor expanded in x around inf 60.0%
mul-1-neg60.0%
unsub-neg60.0%
Simplified60.0%
Taylor expanded in y around inf 59.9%
clear-num59.8%
inv-pow59.8%
sub-neg59.8%
metadata-eval59.8%
Applied egg-rr59.8%
unpow-159.8%
distribute-lft-in59.8%
*-commutative59.8%
rgt-mult-inverse60.0%
mul-1-neg60.0%
unsub-neg60.0%
Simplified60.0%
Taylor expanded in y around 0 83.2%
neg-mul-183.2%
Simplified83.2%
if -7.99999999999999947e146 < x < -6.5e5Initial program 85.5%
*-commutative85.5%
exp-to-pow85.5%
Simplified85.5%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 81.2%
Taylor expanded in x around 0 81.2%
if -6.5e5 < x < 2.89999999999999988e41Initial program 83.2%
exp-prod98.9%
Simplified98.9%
Taylor expanded in x around 0 98.2%
if 2.89999999999999988e41 < x Initial program 76.4%
exp-prod76.4%
Simplified76.4%
Taylor expanded in x around inf 53.9%
mul-1-neg53.9%
unsub-neg53.9%
Simplified53.9%
Taylor expanded in y around inf 53.8%
clear-num53.8%
inv-pow53.8%
sub-neg53.8%
metadata-eval53.8%
Applied egg-rr53.8%
unpow-153.8%
distribute-lft-in53.8%
*-commutative53.8%
rgt-mult-inverse53.9%
mul-1-neg53.9%
unsub-neg53.9%
Simplified53.9%
Taylor expanded in y around 0 84.0%
neg-mul-184.0%
neg-mul-184.0%
Simplified84.0%
Final simplification90.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ 1.0 (+ x (* y (+ x (* x y)))))))
(if (<= x -7.4e+146)
t_0
(if (<= x -650000.0)
(+
(/ 1.0 x)
(/ (* y (+ -1.0 (* y (+ 0.5 (* y -0.16666666666666666))))) x))
(if (<= x 2.9e+41) (/ 1.0 x) t_0)))))
double code(double x, double y) {
double t_0 = 1.0 / (x + (y * (x + (x * y))));
double tmp;
if (x <= -7.4e+146) {
tmp = t_0;
} else if (x <= -650000.0) {
tmp = (1.0 / x) + ((y * (-1.0 + (y * (0.5 + (y * -0.16666666666666666))))) / x);
} else if (x <= 2.9e+41) {
tmp = 1.0 / x;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 / (x + (y * (x + (x * y))))
if (x <= (-7.4d+146)) then
tmp = t_0
else if (x <= (-650000.0d0)) then
tmp = (1.0d0 / x) + ((y * ((-1.0d0) + (y * (0.5d0 + (y * (-0.16666666666666666d0)))))) / x)
else if (x <= 2.9d+41) then
tmp = 1.0d0 / x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 / (x + (y * (x + (x * y))));
double tmp;
if (x <= -7.4e+146) {
tmp = t_0;
} else if (x <= -650000.0) {
tmp = (1.0 / x) + ((y * (-1.0 + (y * (0.5 + (y * -0.16666666666666666))))) / x);
} else if (x <= 2.9e+41) {
tmp = 1.0 / x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 / (x + (y * (x + (x * y)))) tmp = 0 if x <= -7.4e+146: tmp = t_0 elif x <= -650000.0: tmp = (1.0 / x) + ((y * (-1.0 + (y * (0.5 + (y * -0.16666666666666666))))) / x) elif x <= 2.9e+41: tmp = 1.0 / x else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 / Float64(x + Float64(y * Float64(x + Float64(x * y))))) tmp = 0.0 if (x <= -7.4e+146) tmp = t_0; elseif (x <= -650000.0) tmp = Float64(Float64(1.0 / x) + Float64(Float64(y * Float64(-1.0 + Float64(y * Float64(0.5 + Float64(y * -0.16666666666666666))))) / x)); elseif (x <= 2.9e+41) tmp = Float64(1.0 / x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 / (x + (y * (x + (x * y)))); tmp = 0.0; if (x <= -7.4e+146) tmp = t_0; elseif (x <= -650000.0) tmp = (1.0 / x) + ((y * (-1.0 + (y * (0.5 + (y * -0.16666666666666666))))) / x); elseif (x <= 2.9e+41) tmp = 1.0 / x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(x + N[(y * N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.4e+146], t$95$0, If[LessEqual[x, -650000.0], N[(N[(1.0 / x), $MachinePrecision] + N[(N[(y * N[(-1.0 + N[(y * N[(0.5 + N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e+41], N[(1.0 / x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{x + y \cdot \left(x + x \cdot y\right)}\\
\mathbf{if}\;x \leq -7.4 \cdot 10^{+146}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -650000:\\
\;\;\;\;\frac{1}{x} + \frac{y \cdot \left(-1 + y \cdot \left(0.5 + y \cdot -0.16666666666666666\right)\right)}{x}\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+41}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -7.40000000000000009e146 or 2.89999999999999988e41 < x Initial program 70.8%
exp-prod70.8%
Simplified70.8%
Taylor expanded in x around inf 56.2%
mul-1-neg56.2%
unsub-neg56.2%
Simplified56.2%
Taylor expanded in y around inf 56.2%
clear-num56.1%
inv-pow56.1%
sub-neg56.1%
metadata-eval56.1%
Applied egg-rr56.1%
unpow-156.1%
distribute-lft-in56.1%
*-commutative56.1%
rgt-mult-inverse56.2%
mul-1-neg56.2%
unsub-neg56.2%
Simplified56.2%
Taylor expanded in y around 0 82.9%
neg-mul-182.9%
Simplified82.9%
if -7.40000000000000009e146 < x < -6.5e5Initial program 85.5%
*-commutative85.5%
exp-to-pow85.5%
Simplified85.5%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 81.2%
Taylor expanded in x around 0 81.2%
if -6.5e5 < x < 2.89999999999999988e41Initial program 83.2%
exp-prod98.9%
Simplified98.9%
Taylor expanded in x around 0 98.2%
Final simplification89.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ 1.0 (+ x (* y (+ x (* x y)))))))
(if (<= x -6.1e+146)
t_0
(if (<= x -650000.0)
(/ (+ 1.0 (* y (+ -1.0 (* y (+ 0.5 (* y -0.16666666666666666)))))) x)
(if (<= x 2.9e+41) (/ 1.0 x) t_0)))))
double code(double x, double y) {
double t_0 = 1.0 / (x + (y * (x + (x * y))));
double tmp;
if (x <= -6.1e+146) {
tmp = t_0;
} else if (x <= -650000.0) {
tmp = (1.0 + (y * (-1.0 + (y * (0.5 + (y * -0.16666666666666666)))))) / x;
} else if (x <= 2.9e+41) {
tmp = 1.0 / x;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 / (x + (y * (x + (x * y))))
if (x <= (-6.1d+146)) then
tmp = t_0
else if (x <= (-650000.0d0)) then
tmp = (1.0d0 + (y * ((-1.0d0) + (y * (0.5d0 + (y * (-0.16666666666666666d0))))))) / x
else if (x <= 2.9d+41) then
tmp = 1.0d0 / x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 / (x + (y * (x + (x * y))));
double tmp;
if (x <= -6.1e+146) {
tmp = t_0;
} else if (x <= -650000.0) {
tmp = (1.0 + (y * (-1.0 + (y * (0.5 + (y * -0.16666666666666666)))))) / x;
} else if (x <= 2.9e+41) {
tmp = 1.0 / x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 / (x + (y * (x + (x * y)))) tmp = 0 if x <= -6.1e+146: tmp = t_0 elif x <= -650000.0: tmp = (1.0 + (y * (-1.0 + (y * (0.5 + (y * -0.16666666666666666)))))) / x elif x <= 2.9e+41: tmp = 1.0 / x else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 / Float64(x + Float64(y * Float64(x + Float64(x * y))))) tmp = 0.0 if (x <= -6.1e+146) tmp = t_0; elseif (x <= -650000.0) tmp = Float64(Float64(1.0 + Float64(y * Float64(-1.0 + Float64(y * Float64(0.5 + Float64(y * -0.16666666666666666)))))) / x); elseif (x <= 2.9e+41) tmp = Float64(1.0 / x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 / (x + (y * (x + (x * y)))); tmp = 0.0; if (x <= -6.1e+146) tmp = t_0; elseif (x <= -650000.0) tmp = (1.0 + (y * (-1.0 + (y * (0.5 + (y * -0.16666666666666666)))))) / x; elseif (x <= 2.9e+41) tmp = 1.0 / x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(x + N[(y * N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.1e+146], t$95$0, If[LessEqual[x, -650000.0], N[(N[(1.0 + N[(y * N[(-1.0 + N[(y * N[(0.5 + N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 2.9e+41], N[(1.0 / x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{x + y \cdot \left(x + x \cdot y\right)}\\
\mathbf{if}\;x \leq -6.1 \cdot 10^{+146}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -650000:\\
\;\;\;\;\frac{1 + y \cdot \left(-1 + y \cdot \left(0.5 + y \cdot -0.16666666666666666\right)\right)}{x}\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+41}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -6.09999999999999979e146 or 2.89999999999999988e41 < x Initial program 70.8%
exp-prod70.8%
Simplified70.8%
Taylor expanded in x around inf 56.2%
mul-1-neg56.2%
unsub-neg56.2%
Simplified56.2%
Taylor expanded in y around inf 56.2%
clear-num56.1%
inv-pow56.1%
sub-neg56.1%
metadata-eval56.1%
Applied egg-rr56.1%
unpow-156.1%
distribute-lft-in56.1%
*-commutative56.1%
rgt-mult-inverse56.2%
mul-1-neg56.2%
unsub-neg56.2%
Simplified56.2%
Taylor expanded in y around 0 82.9%
neg-mul-182.9%
Simplified82.9%
if -6.09999999999999979e146 < x < -6.5e5Initial program 85.5%
*-commutative85.5%
exp-to-pow85.5%
Simplified85.5%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 81.2%
if -6.5e5 < x < 2.89999999999999988e41Initial program 83.2%
exp-prod98.9%
Simplified98.9%
Taylor expanded in x around 0 98.2%
Final simplification89.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ 1.0 (+ x (* y (+ x (* x y)))))))
(if (<= x -4.8e+146)
t_0
(if (<= x -650000.0)
(/ (+ 1.0 (* y (+ -1.0 (* y (* y -0.16666666666666666))))) x)
(if (<= x 2.9e+41) (/ 1.0 x) t_0)))))
double code(double x, double y) {
double t_0 = 1.0 / (x + (y * (x + (x * y))));
double tmp;
if (x <= -4.8e+146) {
tmp = t_0;
} else if (x <= -650000.0) {
tmp = (1.0 + (y * (-1.0 + (y * (y * -0.16666666666666666))))) / x;
} else if (x <= 2.9e+41) {
tmp = 1.0 / x;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 / (x + (y * (x + (x * y))))
if (x <= (-4.8d+146)) then
tmp = t_0
else if (x <= (-650000.0d0)) then
tmp = (1.0d0 + (y * ((-1.0d0) + (y * (y * (-0.16666666666666666d0)))))) / x
else if (x <= 2.9d+41) then
tmp = 1.0d0 / x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 / (x + (y * (x + (x * y))));
double tmp;
if (x <= -4.8e+146) {
tmp = t_0;
} else if (x <= -650000.0) {
tmp = (1.0 + (y * (-1.0 + (y * (y * -0.16666666666666666))))) / x;
} else if (x <= 2.9e+41) {
tmp = 1.0 / x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 / (x + (y * (x + (x * y)))) tmp = 0 if x <= -4.8e+146: tmp = t_0 elif x <= -650000.0: tmp = (1.0 + (y * (-1.0 + (y * (y * -0.16666666666666666))))) / x elif x <= 2.9e+41: tmp = 1.0 / x else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 / Float64(x + Float64(y * Float64(x + Float64(x * y))))) tmp = 0.0 if (x <= -4.8e+146) tmp = t_0; elseif (x <= -650000.0) tmp = Float64(Float64(1.0 + Float64(y * Float64(-1.0 + Float64(y * Float64(y * -0.16666666666666666))))) / x); elseif (x <= 2.9e+41) tmp = Float64(1.0 / x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 / (x + (y * (x + (x * y)))); tmp = 0.0; if (x <= -4.8e+146) tmp = t_0; elseif (x <= -650000.0) tmp = (1.0 + (y * (-1.0 + (y * (y * -0.16666666666666666))))) / x; elseif (x <= 2.9e+41) tmp = 1.0 / x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(x + N[(y * N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.8e+146], t$95$0, If[LessEqual[x, -650000.0], N[(N[(1.0 + N[(y * N[(-1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 2.9e+41], N[(1.0 / x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{x + y \cdot \left(x + x \cdot y\right)}\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+146}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -650000:\\
\;\;\;\;\frac{1 + y \cdot \left(-1 + y \cdot \left(y \cdot -0.16666666666666666\right)\right)}{x}\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+41}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -4.8000000000000004e146 or 2.89999999999999988e41 < x Initial program 70.8%
exp-prod70.8%
Simplified70.8%
Taylor expanded in x around inf 56.2%
mul-1-neg56.2%
unsub-neg56.2%
Simplified56.2%
Taylor expanded in y around inf 56.2%
clear-num56.1%
inv-pow56.1%
sub-neg56.1%
metadata-eval56.1%
Applied egg-rr56.1%
unpow-156.1%
distribute-lft-in56.1%
*-commutative56.1%
rgt-mult-inverse56.2%
mul-1-neg56.2%
unsub-neg56.2%
Simplified56.2%
Taylor expanded in y around 0 82.9%
neg-mul-182.9%
Simplified82.9%
if -4.8000000000000004e146 < x < -6.5e5Initial program 85.5%
*-commutative85.5%
exp-to-pow85.5%
Simplified85.5%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 81.2%
Taylor expanded in y around inf 80.1%
*-commutative80.1%
Simplified80.1%
if -6.5e5 < x < 2.89999999999999988e41Initial program 83.2%
exp-prod98.9%
Simplified98.9%
Taylor expanded in x around 0 98.2%
Final simplification89.7%
(FPCore (x y) :precision binary64 (if (or (<= x -1.2e+93) (not (<= x 2.9e+41))) (/ 1.0 (+ x (* y (+ x (* x y))))) (/ 1.0 x)))
double code(double x, double y) {
double tmp;
if ((x <= -1.2e+93) || !(x <= 2.9e+41)) {
tmp = 1.0 / (x + (y * (x + (x * y))));
} else {
tmp = 1.0 / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-1.2d+93)) .or. (.not. (x <= 2.9d+41))) then
tmp = 1.0d0 / (x + (y * (x + (x * y))))
else
tmp = 1.0d0 / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -1.2e+93) || !(x <= 2.9e+41)) {
tmp = 1.0 / (x + (y * (x + (x * y))));
} else {
tmp = 1.0 / x;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -1.2e+93) or not (x <= 2.9e+41): tmp = 1.0 / (x + (y * (x + (x * y)))) else: tmp = 1.0 / x return tmp
function code(x, y) tmp = 0.0 if ((x <= -1.2e+93) || !(x <= 2.9e+41)) tmp = Float64(1.0 / Float64(x + Float64(y * Float64(x + Float64(x * y))))); else tmp = Float64(1.0 / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -1.2e+93) || ~((x <= 2.9e+41))) tmp = 1.0 / (x + (y * (x + (x * y)))); else tmp = 1.0 / x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -1.2e+93], N[Not[LessEqual[x, 2.9e+41]], $MachinePrecision]], N[(1.0 / N[(x + N[(y * N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+93} \lor \neg \left(x \leq 2.9 \cdot 10^{+41}\right):\\
\;\;\;\;\frac{1}{x + y \cdot \left(x + x \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x}\\
\end{array}
\end{array}
if x < -1.20000000000000005e93 or 2.89999999999999988e41 < x Initial program 71.1%
exp-prod71.1%
Simplified71.1%
Taylor expanded in x around inf 57.1%
mul-1-neg57.1%
unsub-neg57.1%
Simplified57.1%
Taylor expanded in y around inf 57.0%
clear-num57.0%
inv-pow57.0%
sub-neg57.0%
metadata-eval57.0%
Applied egg-rr57.0%
unpow-157.0%
distribute-lft-in57.0%
*-commutative57.0%
rgt-mult-inverse57.1%
mul-1-neg57.1%
unsub-neg57.1%
Simplified57.1%
Taylor expanded in y around 0 81.3%
neg-mul-181.3%
Simplified81.3%
if -1.20000000000000005e93 < x < 2.89999999999999988e41Initial program 84.4%
exp-prod97.8%
Simplified97.8%
Taylor expanded in x around 0 93.7%
Final simplification88.2%
(FPCore (x y) :precision binary64 (if (or (<= x -3.3e+93) (not (<= x 2.9e+41))) (/ 1.0 (+ x (* x y))) (/ 1.0 x)))
double code(double x, double y) {
double tmp;
if ((x <= -3.3e+93) || !(x <= 2.9e+41)) {
tmp = 1.0 / (x + (x * y));
} else {
tmp = 1.0 / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-3.3d+93)) .or. (.not. (x <= 2.9d+41))) then
tmp = 1.0d0 / (x + (x * y))
else
tmp = 1.0d0 / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -3.3e+93) || !(x <= 2.9e+41)) {
tmp = 1.0 / (x + (x * y));
} else {
tmp = 1.0 / x;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -3.3e+93) or not (x <= 2.9e+41): tmp = 1.0 / (x + (x * y)) else: tmp = 1.0 / x return tmp
function code(x, y) tmp = 0.0 if ((x <= -3.3e+93) || !(x <= 2.9e+41)) tmp = Float64(1.0 / Float64(x + Float64(x * y))); else tmp = Float64(1.0 / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -3.3e+93) || ~((x <= 2.9e+41))) tmp = 1.0 / (x + (x * y)); else tmp = 1.0 / x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -3.3e+93], N[Not[LessEqual[x, 2.9e+41]], $MachinePrecision]], N[(1.0 / N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.3 \cdot 10^{+93} \lor \neg \left(x \leq 2.9 \cdot 10^{+41}\right):\\
\;\;\;\;\frac{1}{x + x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x}\\
\end{array}
\end{array}
if x < -3.30000000000000009e93 or 2.89999999999999988e41 < x Initial program 71.1%
exp-prod71.1%
Simplified71.1%
clear-num71.1%
add-exp-log39.7%
add-exp-log39.7%
div-exp39.7%
pow-exp39.7%
add-log-exp39.7%
log-pow39.7%
div-exp39.7%
add-exp-log71.1%
add-exp-log71.1%
inv-pow71.1%
Applied egg-rr71.1%
unpow-171.1%
Simplified71.1%
Taylor expanded in y around 0 76.5%
if -3.30000000000000009e93 < x < 2.89999999999999988e41Initial program 84.4%
exp-prod97.8%
Simplified97.8%
Taylor expanded in x around 0 93.7%
Final simplification86.0%
(FPCore (x y) :precision binary64 (if (<= y 1.55e+196) (/ 1.0 x) (/ 1.0 (* x y))))
double code(double x, double y) {
double tmp;
if (y <= 1.55e+196) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x * y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.55d+196) then
tmp = 1.0d0 / x
else
tmp = 1.0d0 / (x * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.55e+196) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.55e+196: tmp = 1.0 / x else: tmp = 1.0 / (x * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.55e+196) tmp = Float64(1.0 / x); else tmp = Float64(1.0 / Float64(x * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.55e+196) tmp = 1.0 / x; else tmp = 1.0 / (x * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.55e+196], N[(1.0 / x), $MachinePrecision], N[(1.0 / N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.55 \cdot 10^{+196}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot y}\\
\end{array}
\end{array}
if y < 1.55000000000000005e196Initial program 79.9%
exp-prod85.9%
Simplified85.9%
Taylor expanded in x around 0 81.4%
if 1.55000000000000005e196 < y Initial program 63.0%
exp-prod84.3%
Simplified84.3%
clear-num84.3%
add-exp-log80.5%
add-exp-log80.5%
div-exp80.5%
pow-exp61.3%
add-log-exp61.3%
log-pow61.3%
div-exp61.3%
add-exp-log63.0%
add-exp-log63.0%
inv-pow63.0%
Applied egg-rr63.0%
unpow-163.0%
Simplified63.0%
Taylor expanded in y around 0 66.8%
Taylor expanded in y around inf 66.8%
(FPCore (x y) :precision binary64 (/ 1.0 x))
double code(double x, double y) {
return 1.0 / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / x
end function
public static double code(double x, double y) {
return 1.0 / x;
}
def code(x, y): return 1.0 / x
function code(x, y) return Float64(1.0 / x) end
function tmp = code(x, y) tmp = 1.0 / x; end
code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x}
\end{array}
Initial program 78.4%
exp-prod85.8%
Simplified85.8%
Taylor expanded in x around 0 77.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (exp (/ -1.0 y)) x)) (t_1 (/ (pow (/ x (+ y x)) x) x)))
(if (< y -3.7311844206647956e+94)
t_0
(if (< y 2.817959242728288e+37)
t_1
(if (< y 2.347387415166998e+178) (log (exp t_1)) t_0)))))
double code(double x, double y) {
double t_0 = exp((-1.0 / y)) / x;
double t_1 = pow((x / (y + x)), x) / x;
double tmp;
if (y < -3.7311844206647956e+94) {
tmp = t_0;
} else if (y < 2.817959242728288e+37) {
tmp = t_1;
} else if (y < 2.347387415166998e+178) {
tmp = log(exp(t_1));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = exp(((-1.0d0) / y)) / x
t_1 = ((x / (y + x)) ** x) / x
if (y < (-3.7311844206647956d+94)) then
tmp = t_0
else if (y < 2.817959242728288d+37) then
tmp = t_1
else if (y < 2.347387415166998d+178) then
tmp = log(exp(t_1))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.exp((-1.0 / y)) / x;
double t_1 = Math.pow((x / (y + x)), x) / x;
double tmp;
if (y < -3.7311844206647956e+94) {
tmp = t_0;
} else if (y < 2.817959242728288e+37) {
tmp = t_1;
} else if (y < 2.347387415166998e+178) {
tmp = Math.log(Math.exp(t_1));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = math.exp((-1.0 / y)) / x t_1 = math.pow((x / (y + x)), x) / x tmp = 0 if y < -3.7311844206647956e+94: tmp = t_0 elif y < 2.817959242728288e+37: tmp = t_1 elif y < 2.347387415166998e+178: tmp = math.log(math.exp(t_1)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(exp(Float64(-1.0 / y)) / x) t_1 = Float64((Float64(x / Float64(y + x)) ^ x) / x) tmp = 0.0 if (y < -3.7311844206647956e+94) tmp = t_0; elseif (y < 2.817959242728288e+37) tmp = t_1; elseif (y < 2.347387415166998e+178) tmp = log(exp(t_1)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = exp((-1.0 / y)) / x; t_1 = ((x / (y + x)) ^ x) / x; tmp = 0.0; if (y < -3.7311844206647956e+94) tmp = t_0; elseif (y < 2.817959242728288e+37) tmp = t_1; elseif (y < 2.347387415166998e+178) tmp = log(exp(t_1)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Exp[N[(-1.0 / y), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision], x], $MachinePrecision] / x), $MachinePrecision]}, If[Less[y, -3.7311844206647956e+94], t$95$0, If[Less[y, 2.817959242728288e+37], t$95$1, If[Less[y, 2.347387415166998e+178], N[Log[N[Exp[t$95$1], $MachinePrecision]], $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{e^{\frac{-1}{y}}}{x}\\
t_1 := \frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}\\
\mathbf{if}\;y < -3.7311844206647956 \cdot 10^{+94}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y < 2.817959242728288 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.347387415166998 \cdot 10^{+178}:\\
\;\;\;\;\log \left(e^{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
herbie shell --seed 2024129
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, F"
:precision binary64
:alt
(! :herbie-platform default (if (< y -37311844206647956000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (exp (/ -1 y)) x) (if (< y 28179592427282880000000000000000000000) (/ (pow (/ x (+ y x)) x) x) (if (< y 23473874151669980000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (log (exp (/ (pow (/ x (+ y x)) x) x))) (/ (exp (/ -1 y)) x)))))
(/ (exp (* x (log (/ x (+ x y))))) x))