
(FPCore (x y) :precision binary64 (- (- 1.0 (/ 1.0 (* x 9.0))) (/ y (* 3.0 (sqrt x)))))
double code(double x, double y) {
return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (1.0d0 / (x * 9.0d0))) - (y / (3.0d0 * sqrt(x)))
end function
public static double code(double x, double y) {
return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * Math.sqrt(x)));
}
def code(x, y): return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * math.sqrt(x)))
function code(x, y) return Float64(Float64(1.0 - Float64(1.0 / Float64(x * 9.0))) - Float64(y / Float64(3.0 * sqrt(x)))) end
function tmp = code(x, y) tmp = (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * sqrt(x))); end
code[x_, y_] := N[(N[(1.0 - N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (- (- 1.0 (/ 1.0 (* x 9.0))) (/ y (* 3.0 (sqrt x)))))
double code(double x, double y) {
return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (1.0d0 / (x * 9.0d0))) - (y / (3.0d0 * sqrt(x)))
end function
public static double code(double x, double y) {
return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * Math.sqrt(x)));
}
def code(x, y): return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * math.sqrt(x)))
function code(x, y) return Float64(Float64(1.0 - Float64(1.0 / Float64(x * 9.0))) - Float64(y / Float64(3.0 * sqrt(x)))) end
function tmp = code(x, y) tmp = (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * sqrt(x))); end
code[x_, y_] := N[(N[(1.0 - N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}
\end{array}
(FPCore (x y) :precision binary64 (- (+ 1.0 (/ -1.0 (* x 9.0))) (/ y (sqrt (* x 9.0)))))
double code(double x, double y) {
return (1.0 + (-1.0 / (x * 9.0))) - (y / sqrt((x * 9.0)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 + ((-1.0d0) / (x * 9.0d0))) - (y / sqrt((x * 9.0d0)))
end function
public static double code(double x, double y) {
return (1.0 + (-1.0 / (x * 9.0))) - (y / Math.sqrt((x * 9.0)));
}
def code(x, y): return (1.0 + (-1.0 / (x * 9.0))) - (y / math.sqrt((x * 9.0)))
function code(x, y) return Float64(Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))) - Float64(y / sqrt(Float64(x * 9.0)))) end
function tmp = code(x, y) tmp = (1.0 + (-1.0 / (x * 9.0))) - (y / sqrt((x * 9.0))); end
code[x_, y_] := N[(N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 + \frac{-1}{x \cdot 9}\right) - \frac{y}{\sqrt{x \cdot 9}}
\end{array}
Initial program 99.7%
*-commutative99.7%
metadata-eval99.7%
sqrt-prod99.8%
pow1/299.8%
Applied egg-rr99.8%
unpow1/299.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(if (<= y -1.9e+38)
(- 1.0 (/ y (sqrt (* x 9.0))))
(if (<= y 750000000.0)
(+ 1.0 (/ -1.0 (* x 9.0)))
(- 1.0 (* (pow x -0.5) (/ y 3.0))))))
double code(double x, double y) {
double tmp;
if (y <= -1.9e+38) {
tmp = 1.0 - (y / sqrt((x * 9.0)));
} else if (y <= 750000000.0) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = 1.0 - (pow(x, -0.5) * (y / 3.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.9d+38)) then
tmp = 1.0d0 - (y / sqrt((x * 9.0d0)))
else if (y <= 750000000.0d0) then
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
else
tmp = 1.0d0 - ((x ** (-0.5d0)) * (y / 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.9e+38) {
tmp = 1.0 - (y / Math.sqrt((x * 9.0)));
} else if (y <= 750000000.0) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = 1.0 - (Math.pow(x, -0.5) * (y / 3.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.9e+38: tmp = 1.0 - (y / math.sqrt((x * 9.0))) elif y <= 750000000.0: tmp = 1.0 + (-1.0 / (x * 9.0)) else: tmp = 1.0 - (math.pow(x, -0.5) * (y / 3.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.9e+38) tmp = Float64(1.0 - Float64(y / sqrt(Float64(x * 9.0)))); elseif (y <= 750000000.0) tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); else tmp = Float64(1.0 - Float64((x ^ -0.5) * Float64(y / 3.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.9e+38) tmp = 1.0 - (y / sqrt((x * 9.0))); elseif (y <= 750000000.0) tmp = 1.0 + (-1.0 / (x * 9.0)); else tmp = 1.0 - ((x ^ -0.5) * (y / 3.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.9e+38], N[(1.0 - N[(y / N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 750000000.0], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[Power[x, -0.5], $MachinePrecision] * N[(y / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+38}:\\
\;\;\;\;1 - \frac{y}{\sqrt{x \cdot 9}}\\
\mathbf{elif}\;y \leq 750000000:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;1 - {x}^{-0.5} \cdot \frac{y}{3}\\
\end{array}
\end{array}
if y < -1.8999999999999999e38Initial program 99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.8%
pow1/299.8%
Applied egg-rr99.8%
unpow1/299.8%
Simplified99.8%
Taylor expanded in x around inf 93.5%
if -1.8999999999999999e38 < y < 7.5e8Initial program 99.8%
sub-neg99.8%
distribute-frac-neg99.8%
+-commutative99.8%
associate-+r-99.8%
+-commutative99.8%
associate-+r-99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.8%
fma-neg99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 99.1%
div-inv99.0%
metadata-eval99.0%
cancel-sign-sub-inv99.0%
un-div-inv99.1%
metadata-eval99.1%
associate-/r*99.2%
*-commutative99.2%
add-sqr-sqrt98.9%
sqrt-unprod75.0%
*-commutative75.0%
associate-/r*75.0%
metadata-eval75.0%
*-commutative75.0%
associate-/r*75.0%
metadata-eval75.0%
frac-times75.1%
metadata-eval75.1%
metadata-eval75.1%
frac-times75.0%
sqrt-unprod0.0%
add-sqr-sqrt43.1%
Applied egg-rr43.1%
add-sqr-sqrt0.0%
sqrt-unprod75.0%
pow175.0%
frac-times75.1%
metadata-eval75.1%
metadata-eval75.1%
frac-times75.0%
pow-prod-down75.0%
pow-prod-up75.0%
metadata-eval75.0%
associate-/r*75.0%
*-commutative75.0%
pow-plus75.0%
pow175.0%
sqrt-unprod98.9%
add-sqr-sqrt99.2%
metadata-eval99.2%
div-inv99.1%
associate-/r/99.0%
Applied egg-rr99.0%
associate-/r/99.1%
div-inv99.2%
metadata-eval99.2%
Applied egg-rr99.2%
if 7.5e8 < y Initial program 99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
*-un-lft-identity99.7%
sqrt-prod99.6%
metadata-eval99.6%
times-frac99.6%
metadata-eval99.6%
sqrt-div99.8%
inv-pow99.8%
sqrt-pow199.8%
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 90.1%
Final simplification95.5%
(FPCore (x y) :precision binary64 (if (or (<= y -8.8e+89) (not (<= y 3.7e+90))) (* y (* -0.3333333333333333 (sqrt (/ 1.0 x)))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -8.8e+89) || !(y <= 3.7e+90)) {
tmp = y * (-0.3333333333333333 * sqrt((1.0 / x)));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-8.8d+89)) .or. (.not. (y <= 3.7d+90))) then
tmp = y * ((-0.3333333333333333d0) * sqrt((1.0d0 / x)))
else
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -8.8e+89) || !(y <= 3.7e+90)) {
tmp = y * (-0.3333333333333333 * Math.sqrt((1.0 / x)));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -8.8e+89) or not (y <= 3.7e+90): tmp = y * (-0.3333333333333333 * math.sqrt((1.0 / x))) else: tmp = 1.0 + (-1.0 / (x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -8.8e+89) || !(y <= 3.7e+90)) tmp = Float64(y * Float64(-0.3333333333333333 * sqrt(Float64(1.0 / x)))); else tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -8.8e+89) || ~((y <= 3.7e+90))) tmp = y * (-0.3333333333333333 * sqrt((1.0 / x))); else tmp = 1.0 + (-1.0 / (x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -8.8e+89], N[Not[LessEqual[y, 3.7e+90]], $MachinePrecision]], N[(y * N[(-0.3333333333333333 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.8 \cdot 10^{+89} \lor \neg \left(y \leq 3.7 \cdot 10^{+90}\right):\\
\;\;\;\;y \cdot \left(-0.3333333333333333 \cdot \sqrt{\frac{1}{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -8.8000000000000001e89 or 3.7e90 < y Initial program 99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in x around inf 96.0%
Taylor expanded in y around inf 94.0%
associate-*r*94.9%
Simplified94.9%
if -8.8000000000000001e89 < y < 3.7e90Initial program 99.8%
sub-neg99.8%
distribute-frac-neg99.8%
+-commutative99.8%
associate-+r-99.8%
+-commutative99.8%
associate-+r-99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.8%
fma-neg99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 94.0%
div-inv94.0%
metadata-eval94.0%
cancel-sign-sub-inv94.0%
un-div-inv94.0%
metadata-eval94.0%
associate-/r*94.1%
*-commutative94.1%
add-sqr-sqrt93.9%
sqrt-unprod69.7%
*-commutative69.7%
associate-/r*69.7%
metadata-eval69.7%
*-commutative69.7%
associate-/r*69.7%
metadata-eval69.7%
frac-times69.7%
metadata-eval69.7%
metadata-eval69.7%
frac-times69.7%
sqrt-unprod0.0%
add-sqr-sqrt42.3%
Applied egg-rr42.3%
add-sqr-sqrt0.0%
sqrt-unprod69.7%
pow169.7%
frac-times69.7%
metadata-eval69.7%
metadata-eval69.7%
frac-times69.7%
pow-prod-down69.7%
pow-prod-up69.7%
metadata-eval69.7%
associate-/r*69.7%
*-commutative69.7%
pow-plus69.7%
pow169.7%
sqrt-unprod93.9%
add-sqr-sqrt94.1%
metadata-eval94.1%
div-inv94.1%
associate-/r/94.0%
Applied egg-rr94.0%
associate-/r/94.1%
div-inv94.1%
metadata-eval94.1%
Applied egg-rr94.1%
Final simplification94.4%
(FPCore (x y) :precision binary64 (if (or (<= y -1.05e+36) (not (<= y 750000000.0))) (- 1.0 (* y (sqrt (/ 0.1111111111111111 x)))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -1.05e+36) || !(y <= 750000000.0)) {
tmp = 1.0 - (y * sqrt((0.1111111111111111 / x)));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
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+36)) .or. (.not. (y <= 750000000.0d0))) then
tmp = 1.0d0 - (y * sqrt((0.1111111111111111d0 / x)))
else
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.05e+36) || !(y <= 750000000.0)) {
tmp = 1.0 - (y * Math.sqrt((0.1111111111111111 / x)));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.05e+36) or not (y <= 750000000.0): tmp = 1.0 - (y * math.sqrt((0.1111111111111111 / x))) else: tmp = 1.0 + (-1.0 / (x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.05e+36) || !(y <= 750000000.0)) tmp = Float64(1.0 - Float64(y * sqrt(Float64(0.1111111111111111 / x)))); else tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.05e+36) || ~((y <= 750000000.0))) tmp = 1.0 - (y * sqrt((0.1111111111111111 / x))); else tmp = 1.0 + (-1.0 / (x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.05e+36], N[Not[LessEqual[y, 750000000.0]], $MachinePrecision]], N[(1.0 - N[(y * N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+36} \lor \neg \left(y \leq 750000000\right):\\
\;\;\;\;1 - y \cdot \sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -1.05000000000000002e36 or 7.5e8 < y Initial program 99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in x around inf 91.4%
clear-num91.3%
associate-/r/91.4%
metadata-eval91.4%
sqrt-div91.4%
*-commutative91.4%
associate-/r*91.4%
metadata-eval91.4%
sqrt-div91.3%
metadata-eval91.3%
Applied egg-rr91.3%
metadata-eval91.3%
sqrt-div91.4%
metadata-eval91.4%
associate-*l/91.4%
pow1/291.4%
associate-*l/91.4%
metadata-eval91.4%
Applied egg-rr91.4%
unpow1/291.4%
Simplified91.4%
if -1.05000000000000002e36 < y < 7.5e8Initial program 99.8%
sub-neg99.8%
distribute-frac-neg99.8%
+-commutative99.8%
associate-+r-99.8%
+-commutative99.8%
associate-+r-99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.8%
fma-neg99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 99.1%
div-inv99.0%
metadata-eval99.0%
cancel-sign-sub-inv99.0%
un-div-inv99.1%
metadata-eval99.1%
associate-/r*99.2%
*-commutative99.2%
add-sqr-sqrt98.9%
sqrt-unprod75.0%
*-commutative75.0%
associate-/r*75.0%
metadata-eval75.0%
*-commutative75.0%
associate-/r*75.0%
metadata-eval75.0%
frac-times75.1%
metadata-eval75.1%
metadata-eval75.1%
frac-times75.0%
sqrt-unprod0.0%
add-sqr-sqrt43.1%
Applied egg-rr43.1%
add-sqr-sqrt0.0%
sqrt-unprod75.0%
pow175.0%
frac-times75.1%
metadata-eval75.1%
metadata-eval75.1%
frac-times75.0%
pow-prod-down75.0%
pow-prod-up75.0%
metadata-eval75.0%
associate-/r*75.0%
*-commutative75.0%
pow-plus75.0%
pow175.0%
sqrt-unprod98.9%
add-sqr-sqrt99.2%
metadata-eval99.2%
div-inv99.1%
associate-/r/99.0%
Applied egg-rr99.0%
associate-/r/99.1%
div-inv99.2%
metadata-eval99.2%
Applied egg-rr99.2%
Final simplification95.5%
(FPCore (x y)
:precision binary64
(if (<= y -1.02e+36)
(+ 1.0 (* -0.3333333333333333 (/ y (sqrt x))))
(if (<= y 7e+87)
(+ 1.0 (/ -1.0 (* x 9.0)))
(* y (* -0.3333333333333333 (sqrt (/ 1.0 x)))))))
double code(double x, double y) {
double tmp;
if (y <= -1.02e+36) {
tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x)));
} else if (y <= 7e+87) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = y * (-0.3333333333333333 * sqrt((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 (y <= (-1.02d+36)) then
tmp = 1.0d0 + ((-0.3333333333333333d0) * (y / sqrt(x)))
else if (y <= 7d+87) then
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
else
tmp = y * ((-0.3333333333333333d0) * sqrt((1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.02e+36) {
tmp = 1.0 + (-0.3333333333333333 * (y / Math.sqrt(x)));
} else if (y <= 7e+87) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = y * (-0.3333333333333333 * Math.sqrt((1.0 / x)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.02e+36: tmp = 1.0 + (-0.3333333333333333 * (y / math.sqrt(x))) elif y <= 7e+87: tmp = 1.0 + (-1.0 / (x * 9.0)) else: tmp = y * (-0.3333333333333333 * math.sqrt((1.0 / x))) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.02e+36) tmp = Float64(1.0 + Float64(-0.3333333333333333 * Float64(y / sqrt(x)))); elseif (y <= 7e+87) tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); else tmp = Float64(y * Float64(-0.3333333333333333 * sqrt(Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.02e+36) tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x))); elseif (y <= 7e+87) tmp = 1.0 + (-1.0 / (x * 9.0)); else tmp = y * (-0.3333333333333333 * sqrt((1.0 / x))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.02e+36], N[(1.0 + N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+87], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(-0.3333333333333333 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{+36}:\\
\;\;\;\;1 + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+87}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-0.3333333333333333 \cdot \sqrt{\frac{1}{x}}\right)\\
\end{array}
\end{array}
if y < -1.02000000000000003e36Initial program 99.5%
sub-neg99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
distribute-frac-neg99.5%
neg-mul-199.5%
times-frac99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 93.2%
if -1.02000000000000003e36 < y < 6.99999999999999972e87Initial program 99.8%
sub-neg99.8%
distribute-frac-neg99.8%
+-commutative99.8%
associate-+r-99.8%
+-commutative99.8%
associate-+r-99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.8%
fma-neg99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 95.1%
div-inv95.1%
metadata-eval95.1%
cancel-sign-sub-inv95.1%
un-div-inv95.1%
metadata-eval95.1%
associate-/r*95.2%
*-commutative95.2%
add-sqr-sqrt94.9%
sqrt-unprod70.4%
*-commutative70.4%
associate-/r*70.4%
metadata-eval70.4%
*-commutative70.4%
associate-/r*70.3%
metadata-eval70.3%
frac-times70.4%
metadata-eval70.4%
metadata-eval70.4%
frac-times70.3%
sqrt-unprod0.0%
add-sqr-sqrt41.8%
Applied egg-rr41.8%
add-sqr-sqrt0.0%
sqrt-unprod70.3%
pow170.3%
frac-times70.4%
metadata-eval70.4%
metadata-eval70.4%
frac-times70.3%
pow-prod-down70.3%
pow-prod-up70.3%
metadata-eval70.3%
associate-/r*70.4%
*-commutative70.4%
pow-plus70.4%
pow170.4%
sqrt-unprod94.9%
add-sqr-sqrt95.2%
metadata-eval95.2%
div-inv95.1%
associate-/r/95.1%
Applied egg-rr95.1%
associate-/r/95.1%
div-inv95.2%
metadata-eval95.2%
Applied egg-rr95.2%
if 6.99999999999999972e87 < y Initial program 99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in x around inf 97.0%
Taylor expanded in y around inf 95.3%
associate-*r*96.9%
Simplified96.9%
Final simplification95.2%
(FPCore (x y)
:precision binary64
(if (<= y -2e+38)
(+ 1.0 (* -0.3333333333333333 (/ y (sqrt x))))
(if (<= y 750000000.0)
(+ 1.0 (/ -1.0 (* x 9.0)))
(+ 1.0 (/ (* y -0.3333333333333333) (sqrt x))))))
double code(double x, double y) {
double tmp;
if (y <= -2e+38) {
tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x)));
} else if (y <= 750000000.0) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = 1.0 + ((y * -0.3333333333333333) / sqrt(x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-2d+38)) then
tmp = 1.0d0 + ((-0.3333333333333333d0) * (y / sqrt(x)))
else if (y <= 750000000.0d0) then
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
else
tmp = 1.0d0 + ((y * (-0.3333333333333333d0)) / sqrt(x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -2e+38) {
tmp = 1.0 + (-0.3333333333333333 * (y / Math.sqrt(x)));
} else if (y <= 750000000.0) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = 1.0 + ((y * -0.3333333333333333) / Math.sqrt(x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2e+38: tmp = 1.0 + (-0.3333333333333333 * (y / math.sqrt(x))) elif y <= 750000000.0: tmp = 1.0 + (-1.0 / (x * 9.0)) else: tmp = 1.0 + ((y * -0.3333333333333333) / math.sqrt(x)) return tmp
function code(x, y) tmp = 0.0 if (y <= -2e+38) tmp = Float64(1.0 + Float64(-0.3333333333333333 * Float64(y / sqrt(x)))); elseif (y <= 750000000.0) tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); else tmp = Float64(1.0 + Float64(Float64(y * -0.3333333333333333) / sqrt(x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2e+38) tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x))); elseif (y <= 750000000.0) tmp = 1.0 + (-1.0 / (x * 9.0)); else tmp = 1.0 + ((y * -0.3333333333333333) / sqrt(x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2e+38], N[(1.0 + N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 750000000.0], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(y * -0.3333333333333333), $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+38}:\\
\;\;\;\;1 + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{elif}\;y \leq 750000000:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{y \cdot -0.3333333333333333}{\sqrt{x}}\\
\end{array}
\end{array}
if y < -1.99999999999999995e38Initial program 99.5%
sub-neg99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
distribute-frac-neg99.5%
neg-mul-199.5%
times-frac99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 93.2%
if -1.99999999999999995e38 < y < 7.5e8Initial program 99.8%
sub-neg99.8%
distribute-frac-neg99.8%
+-commutative99.8%
associate-+r-99.8%
+-commutative99.8%
associate-+r-99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.8%
fma-neg99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 99.1%
div-inv99.0%
metadata-eval99.0%
cancel-sign-sub-inv99.0%
un-div-inv99.1%
metadata-eval99.1%
associate-/r*99.2%
*-commutative99.2%
add-sqr-sqrt98.9%
sqrt-unprod75.0%
*-commutative75.0%
associate-/r*75.0%
metadata-eval75.0%
*-commutative75.0%
associate-/r*75.0%
metadata-eval75.0%
frac-times75.1%
metadata-eval75.1%
metadata-eval75.1%
frac-times75.0%
sqrt-unprod0.0%
add-sqr-sqrt43.1%
Applied egg-rr43.1%
add-sqr-sqrt0.0%
sqrt-unprod75.0%
pow175.0%
frac-times75.1%
metadata-eval75.1%
metadata-eval75.1%
frac-times75.0%
pow-prod-down75.0%
pow-prod-up75.0%
metadata-eval75.0%
associate-/r*75.0%
*-commutative75.0%
pow-plus75.0%
pow175.0%
sqrt-unprod98.9%
add-sqr-sqrt99.2%
metadata-eval99.2%
div-inv99.1%
associate-/r/99.0%
Applied egg-rr99.0%
associate-/r/99.1%
div-inv99.2%
metadata-eval99.2%
Applied egg-rr99.2%
if 7.5e8 < y Initial program 99.6%
sub-neg99.6%
distribute-frac-neg99.6%
+-commutative99.6%
associate-+r-99.6%
+-commutative99.6%
associate-+r-99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.6%
fma-neg99.6%
associate-/r*99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 88.8%
*-commutative88.8%
associate-*l*89.9%
*-commutative89.9%
Simplified89.9%
*-commutative89.9%
sqrt-div89.8%
metadata-eval89.8%
un-div-inv89.9%
*-commutative89.9%
Applied egg-rr89.9%
Final simplification95.4%
(FPCore (x y)
:precision binary64
(if (<= y -1.05e+36)
(- 1.0 (/ y (sqrt (* x 9.0))))
(if (<= y 750000000.0)
(+ 1.0 (/ -1.0 (* x 9.0)))
(- 1.0 (* y (sqrt (/ 0.1111111111111111 x)))))))
double code(double x, double y) {
double tmp;
if (y <= -1.05e+36) {
tmp = 1.0 - (y / sqrt((x * 9.0)));
} else if (y <= 750000000.0) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = 1.0 - (y * sqrt((0.1111111111111111 / x)));
}
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+36)) then
tmp = 1.0d0 - (y / sqrt((x * 9.0d0)))
else if (y <= 750000000.0d0) then
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
else
tmp = 1.0d0 - (y * sqrt((0.1111111111111111d0 / x)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.05e+36) {
tmp = 1.0 - (y / Math.sqrt((x * 9.0)));
} else if (y <= 750000000.0) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = 1.0 - (y * Math.sqrt((0.1111111111111111 / x)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.05e+36: tmp = 1.0 - (y / math.sqrt((x * 9.0))) elif y <= 750000000.0: tmp = 1.0 + (-1.0 / (x * 9.0)) else: tmp = 1.0 - (y * math.sqrt((0.1111111111111111 / x))) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.05e+36) tmp = Float64(1.0 - Float64(y / sqrt(Float64(x * 9.0)))); elseif (y <= 750000000.0) tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); else tmp = Float64(1.0 - Float64(y * sqrt(Float64(0.1111111111111111 / x)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.05e+36) tmp = 1.0 - (y / sqrt((x * 9.0))); elseif (y <= 750000000.0) tmp = 1.0 + (-1.0 / (x * 9.0)); else tmp = 1.0 - (y * sqrt((0.1111111111111111 / x))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.05e+36], N[(1.0 - N[(y / N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 750000000.0], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(y * N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+36}:\\
\;\;\;\;1 - \frac{y}{\sqrt{x \cdot 9}}\\
\mathbf{elif}\;y \leq 750000000:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;1 - y \cdot \sqrt{\frac{0.1111111111111111}{x}}\\
\end{array}
\end{array}
if y < -1.05000000000000002e36Initial program 99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.8%
pow1/299.8%
Applied egg-rr99.8%
unpow1/299.8%
Simplified99.8%
Taylor expanded in x around inf 93.5%
if -1.05000000000000002e36 < y < 7.5e8Initial program 99.8%
sub-neg99.8%
distribute-frac-neg99.8%
+-commutative99.8%
associate-+r-99.8%
+-commutative99.8%
associate-+r-99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.8%
fma-neg99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 99.1%
div-inv99.0%
metadata-eval99.0%
cancel-sign-sub-inv99.0%
un-div-inv99.1%
metadata-eval99.1%
associate-/r*99.2%
*-commutative99.2%
add-sqr-sqrt98.9%
sqrt-unprod75.0%
*-commutative75.0%
associate-/r*75.0%
metadata-eval75.0%
*-commutative75.0%
associate-/r*75.0%
metadata-eval75.0%
frac-times75.1%
metadata-eval75.1%
metadata-eval75.1%
frac-times75.0%
sqrt-unprod0.0%
add-sqr-sqrt43.1%
Applied egg-rr43.1%
add-sqr-sqrt0.0%
sqrt-unprod75.0%
pow175.0%
frac-times75.1%
metadata-eval75.1%
metadata-eval75.1%
frac-times75.0%
pow-prod-down75.0%
pow-prod-up75.0%
metadata-eval75.0%
associate-/r*75.0%
*-commutative75.0%
pow-plus75.0%
pow175.0%
sqrt-unprod98.9%
add-sqr-sqrt99.2%
metadata-eval99.2%
div-inv99.1%
associate-/r/99.0%
Applied egg-rr99.0%
associate-/r/99.1%
div-inv99.2%
metadata-eval99.2%
Applied egg-rr99.2%
if 7.5e8 < y Initial program 99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in x around inf 90.0%
clear-num89.9%
associate-/r/90.0%
metadata-eval90.0%
sqrt-div90.1%
*-commutative90.1%
associate-/r*90.1%
metadata-eval90.1%
sqrt-div89.9%
metadata-eval89.9%
Applied egg-rr89.9%
metadata-eval89.9%
sqrt-div90.1%
metadata-eval90.1%
associate-*l/90.0%
pow1/290.0%
associate-*l/90.1%
metadata-eval90.1%
Applied egg-rr90.1%
unpow1/290.1%
Simplified90.1%
Final simplification95.5%
(FPCore (x y) :precision binary64 (if (<= x 0.112) (- (/ -0.1111111111111111 x) (/ y (sqrt (* x 9.0)))) (- 1.0 (* (pow x -0.5) (/ y 3.0)))))
double code(double x, double y) {
double tmp;
if (x <= 0.112) {
tmp = (-0.1111111111111111 / x) - (y / sqrt((x * 9.0)));
} else {
tmp = 1.0 - (pow(x, -0.5) * (y / 3.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 0.112d0) then
tmp = ((-0.1111111111111111d0) / x) - (y / sqrt((x * 9.0d0)))
else
tmp = 1.0d0 - ((x ** (-0.5d0)) * (y / 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.112) {
tmp = (-0.1111111111111111 / x) - (y / Math.sqrt((x * 9.0)));
} else {
tmp = 1.0 - (Math.pow(x, -0.5) * (y / 3.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.112: tmp = (-0.1111111111111111 / x) - (y / math.sqrt((x * 9.0))) else: tmp = 1.0 - (math.pow(x, -0.5) * (y / 3.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.112) tmp = Float64(Float64(-0.1111111111111111 / x) - Float64(y / sqrt(Float64(x * 9.0)))); else tmp = Float64(1.0 - Float64((x ^ -0.5) * Float64(y / 3.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.112) tmp = (-0.1111111111111111 / x) - (y / sqrt((x * 9.0))); else tmp = 1.0 - ((x ^ -0.5) * (y / 3.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.112], N[(N[(-0.1111111111111111 / x), $MachinePrecision] - N[(y / N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[Power[x, -0.5], $MachinePrecision] * N[(y / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.112:\\
\;\;\;\;\frac{-0.1111111111111111}{x} - \frac{y}{\sqrt{x \cdot 9}}\\
\mathbf{else}:\\
\;\;\;\;1 - {x}^{-0.5} \cdot \frac{y}{3}\\
\end{array}
\end{array}
if x < 0.112000000000000002Initial program 99.7%
*-commutative99.7%
metadata-eval99.7%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in x around 0 98.1%
if 0.112000000000000002 < x Initial program 99.7%
*-commutative99.7%
metadata-eval99.7%
sqrt-prod99.8%
pow1/299.8%
Applied egg-rr99.8%
unpow1/299.8%
Simplified99.8%
*-un-lft-identity99.8%
sqrt-prod99.7%
metadata-eval99.7%
times-frac99.8%
metadata-eval99.8%
sqrt-div99.8%
inv-pow99.8%
sqrt-pow199.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 97.5%
Final simplification97.8%
(FPCore (x y) :precision binary64 (+ (- 1.0 (/ 0.1111111111111111 x)) (* -0.3333333333333333 (/ y (sqrt x)))))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 * (y / sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (0.1111111111111111d0 / x)) + ((-0.3333333333333333d0) * (y / sqrt(x)))
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 * (y / Math.sqrt(x)));
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 * (y / math.sqrt(x)))
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) + Float64(-0.3333333333333333 * Float64(y / sqrt(x)))) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 * (y / sqrt(x))); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] + N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}
\end{array}
Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
distribute-frac-neg99.6%
neg-mul-199.6%
times-frac99.3%
metadata-eval99.3%
Simplified99.3%
Final simplification99.3%
(FPCore (x y) :precision binary64 (+ (- 1.0 (/ 0.1111111111111111 x)) (/ (* y -0.3333333333333333) (sqrt x))))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) + ((y * -0.3333333333333333) / sqrt(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (0.1111111111111111d0 / x)) + ((y * (-0.3333333333333333d0)) / sqrt(x))
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) + ((y * -0.3333333333333333) / Math.sqrt(x));
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) + ((y * -0.3333333333333333) / math.sqrt(x))
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) + Float64(Float64(y * -0.3333333333333333) / sqrt(x))) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) + ((y * -0.3333333333333333) / sqrt(x)); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(y * -0.3333333333333333), $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) + \frac{y \cdot -0.3333333333333333}{\sqrt{x}}
\end{array}
Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
distribute-frac-neg99.6%
neg-mul-199.6%
times-frac99.3%
metadata-eval99.3%
Simplified99.3%
associate-*r/99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x y) :precision binary64 (- (- 1.0 (/ 0.1111111111111111 x)) (/ y (* 3.0 (sqrt x)))))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y / (3.0 * sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (0.1111111111111111d0 / x)) - (y / (3.0d0 * sqrt(x)))
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y / (3.0 * Math.sqrt(x)));
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) - (y / (3.0 * math.sqrt(x)))
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) - Float64(y / Float64(3.0 * sqrt(x)))) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) - (y / (3.0 * sqrt(x))); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) - \frac{y}{3 \cdot \sqrt{x}}
\end{array}
Initial program 99.7%
Taylor expanded in x around 0 99.6%
Final simplification99.6%
(FPCore (x y) :precision binary64 (if (<= x 200.0) (/ -0.1111111111111111 x) 1.0))
double code(double x, double y) {
double tmp;
if (x <= 200.0) {
tmp = -0.1111111111111111 / x;
} else {
tmp = 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 <= 200.0d0) then
tmp = (-0.1111111111111111d0) / x
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 200.0) {
tmp = -0.1111111111111111 / x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 200.0: tmp = -0.1111111111111111 / x else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 200.0) tmp = Float64(-0.1111111111111111 / x); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 200.0) tmp = -0.1111111111111111 / x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 200.0], N[(-0.1111111111111111 / x), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 200:\\
\;\;\;\;\frac{-0.1111111111111111}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < 200Initial program 99.7%
sub-neg99.7%
distribute-frac-neg99.7%
+-commutative99.7%
associate-+r-99.7%
+-commutative99.7%
associate-+r-99.7%
neg-mul-199.7%
*-commutative99.7%
associate-*r/99.6%
fma-neg99.6%
associate-/r*99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.5%
distribute-neg-frac99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 62.3%
div-inv62.3%
metadata-eval62.3%
cancel-sign-sub-inv62.3%
un-div-inv62.3%
metadata-eval62.3%
associate-/r*62.4%
*-commutative62.4%
add-sqr-sqrt62.1%
sqrt-unprod38.2%
*-commutative38.2%
associate-/r*38.2%
metadata-eval38.2%
*-commutative38.2%
associate-/r*38.1%
metadata-eval38.1%
frac-times38.2%
metadata-eval38.2%
metadata-eval38.2%
frac-times38.1%
sqrt-unprod0.0%
add-sqr-sqrt1.5%
Applied egg-rr1.5%
add-sqr-sqrt0.0%
sqrt-unprod38.1%
pow138.1%
frac-times38.2%
metadata-eval38.2%
metadata-eval38.2%
frac-times38.1%
pow-prod-down38.1%
pow-prod-up38.1%
metadata-eval38.1%
associate-/r*38.2%
*-commutative38.2%
pow-plus38.2%
pow138.2%
sqrt-unprod62.1%
add-sqr-sqrt62.4%
metadata-eval62.4%
div-inv62.4%
associate-/r/62.3%
Applied egg-rr62.3%
Taylor expanded in x around 0 60.9%
if 200 < x Initial program 99.7%
sub-neg99.7%
distribute-frac-neg99.7%
+-commutative99.7%
associate-+r-99.7%
+-commutative99.7%
associate-+r-99.7%
neg-mul-199.7%
*-commutative99.7%
associate-*r/99.7%
fma-neg99.7%
associate-/r*99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 59.1%
div-inv59.1%
metadata-eval59.1%
cancel-sign-sub-inv59.1%
un-div-inv59.1%
metadata-eval59.1%
associate-/r*59.1%
*-commutative59.1%
add-sqr-sqrt59.1%
sqrt-unprod59.1%
*-commutative59.1%
associate-/r*59.1%
metadata-eval59.1%
*-commutative59.1%
associate-/r*59.1%
metadata-eval59.1%
frac-times59.1%
metadata-eval59.1%
metadata-eval59.1%
frac-times59.1%
sqrt-unprod0.0%
add-sqr-sqrt56.7%
Applied egg-rr56.7%
Taylor expanded in x around inf 56.8%
Final simplification59.0%
(FPCore (x y) :precision binary64 (+ 1.0 (/ -1.0 (* x 9.0))))
double code(double x, double y) {
return 1.0 + (-1.0 / (x * 9.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
end function
public static double code(double x, double y) {
return 1.0 + (-1.0 / (x * 9.0));
}
def code(x, y): return 1.0 + (-1.0 / (x * 9.0))
function code(x, y) return Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))) end
function tmp = code(x, y) tmp = 1.0 + (-1.0 / (x * 9.0)); end
code[x_, y_] := N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{-1}{x \cdot 9}
\end{array}
Initial program 99.7%
sub-neg99.7%
distribute-frac-neg99.7%
+-commutative99.7%
associate-+r-99.7%
+-commutative99.7%
associate-+r-99.7%
neg-mul-199.7%
*-commutative99.7%
associate-*r/99.6%
fma-neg99.7%
associate-/r*99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 60.8%
div-inv60.8%
metadata-eval60.8%
cancel-sign-sub-inv60.8%
un-div-inv60.8%
metadata-eval60.8%
associate-/r*60.9%
*-commutative60.9%
add-sqr-sqrt60.7%
sqrt-unprod48.1%
*-commutative48.1%
associate-/r*48.1%
metadata-eval48.1%
*-commutative48.1%
associate-/r*48.0%
metadata-eval48.0%
frac-times48.1%
metadata-eval48.1%
metadata-eval48.1%
frac-times48.0%
sqrt-unprod0.0%
add-sqr-sqrt27.6%
Applied egg-rr27.6%
add-sqr-sqrt0.0%
sqrt-unprod48.0%
pow148.0%
frac-times48.1%
metadata-eval48.1%
metadata-eval48.1%
frac-times48.0%
pow-prod-down48.0%
pow-prod-up48.0%
metadata-eval48.0%
associate-/r*48.1%
*-commutative48.1%
pow-plus48.1%
pow148.1%
sqrt-unprod60.7%
add-sqr-sqrt60.9%
metadata-eval60.9%
div-inv60.9%
associate-/r/60.8%
Applied egg-rr60.8%
associate-/r/60.9%
div-inv60.9%
metadata-eval60.9%
Applied egg-rr60.9%
Final simplification60.9%
(FPCore (x y) :precision binary64 (+ 1.0 (/ -0.1111111111111111 x)))
double code(double x, double y) {
return 1.0 + (-0.1111111111111111 / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 + ((-0.1111111111111111d0) / x)
end function
public static double code(double x, double y) {
return 1.0 + (-0.1111111111111111 / x);
}
def code(x, y): return 1.0 + (-0.1111111111111111 / x)
function code(x, y) return Float64(1.0 + Float64(-0.1111111111111111 / x)) end
function tmp = code(x, y) tmp = 1.0 + (-0.1111111111111111 / x); end
code[x_, y_] := N[(1.0 + N[(-0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{-0.1111111111111111}{x}
\end{array}
Initial program 99.7%
sub-neg99.7%
distribute-frac-neg99.7%
+-commutative99.7%
associate-+r-99.7%
+-commutative99.7%
associate-+r-99.7%
neg-mul-199.7%
*-commutative99.7%
associate-*r/99.6%
fma-neg99.7%
associate-/r*99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 60.8%
Final simplification60.8%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.7%
sub-neg99.7%
distribute-frac-neg99.7%
+-commutative99.7%
associate-+r-99.7%
+-commutative99.7%
associate-+r-99.7%
neg-mul-199.7%
*-commutative99.7%
associate-*r/99.6%
fma-neg99.7%
associate-/r*99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 60.8%
div-inv60.8%
metadata-eval60.8%
cancel-sign-sub-inv60.8%
un-div-inv60.8%
metadata-eval60.8%
associate-/r*60.9%
*-commutative60.9%
add-sqr-sqrt60.7%
sqrt-unprod48.1%
*-commutative48.1%
associate-/r*48.1%
metadata-eval48.1%
*-commutative48.1%
associate-/r*48.0%
metadata-eval48.0%
frac-times48.1%
metadata-eval48.1%
metadata-eval48.1%
frac-times48.0%
sqrt-unprod0.0%
add-sqr-sqrt27.6%
Applied egg-rr27.6%
Taylor expanded in x around inf 27.6%
Final simplification27.6%
(FPCore (x y) :precision binary64 (- (- 1.0 (/ (/ 1.0 x) 9.0)) (/ y (* 3.0 (sqrt x)))))
double code(double x, double y) {
return (1.0 - ((1.0 / x) / 9.0)) - (y / (3.0 * sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - ((1.0d0 / x) / 9.0d0)) - (y / (3.0d0 * sqrt(x)))
end function
public static double code(double x, double y) {
return (1.0 - ((1.0 / x) / 9.0)) - (y / (3.0 * Math.sqrt(x)));
}
def code(x, y): return (1.0 - ((1.0 / x) / 9.0)) - (y / (3.0 * math.sqrt(x)))
function code(x, y) return Float64(Float64(1.0 - Float64(Float64(1.0 / x) / 9.0)) - Float64(y / Float64(3.0 * sqrt(x)))) end
function tmp = code(x, y) tmp = (1.0 - ((1.0 / x) / 9.0)) - (y / (3.0 * sqrt(x))); end
code[x_, y_] := N[(N[(1.0 - N[(N[(1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision] - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{\frac{1}{x}}{9}\right) - \frac{y}{3 \cdot \sqrt{x}}
\end{array}
herbie shell --seed 2024031
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, D"
:precision binary64
:herbie-target
(- (- 1.0 (/ (/ 1.0 x) 9.0)) (/ y (* 3.0 (sqrt x))))
(- (- 1.0 (/ 1.0 (* x 9.0))) (/ y (* 3.0 (sqrt x)))))