
(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 13 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 -4e+40) (not (<= x 1.05))) (/ 1.0 (* x (exp y))) (/ (pow (exp x) (log (/ x (+ x y)))) x)))
double code(double x, double y) {
double tmp;
if ((x <= -4e+40) || !(x <= 1.05)) {
tmp = 1.0 / (x * exp(y));
} 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 <= (-4d+40)) .or. (.not. (x <= 1.05d0))) then
tmp = 1.0d0 / (x * exp(y))
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 <= -4e+40) || !(x <= 1.05)) {
tmp = 1.0 / (x * Math.exp(y));
} else {
tmp = Math.pow(Math.exp(x), Math.log((x / (x + y)))) / x;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -4e+40) or not (x <= 1.05): tmp = 1.0 / (x * math.exp(y)) else: tmp = math.pow(math.exp(x), math.log((x / (x + y)))) / x return tmp
function code(x, y) tmp = 0.0 if ((x <= -4e+40) || !(x <= 1.05)) tmp = Float64(1.0 / Float64(x * exp(y))); 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 <= -4e+40) || ~((x <= 1.05))) tmp = 1.0 / (x * exp(y)); else tmp = (exp(x) ^ log((x / (x + y)))) / x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -4e+40], N[Not[LessEqual[x, 1.05]], $MachinePrecision]], N[(1.0 / N[(x * N[Exp[y], $MachinePrecision]), $MachinePrecision]), $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 -4 \cdot 10^{+40} \lor \neg \left(x \leq 1.05\right):\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(e^{x}\right)}^{\log \left(\frac{x}{x + y}\right)}}{x}\\
\end{array}
\end{array}
if x < -4.00000000000000012e40 or 1.05000000000000004 < x Initial program 74.9%
*-commutative74.9%
exp-to-pow74.9%
Simplified74.9%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
clear-num100.0%
inv-pow100.0%
exp-neg100.0%
associate-/r/100.0%
/-rgt-identity100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
if -4.00000000000000012e40 < x < 1.05000000000000004Initial program 82.2%
exp-prod99.7%
Simplified99.7%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (or (<= x -2.8e+39) (not (<= x 1.02))) (/ 1.0 (* x (exp y))) (/ 1.0 x)))
double code(double x, double y) {
double tmp;
if ((x <= -2.8e+39) || !(x <= 1.02)) {
tmp = 1.0 / (x * exp(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 <= (-2.8d+39)) .or. (.not. (x <= 1.02d0))) then
tmp = 1.0d0 / (x * exp(y))
else
tmp = 1.0d0 / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -2.8e+39) || !(x <= 1.02)) {
tmp = 1.0 / (x * Math.exp(y));
} else {
tmp = 1.0 / x;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -2.8e+39) or not (x <= 1.02): tmp = 1.0 / (x * math.exp(y)) else: tmp = 1.0 / x return tmp
function code(x, y) tmp = 0.0 if ((x <= -2.8e+39) || !(x <= 1.02)) tmp = Float64(1.0 / Float64(x * exp(y))); else tmp = Float64(1.0 / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -2.8e+39) || ~((x <= 1.02))) tmp = 1.0 / (x * exp(y)); else tmp = 1.0 / x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -2.8e+39], N[Not[LessEqual[x, 1.02]], $MachinePrecision]], N[(1.0 / N[(x * N[Exp[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+39} \lor \neg \left(x \leq 1.02\right):\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x}\\
\end{array}
\end{array}
if x < -2.80000000000000001e39 or 1.02 < x Initial program 74.9%
*-commutative74.9%
exp-to-pow74.9%
Simplified74.9%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
clear-num100.0%
inv-pow100.0%
exp-neg100.0%
associate-/r/100.0%
/-rgt-identity100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
if -2.80000000000000001e39 < x < 1.02Initial program 82.2%
exp-prod99.7%
Simplified99.7%
Taylor expanded in x around 0 97.9%
Final simplification99.1%
(FPCore (x y) :precision binary64 (if (or (<= x -2.8e+39) (not (<= x 0.05))) (/ (exp (- y)) x) (/ 1.0 x)))
double code(double x, double y) {
double tmp;
if ((x <= -2.8e+39) || !(x <= 0.05)) {
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 <= (-2.8d+39)) .or. (.not. (x <= 0.05d0))) 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 <= -2.8e+39) || !(x <= 0.05)) {
tmp = Math.exp(-y) / x;
} else {
tmp = 1.0 / x;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -2.8e+39) or not (x <= 0.05): tmp = math.exp(-y) / x else: tmp = 1.0 / x return tmp
function code(x, y) tmp = 0.0 if ((x <= -2.8e+39) || !(x <= 0.05)) 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 <= -2.8e+39) || ~((x <= 0.05))) tmp = exp(-y) / x; else tmp = 1.0 / x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -2.8e+39], N[Not[LessEqual[x, 0.05]], $MachinePrecision]], N[(N[Exp[(-y)], $MachinePrecision] / x), $MachinePrecision], N[(1.0 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+39} \lor \neg \left(x \leq 0.05\right):\\
\;\;\;\;\frac{e^{-y}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x}\\
\end{array}
\end{array}
if x < -2.80000000000000001e39 or 0.050000000000000003 < x Initial program 74.9%
*-commutative74.9%
exp-to-pow74.9%
Simplified74.9%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
if -2.80000000000000001e39 < x < 0.050000000000000003Initial program 82.2%
exp-prod99.7%
Simplified99.7%
Taylor expanded in x around 0 97.9%
Final simplification99.1%
(FPCore (x y)
:precision binary64
(if (<= x -2.8e+39)
(/ (/ (- x (* x y)) x) x)
(if (<= x 0.042)
(/ 1.0 x)
(/
1.0
(* x (+ 1.0 (* y (+ 1.0 (* y (+ 0.5 (* y 0.16666666666666666)))))))))))
double code(double x, double y) {
double tmp;
if (x <= -2.8e+39) {
tmp = ((x - (x * y)) / x) / x;
} else if (x <= 0.042) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x * (1.0 + (y * (1.0 + (y * (0.5 + (y * 0.16666666666666666)))))));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.8d+39)) then
tmp = ((x - (x * y)) / x) / x
else if (x <= 0.042d0) then
tmp = 1.0d0 / x
else
tmp = 1.0d0 / (x * (1.0d0 + (y * (1.0d0 + (y * (0.5d0 + (y * 0.16666666666666666d0)))))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.8e+39) {
tmp = ((x - (x * y)) / x) / x;
} else if (x <= 0.042) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x * (1.0 + (y * (1.0 + (y * (0.5 + (y * 0.16666666666666666)))))));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.8e+39: tmp = ((x - (x * y)) / x) / x elif x <= 0.042: tmp = 1.0 / x else: tmp = 1.0 / (x * (1.0 + (y * (1.0 + (y * (0.5 + (y * 0.16666666666666666))))))) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.8e+39) tmp = Float64(Float64(Float64(x - Float64(x * y)) / x) / x); elseif (x <= 0.042) tmp = Float64(1.0 / x); else tmp = Float64(1.0 / Float64(x * Float64(1.0 + Float64(y * Float64(1.0 + Float64(y * Float64(0.5 + Float64(y * 0.16666666666666666)))))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.8e+39) tmp = ((x - (x * y)) / x) / x; elseif (x <= 0.042) tmp = 1.0 / x; else tmp = 1.0 / (x * (1.0 + (y * (1.0 + (y * (0.5 + (y * 0.16666666666666666))))))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.8e+39], N[(N[(N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 0.042], N[(1.0 / x), $MachinePrecision], N[(1.0 / N[(x * N[(1.0 + N[(y * N[(1.0 + N[(y * N[(0.5 + N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+39}:\\
\;\;\;\;\frac{\frac{x - x \cdot y}{x}}{x}\\
\mathbf{elif}\;x \leq 0.042:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(1 + y \cdot \left(1 + y \cdot \left(0.5 + y \cdot 0.16666666666666666\right)\right)\right)}\\
\end{array}
\end{array}
if x < -2.80000000000000001e39Initial program 69.3%
exp-prod69.3%
Simplified69.3%
Taylor expanded in y around 0 59.9%
+-commutative59.9%
mul-1-neg59.9%
unsub-neg59.9%
Simplified59.9%
frac-sub32.6%
associate-/r*73.5%
*-un-lft-identity73.5%
*-commutative73.5%
Applied egg-rr73.5%
if -2.80000000000000001e39 < x < 0.0420000000000000026Initial program 82.2%
exp-prod99.7%
Simplified99.7%
Taylor expanded in x around 0 97.9%
if 0.0420000000000000026 < x Initial program 79.9%
*-commutative79.9%
exp-to-pow79.9%
Simplified79.9%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
clear-num100.0%
inv-pow100.0%
exp-neg100.0%
associate-/r/100.0%
/-rgt-identity100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
Taylor expanded in y around 0 85.0%
*-commutative85.0%
Simplified85.0%
Final simplification87.2%
(FPCore (x y)
:precision binary64
(if (<= x -3.2e+178)
(/ 1.0 (* x (+ 1.0 y)))
(if (<= x -3e+45)
(/ (+ 1.0 (* y (* y 0.5))) x)
(if (<= x 5.2e+53) (/ 1.0 x) (/ 1.0 (* x (+ (+ y 2.0) -1.0)))))))
double code(double x, double y) {
double tmp;
if (x <= -3.2e+178) {
tmp = 1.0 / (x * (1.0 + y));
} else if (x <= -3e+45) {
tmp = (1.0 + (y * (y * 0.5))) / x;
} else if (x <= 5.2e+53) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x * ((y + 2.0) + -1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.2d+178)) then
tmp = 1.0d0 / (x * (1.0d0 + y))
else if (x <= (-3d+45)) then
tmp = (1.0d0 + (y * (y * 0.5d0))) / x
else if (x <= 5.2d+53) then
tmp = 1.0d0 / x
else
tmp = 1.0d0 / (x * ((y + 2.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.2e+178) {
tmp = 1.0 / (x * (1.0 + y));
} else if (x <= -3e+45) {
tmp = (1.0 + (y * (y * 0.5))) / x;
} else if (x <= 5.2e+53) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x * ((y + 2.0) + -1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.2e+178: tmp = 1.0 / (x * (1.0 + y)) elif x <= -3e+45: tmp = (1.0 + (y * (y * 0.5))) / x elif x <= 5.2e+53: tmp = 1.0 / x else: tmp = 1.0 / (x * ((y + 2.0) + -1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -3.2e+178) tmp = Float64(1.0 / Float64(x * Float64(1.0 + y))); elseif (x <= -3e+45) tmp = Float64(Float64(1.0 + Float64(y * Float64(y * 0.5))) / x); elseif (x <= 5.2e+53) tmp = Float64(1.0 / x); else tmp = Float64(1.0 / Float64(x * Float64(Float64(y + 2.0) + -1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.2e+178) tmp = 1.0 / (x * (1.0 + y)); elseif (x <= -3e+45) tmp = (1.0 + (y * (y * 0.5))) / x; elseif (x <= 5.2e+53) tmp = 1.0 / x; else tmp = 1.0 / (x * ((y + 2.0) + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.2e+178], N[(1.0 / N[(x * N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3e+45], N[(N[(1.0 + N[(y * N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 5.2e+53], N[(1.0 / x), $MachinePrecision], N[(1.0 / N[(x * N[(N[(y + 2.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{+178}:\\
\;\;\;\;\frac{1}{x \cdot \left(1 + y\right)}\\
\mathbf{elif}\;x \leq -3 \cdot 10^{+45}:\\
\;\;\;\;\frac{1 + y \cdot \left(y \cdot 0.5\right)}{x}\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+53}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(\left(y + 2\right) + -1\right)}\\
\end{array}
\end{array}
if x < -3.2e178Initial program 65.0%
exp-prod65.0%
Simplified65.0%
clear-num65.0%
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-log65.0%
add-exp-log65.0%
inv-pow65.0%
Applied egg-rr65.0%
unpow-165.0%
Simplified65.0%
Taylor expanded in y around 0 78.0%
*-commutative78.0%
distribute-rgt1-in78.0%
+-commutative78.0%
Simplified78.0%
if -3.2e178 < x < -3.00000000000000011e45Initial 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%
Taylor expanded in y around 0 68.6%
Taylor expanded in y around inf 67.0%
*-commutative67.0%
Simplified67.0%
if -3.00000000000000011e45 < x < 5.19999999999999996e53Initial program 82.2%
exp-prod98.5%
Simplified98.5%
Taylor expanded in x around 0 95.2%
if 5.19999999999999996e53 < x Initial program 79.6%
exp-prod79.6%
Simplified79.6%
clear-num79.6%
add-exp-log74.5%
add-exp-log74.5%
div-exp74.5%
pow-exp74.5%
add-log-exp74.5%
log-pow74.5%
div-exp74.5%
add-exp-log79.6%
add-exp-log79.6%
inv-pow79.6%
Applied egg-rr79.6%
unpow-179.6%
Simplified79.6%
Taylor expanded in y around 0 81.6%
*-commutative81.6%
distribute-rgt1-in81.7%
Applied egg-rr81.7%
expm1-log1p-u81.5%
expm1-undefine81.5%
Applied egg-rr81.5%
sub-neg81.5%
log1p-undefine81.5%
rem-exp-log81.7%
+-commutative81.7%
associate-+r+81.7%
metadata-eval81.7%
metadata-eval81.7%
Simplified81.7%
Final simplification85.3%
(FPCore (x y) :precision binary64 (if (<= x -2.8e+39) (/ (/ (- x (* x y)) x) x) (if (<= x 0.47) (/ 1.0 x) (/ 1.0 (* x (+ 1.0 (* y (+ 1.0 (* y 0.5)))))))))
double code(double x, double y) {
double tmp;
if (x <= -2.8e+39) {
tmp = ((x - (x * y)) / x) / x;
} else if (x <= 0.47) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x * (1.0 + (y * (1.0 + (y * 0.5)))));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.8d+39)) then
tmp = ((x - (x * y)) / x) / x
else if (x <= 0.47d0) then
tmp = 1.0d0 / x
else
tmp = 1.0d0 / (x * (1.0d0 + (y * (1.0d0 + (y * 0.5d0)))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.8e+39) {
tmp = ((x - (x * y)) / x) / x;
} else if (x <= 0.47) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x * (1.0 + (y * (1.0 + (y * 0.5)))));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.8e+39: tmp = ((x - (x * y)) / x) / x elif x <= 0.47: tmp = 1.0 / x else: tmp = 1.0 / (x * (1.0 + (y * (1.0 + (y * 0.5))))) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.8e+39) tmp = Float64(Float64(Float64(x - Float64(x * y)) / x) / x); elseif (x <= 0.47) tmp = Float64(1.0 / x); else tmp = Float64(1.0 / Float64(x * Float64(1.0 + Float64(y * Float64(1.0 + Float64(y * 0.5)))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.8e+39) tmp = ((x - (x * y)) / x) / x; elseif (x <= 0.47) tmp = 1.0 / x; else tmp = 1.0 / (x * (1.0 + (y * (1.0 + (y * 0.5))))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.8e+39], N[(N[(N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 0.47], N[(1.0 / x), $MachinePrecision], N[(1.0 / N[(x * N[(1.0 + N[(y * N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+39}:\\
\;\;\;\;\frac{\frac{x - x \cdot y}{x}}{x}\\
\mathbf{elif}\;x \leq 0.47:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(1 + y \cdot \left(1 + y \cdot 0.5\right)\right)}\\
\end{array}
\end{array}
if x < -2.80000000000000001e39Initial program 69.3%
exp-prod69.3%
Simplified69.3%
Taylor expanded in y around 0 59.9%
+-commutative59.9%
mul-1-neg59.9%
unsub-neg59.9%
Simplified59.9%
frac-sub32.6%
associate-/r*73.5%
*-un-lft-identity73.5%
*-commutative73.5%
Applied egg-rr73.5%
if -2.80000000000000001e39 < x < 0.46999999999999997Initial program 82.2%
exp-prod99.7%
Simplified99.7%
Taylor expanded in x around 0 97.9%
if 0.46999999999999997 < x Initial program 79.9%
*-commutative79.9%
exp-to-pow79.9%
Simplified79.9%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
clear-num100.0%
inv-pow100.0%
exp-neg100.0%
associate-/r/100.0%
/-rgt-identity100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
Taylor expanded in y around 0 83.6%
Final simplification86.8%
(FPCore (x y) :precision binary64 (if (or (<= x -6.6e+40) (not (<= x 5.2e+53))) (/ 1.0 (* x (+ (+ y 2.0) -1.0))) (/ 1.0 x)))
double code(double x, double y) {
double tmp;
if ((x <= -6.6e+40) || !(x <= 5.2e+53)) {
tmp = 1.0 / (x * ((y + 2.0) + -1.0));
} 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 <= (-6.6d+40)) .or. (.not. (x <= 5.2d+53))) then
tmp = 1.0d0 / (x * ((y + 2.0d0) + (-1.0d0)))
else
tmp = 1.0d0 / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -6.6e+40) || !(x <= 5.2e+53)) {
tmp = 1.0 / (x * ((y + 2.0) + -1.0));
} else {
tmp = 1.0 / x;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -6.6e+40) or not (x <= 5.2e+53): tmp = 1.0 / (x * ((y + 2.0) + -1.0)) else: tmp = 1.0 / x return tmp
function code(x, y) tmp = 0.0 if ((x <= -6.6e+40) || !(x <= 5.2e+53)) tmp = Float64(1.0 / Float64(x * Float64(Float64(y + 2.0) + -1.0))); else tmp = Float64(1.0 / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -6.6e+40) || ~((x <= 5.2e+53))) tmp = 1.0 / (x * ((y + 2.0) + -1.0)); else tmp = 1.0 / x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -6.6e+40], N[Not[LessEqual[x, 5.2e+53]], $MachinePrecision]], N[(1.0 / N[(x * N[(N[(y + 2.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{+40} \lor \neg \left(x \leq 5.2 \cdot 10^{+53}\right):\\
\;\;\;\;\frac{1}{x \cdot \left(\left(y + 2\right) + -1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x}\\
\end{array}
\end{array}
if x < -6.5999999999999997e40 or 5.19999999999999996e53 < x Initial program 74.6%
exp-prod74.6%
Simplified74.6%
clear-num74.6%
add-exp-log38.3%
add-exp-log38.3%
div-exp38.3%
pow-exp38.3%
add-log-exp38.3%
log-pow38.3%
div-exp38.3%
add-exp-log74.6%
add-exp-log74.6%
inv-pow74.6%
Applied egg-rr74.6%
unpow-174.6%
Simplified74.6%
Taylor expanded in y around 0 73.7%
*-commutative73.7%
distribute-rgt1-in73.7%
Applied egg-rr73.7%
expm1-log1p-u73.4%
expm1-undefine73.4%
Applied egg-rr73.4%
sub-neg73.4%
log1p-undefine73.4%
rem-exp-log73.7%
+-commutative73.7%
associate-+r+73.7%
metadata-eval73.7%
metadata-eval73.7%
Simplified73.7%
if -6.5999999999999997e40 < x < 5.19999999999999996e53Initial program 82.2%
exp-prod98.8%
Simplified98.8%
Taylor expanded in x around 0 96.3%
Final simplification83.6%
(FPCore (x y) :precision binary64 (if (<= x -2.8e+39) (/ (/ (- x (* x y)) x) x) (if (<= x 5.2e+53) (/ 1.0 x) (/ 1.0 (* x (+ (+ y 2.0) -1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -2.8e+39) {
tmp = ((x - (x * y)) / x) / x;
} else if (x <= 5.2e+53) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x * ((y + 2.0) + -1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.8d+39)) then
tmp = ((x - (x * y)) / x) / x
else if (x <= 5.2d+53) then
tmp = 1.0d0 / x
else
tmp = 1.0d0 / (x * ((y + 2.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.8e+39) {
tmp = ((x - (x * y)) / x) / x;
} else if (x <= 5.2e+53) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x * ((y + 2.0) + -1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.8e+39: tmp = ((x - (x * y)) / x) / x elif x <= 5.2e+53: tmp = 1.0 / x else: tmp = 1.0 / (x * ((y + 2.0) + -1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.8e+39) tmp = Float64(Float64(Float64(x - Float64(x * y)) / x) / x); elseif (x <= 5.2e+53) tmp = Float64(1.0 / x); else tmp = Float64(1.0 / Float64(x * Float64(Float64(y + 2.0) + -1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.8e+39) tmp = ((x - (x * y)) / x) / x; elseif (x <= 5.2e+53) tmp = 1.0 / x; else tmp = 1.0 / (x * ((y + 2.0) + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.8e+39], N[(N[(N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 5.2e+53], N[(1.0 / x), $MachinePrecision], N[(1.0 / N[(x * N[(N[(y + 2.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+39}:\\
\;\;\;\;\frac{\frac{x - x \cdot y}{x}}{x}\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+53}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(\left(y + 2\right) + -1\right)}\\
\end{array}
\end{array}
if x < -2.80000000000000001e39Initial program 69.3%
exp-prod69.3%
Simplified69.3%
Taylor expanded in y around 0 59.9%
+-commutative59.9%
mul-1-neg59.9%
unsub-neg59.9%
Simplified59.9%
frac-sub32.6%
associate-/r*73.5%
*-un-lft-identity73.5%
*-commutative73.5%
Applied egg-rr73.5%
if -2.80000000000000001e39 < x < 5.19999999999999996e53Initial program 82.2%
exp-prod98.8%
Simplified98.8%
Taylor expanded in x around 0 96.3%
if 5.19999999999999996e53 < x Initial program 79.6%
exp-prod79.6%
Simplified79.6%
clear-num79.6%
add-exp-log74.5%
add-exp-log74.5%
div-exp74.5%
pow-exp74.5%
add-log-exp74.5%
log-pow74.5%
div-exp74.5%
add-exp-log79.6%
add-exp-log79.6%
inv-pow79.6%
Applied egg-rr79.6%
unpow-179.6%
Simplified79.6%
Taylor expanded in y around 0 81.6%
*-commutative81.6%
distribute-rgt1-in81.7%
Applied egg-rr81.7%
expm1-log1p-u81.5%
expm1-undefine81.5%
Applied egg-rr81.5%
sub-neg81.5%
log1p-undefine81.5%
rem-exp-log81.7%
+-commutative81.7%
associate-+r+81.7%
metadata-eval81.7%
metadata-eval81.7%
Simplified81.7%
Final simplification85.8%
(FPCore (x y) :precision binary64 (if (<= x -2.8e+39) (/ (+ 1.0 (* y (+ y -1.0))) x) (if (<= x 5.2e+53) (/ 1.0 x) (/ 1.0 (* x (+ (+ y 2.0) -1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -2.8e+39) {
tmp = (1.0 + (y * (y + -1.0))) / x;
} else if (x <= 5.2e+53) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x * ((y + 2.0) + -1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2.8d+39)) then
tmp = (1.0d0 + (y * (y + (-1.0d0)))) / x
else if (x <= 5.2d+53) then
tmp = 1.0d0 / x
else
tmp = 1.0d0 / (x * ((y + 2.0d0) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -2.8e+39) {
tmp = (1.0 + (y * (y + -1.0))) / x;
} else if (x <= 5.2e+53) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x * ((y + 2.0) + -1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.8e+39: tmp = (1.0 + (y * (y + -1.0))) / x elif x <= 5.2e+53: tmp = 1.0 / x else: tmp = 1.0 / (x * ((y + 2.0) + -1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -2.8e+39) tmp = Float64(Float64(1.0 + Float64(y * Float64(y + -1.0))) / x); elseif (x <= 5.2e+53) tmp = Float64(1.0 / x); else tmp = Float64(1.0 / Float64(x * Float64(Float64(y + 2.0) + -1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.8e+39) tmp = (1.0 + (y * (y + -1.0))) / x; elseif (x <= 5.2e+53) tmp = 1.0 / x; else tmp = 1.0 / (x * ((y + 2.0) + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.8e+39], N[(N[(1.0 + N[(y * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 5.2e+53], N[(1.0 / x), $MachinePrecision], N[(1.0 / N[(x * N[(N[(y + 2.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+39}:\\
\;\;\;\;\frac{1 + y \cdot \left(y + -1\right)}{x}\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+53}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(\left(y + 2\right) + -1\right)}\\
\end{array}
\end{array}
if x < -2.80000000000000001e39Initial program 69.3%
exp-prod69.3%
Simplified69.3%
clear-num69.3%
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-log69.3%
add-exp-log69.3%
inv-pow69.3%
Applied egg-rr69.3%
unpow-169.3%
Simplified69.3%
Taylor expanded in y around 0 65.2%
Taylor expanded in y around 0 64.2%
Taylor expanded in x around 0 66.6%
if -2.80000000000000001e39 < x < 5.19999999999999996e53Initial program 82.2%
exp-prod98.8%
Simplified98.8%
Taylor expanded in x around 0 96.3%
if 5.19999999999999996e53 < x Initial program 79.6%
exp-prod79.6%
Simplified79.6%
clear-num79.6%
add-exp-log74.5%
add-exp-log74.5%
div-exp74.5%
pow-exp74.5%
add-log-exp74.5%
log-pow74.5%
div-exp74.5%
add-exp-log79.6%
add-exp-log79.6%
inv-pow79.6%
Applied egg-rr79.6%
unpow-179.6%
Simplified79.6%
Taylor expanded in y around 0 81.6%
*-commutative81.6%
distribute-rgt1-in81.7%
Applied egg-rr81.7%
expm1-log1p-u81.5%
expm1-undefine81.5%
Applied egg-rr81.5%
sub-neg81.5%
log1p-undefine81.5%
rem-exp-log81.7%
+-commutative81.7%
associate-+r+81.7%
metadata-eval81.7%
metadata-eval81.7%
Simplified81.7%
Final simplification83.9%
(FPCore (x y) :precision binary64 (if (or (<= x -2.1e+42) (not (<= x 5.2e+53))) (/ 1.0 (* x (+ 1.0 y))) (/ 1.0 x)))
double code(double x, double y) {
double tmp;
if ((x <= -2.1e+42) || !(x <= 5.2e+53)) {
tmp = 1.0 / (x * (1.0 + 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 <= (-2.1d+42)) .or. (.not. (x <= 5.2d+53))) then
tmp = 1.0d0 / (x * (1.0d0 + y))
else
tmp = 1.0d0 / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -2.1e+42) || !(x <= 5.2e+53)) {
tmp = 1.0 / (x * (1.0 + y));
} else {
tmp = 1.0 / x;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -2.1e+42) or not (x <= 5.2e+53): tmp = 1.0 / (x * (1.0 + y)) else: tmp = 1.0 / x return tmp
function code(x, y) tmp = 0.0 if ((x <= -2.1e+42) || !(x <= 5.2e+53)) tmp = Float64(1.0 / Float64(x * Float64(1.0 + y))); else tmp = Float64(1.0 / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -2.1e+42) || ~((x <= 5.2e+53))) tmp = 1.0 / (x * (1.0 + y)); else tmp = 1.0 / x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -2.1e+42], N[Not[LessEqual[x, 5.2e+53]], $MachinePrecision]], N[(1.0 / N[(x * N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+42} \lor \neg \left(x \leq 5.2 \cdot 10^{+53}\right):\\
\;\;\;\;\frac{1}{x \cdot \left(1 + y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x}\\
\end{array}
\end{array}
if x < -2.09999999999999995e42 or 5.19999999999999996e53 < x Initial program 74.6%
exp-prod74.6%
Simplified74.6%
clear-num74.6%
add-exp-log38.3%
add-exp-log38.3%
div-exp38.3%
pow-exp38.3%
add-log-exp38.3%
log-pow38.3%
div-exp38.3%
add-exp-log74.6%
add-exp-log74.6%
inv-pow74.6%
Applied egg-rr74.6%
unpow-174.6%
Simplified74.6%
Taylor expanded in y around 0 73.7%
*-commutative73.7%
distribute-rgt1-in73.7%
+-commutative73.7%
Simplified73.7%
if -2.09999999999999995e42 < x < 5.19999999999999996e53Initial program 82.2%
exp-prod98.8%
Simplified98.8%
Taylor expanded in x around 0 96.3%
Final simplification83.6%
(FPCore (x y) :precision binary64 (if (<= x -6.6e+43) (/ 1.0 (+ x (* x y))) (if (<= x 5.2e+53) (/ 1.0 x) (/ 1.0 (* x (+ 1.0 y))))))
double code(double x, double y) {
double tmp;
if (x <= -6.6e+43) {
tmp = 1.0 / (x + (x * y));
} else if (x <= 5.2e+53) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x * (1.0 + y));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-6.6d+43)) then
tmp = 1.0d0 / (x + (x * y))
else if (x <= 5.2d+53) then
tmp = 1.0d0 / x
else
tmp = 1.0d0 / (x * (1.0d0 + y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -6.6e+43) {
tmp = 1.0 / (x + (x * y));
} else if (x <= 5.2e+53) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x * (1.0 + y));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -6.6e+43: tmp = 1.0 / (x + (x * y)) elif x <= 5.2e+53: tmp = 1.0 / x else: tmp = 1.0 / (x * (1.0 + y)) return tmp
function code(x, y) tmp = 0.0 if (x <= -6.6e+43) tmp = Float64(1.0 / Float64(x + Float64(x * y))); elseif (x <= 5.2e+53) tmp = Float64(1.0 / x); else tmp = Float64(1.0 / Float64(x * Float64(1.0 + y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -6.6e+43) tmp = 1.0 / (x + (x * y)); elseif (x <= 5.2e+53) tmp = 1.0 / x; else tmp = 1.0 / (x * (1.0 + y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -6.6e+43], N[(1.0 / N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2e+53], N[(1.0 / x), $MachinePrecision], N[(1.0 / N[(x * N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{+43}:\\
\;\;\;\;\frac{1}{x + x \cdot y}\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+53}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(1 + y\right)}\\
\end{array}
\end{array}
if x < -6.6000000000000003e43Initial program 69.3%
exp-prod69.3%
Simplified69.3%
clear-num69.3%
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-log69.3%
add-exp-log69.3%
inv-pow69.3%
Applied egg-rr69.3%
unpow-169.3%
Simplified69.3%
Taylor expanded in y around 0 65.2%
if -6.6000000000000003e43 < x < 5.19999999999999996e53Initial program 82.2%
exp-prod98.8%
Simplified98.8%
Taylor expanded in x around 0 96.3%
if 5.19999999999999996e53 < x Initial program 79.6%
exp-prod79.6%
Simplified79.6%
clear-num79.6%
add-exp-log74.5%
add-exp-log74.5%
div-exp74.5%
pow-exp74.5%
add-log-exp74.5%
log-pow74.5%
div-exp74.5%
add-exp-log79.6%
add-exp-log79.6%
inv-pow79.6%
Applied egg-rr79.6%
unpow-179.6%
Simplified79.6%
Taylor expanded in y around 0 81.6%
*-commutative81.6%
distribute-rgt1-in81.7%
+-commutative81.7%
Simplified81.7%
Final simplification83.6%
(FPCore (x y) :precision binary64 (if (<= y 1.05e+140) (/ 1.0 x) (/ 1.0 (* x y))))
double code(double x, double y) {
double tmp;
if (y <= 1.05e+140) {
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.05d+140) 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.05e+140) {
tmp = 1.0 / x;
} else {
tmp = 1.0 / (x * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.05e+140: tmp = 1.0 / x else: tmp = 1.0 / (x * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.05e+140) 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.05e+140) tmp = 1.0 / x; else tmp = 1.0 / (x * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.05e+140], N[(1.0 / x), $MachinePrecision], N[(1.0 / N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.05 \cdot 10^{+140}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot y}\\
\end{array}
\end{array}
if y < 1.0500000000000001e140Initial program 79.9%
exp-prod86.0%
Simplified86.0%
Taylor expanded in x around 0 80.2%
if 1.0500000000000001e140 < y Initial program 64.3%
exp-prod79.3%
Simplified79.3%
clear-num79.3%
add-exp-log76.2%
add-exp-log76.2%
div-exp76.2%
pow-exp62.7%
add-log-exp62.7%
log-pow62.7%
div-exp62.6%
add-exp-log64.4%
add-exp-log64.4%
inv-pow64.4%
Applied egg-rr64.4%
unpow-164.4%
Simplified64.4%
Taylor expanded in y around 0 69.8%
Taylor expanded in y around inf 69.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 77.9%
exp-prod85.2%
Simplified85.2%
Taylor expanded in x around 0 74.3%
(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 2024186
(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))