
(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 14 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 (/ 0.1111111111111111 x)) (* y (sqrt (/ 0.1111111111111111 x)))))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y * sqrt((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)) - (y * sqrt((0.1111111111111111d0 / x)))
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y * Math.sqrt((0.1111111111111111 / x)));
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) - (y * math.sqrt((0.1111111111111111 / x)))
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) - Float64(y * sqrt(Float64(0.1111111111111111 / x)))) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) - (y * sqrt((0.1111111111111111 / x))); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] - N[(y * N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) - y \cdot \sqrt{\frac{0.1111111111111111}{x}}
\end{array}
Initial program 99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
expm1-log1p-u73.6%
expm1-udef73.6%
div-inv73.6%
metadata-eval73.6%
sqrt-div73.6%
metadata-eval73.6%
div-inv73.6%
clear-num73.6%
Applied egg-rr73.6%
expm1-def73.6%
expm1-log1p99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y) :precision binary64 (if (or (<= y -5.3e+66) (not (<= y 1.65e+65))) (+ 1.0 (* y (* -0.3333333333333333 (pow x -0.5)))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -5.3e+66) || !(y <= 1.65e+65)) {
tmp = 1.0 + (y * (-0.3333333333333333 * pow(x, -0.5)));
} 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 <= (-5.3d+66)) .or. (.not. (y <= 1.65d+65))) then
tmp = 1.0d0 + (y * ((-0.3333333333333333d0) * (x ** (-0.5d0))))
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 <= -5.3e+66) || !(y <= 1.65e+65)) {
tmp = 1.0 + (y * (-0.3333333333333333 * Math.pow(x, -0.5)));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -5.3e+66) or not (y <= 1.65e+65): tmp = 1.0 + (y * (-0.3333333333333333 * math.pow(x, -0.5))) else: tmp = 1.0 + (-1.0 / (x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -5.3e+66) || !(y <= 1.65e+65)) tmp = Float64(1.0 + Float64(y * Float64(-0.3333333333333333 * (x ^ -0.5)))); 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 <= -5.3e+66) || ~((y <= 1.65e+65))) tmp = 1.0 + (y * (-0.3333333333333333 * (x ^ -0.5))); else tmp = 1.0 + (-1.0 / (x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -5.3e+66], N[Not[LessEqual[y, 1.65e+65]], $MachinePrecision]], N[(1.0 + N[(y * N[(-0.3333333333333333 * N[Power[x, -0.5], $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 -5.3 \cdot 10^{+66} \lor \neg \left(y \leq 1.65 \cdot 10^{+65}\right):\\
\;\;\;\;1 + y \cdot \left(-0.3333333333333333 \cdot {x}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -5.2999999999999997e66 or 1.65000000000000012e65 < y Initial program 99.4%
associate--l-99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
distribute-neg-frac99.4%
neg-mul-199.4%
*-commutative99.4%
associate-*r/99.3%
fma-def99.3%
associate-/r*99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 94.8%
associate-*r*94.9%
Simplified94.9%
pow1/294.9%
inv-pow94.9%
pow-pow94.8%
metadata-eval94.8%
expm1-log1p-u92.7%
expm1-udef59.7%
Applied egg-rr59.7%
expm1-def92.7%
expm1-log1p94.8%
Simplified94.8%
pow194.8%
associate-*l*94.8%
Applied egg-rr94.8%
unpow194.8%
*-commutative94.8%
associate-*l*94.8%
Simplified94.8%
if -5.2999999999999997e66 < y < 1.65000000000000012e65Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.8%
fma-def99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.8%
distribute-neg-frac99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 97.4%
add-sqr-sqrt0.0%
sqrt-unprod54.0%
frac-times54.0%
metadata-eval54.0%
metadata-eval54.0%
frac-times54.0%
pow154.0%
pow154.0%
pow-prod-up54.0%
metadata-eval54.0%
associate-/r*54.0%
*-commutative54.0%
metadata-eval54.0%
pow254.0%
sqrt-unprod54.1%
add-sqr-sqrt54.1%
inv-pow54.1%
Applied egg-rr54.1%
unpow-154.1%
*-commutative54.1%
associate-/r*54.1%
metadata-eval54.1%
metadata-eval54.1%
associate-*r/54.1%
clear-num54.1%
un-div-inv54.1%
clear-num54.1%
add-sqr-sqrt0.0%
sqrt-unprod72.9%
sqr-neg72.9%
mul-1-neg72.9%
mul-1-neg72.9%
sqrt-unprod97.3%
add-sqr-sqrt97.4%
associate-*r/97.4%
metadata-eval97.4%
clear-num97.4%
div-inv97.5%
metadata-eval97.5%
Applied egg-rr97.5%
Final simplification96.5%
(FPCore (x y)
:precision binary64
(if (<= y -1.65e+66)
(+ 1.0 (* (* y -0.3333333333333333) (sqrt (/ 1.0 x))))
(if (<= y 1.7e+66)
(+ 1.0 (/ -1.0 (* x 9.0)))
(+ 1.0 (* y (* -0.3333333333333333 (pow x -0.5)))))))
double code(double x, double y) {
double tmp;
if (y <= -1.65e+66) {
tmp = 1.0 + ((y * -0.3333333333333333) * sqrt((1.0 / x)));
} else if (y <= 1.7e+66) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = 1.0 + (y * (-0.3333333333333333 * pow(x, -0.5)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.65d+66)) then
tmp = 1.0d0 + ((y * (-0.3333333333333333d0)) * sqrt((1.0d0 / x)))
else if (y <= 1.7d+66) then
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
else
tmp = 1.0d0 + (y * ((-0.3333333333333333d0) * (x ** (-0.5d0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.65e+66) {
tmp = 1.0 + ((y * -0.3333333333333333) * Math.sqrt((1.0 / x)));
} else if (y <= 1.7e+66) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = 1.0 + (y * (-0.3333333333333333 * Math.pow(x, -0.5)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.65e+66: tmp = 1.0 + ((y * -0.3333333333333333) * math.sqrt((1.0 / x))) elif y <= 1.7e+66: tmp = 1.0 + (-1.0 / (x * 9.0)) else: tmp = 1.0 + (y * (-0.3333333333333333 * math.pow(x, -0.5))) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.65e+66) tmp = Float64(1.0 + Float64(Float64(y * -0.3333333333333333) * sqrt(Float64(1.0 / x)))); elseif (y <= 1.7e+66) tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); else tmp = Float64(1.0 + Float64(y * Float64(-0.3333333333333333 * (x ^ -0.5)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.65e+66) tmp = 1.0 + ((y * -0.3333333333333333) * sqrt((1.0 / x))); elseif (y <= 1.7e+66) tmp = 1.0 + (-1.0 / (x * 9.0)); else tmp = 1.0 + (y * (-0.3333333333333333 * (x ^ -0.5))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.65e+66], N[(1.0 + N[(N[(y * -0.3333333333333333), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+66], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * N[(-0.3333333333333333 * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+66}:\\
\;\;\;\;1 + \left(y \cdot -0.3333333333333333\right) \cdot \sqrt{\frac{1}{x}}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+66}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot \left(-0.3333333333333333 \cdot {x}^{-0.5}\right)\\
\end{array}
\end{array}
if y < -1.6500000000000001e66Initial program 99.4%
associate--l-99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
distribute-neg-frac99.4%
neg-mul-199.4%
*-commutative99.4%
associate-*r/99.2%
fma-def99.3%
associate-/r*99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 95.3%
associate-*r*95.5%
Simplified95.5%
if -1.6500000000000001e66 < y < 1.70000000000000015e66Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.8%
fma-def99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.8%
distribute-neg-frac99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 97.4%
add-sqr-sqrt0.0%
sqrt-unprod54.0%
frac-times54.0%
metadata-eval54.0%
metadata-eval54.0%
frac-times54.0%
pow154.0%
pow154.0%
pow-prod-up54.0%
metadata-eval54.0%
associate-/r*54.0%
*-commutative54.0%
metadata-eval54.0%
pow254.0%
sqrt-unprod54.1%
add-sqr-sqrt54.1%
inv-pow54.1%
Applied egg-rr54.1%
unpow-154.1%
*-commutative54.1%
associate-/r*54.1%
metadata-eval54.1%
metadata-eval54.1%
associate-*r/54.1%
clear-num54.1%
un-div-inv54.1%
clear-num54.1%
add-sqr-sqrt0.0%
sqrt-unprod72.9%
sqr-neg72.9%
mul-1-neg72.9%
mul-1-neg72.9%
sqrt-unprod97.3%
add-sqr-sqrt97.4%
associate-*r/97.4%
metadata-eval97.4%
clear-num97.4%
div-inv97.5%
metadata-eval97.5%
Applied egg-rr97.5%
if 1.70000000000000015e66 < y Initial program 99.5%
associate--l-99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
distribute-neg-frac99.5%
neg-mul-199.5%
*-commutative99.5%
associate-*r/99.4%
fma-def99.4%
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 94.2%
associate-*r*94.2%
Simplified94.2%
pow1/294.2%
inv-pow94.2%
pow-pow94.2%
metadata-eval94.2%
expm1-log1p-u91.9%
expm1-udef63.9%
Applied egg-rr63.9%
expm1-def91.9%
expm1-log1p94.2%
Simplified94.2%
pow194.2%
associate-*l*94.1%
Applied egg-rr94.1%
unpow194.1%
*-commutative94.1%
associate-*l*94.3%
Simplified94.3%
Final simplification96.5%
(FPCore (x y) :precision binary64 (if (or (<= y -1.4e+67) (not (<= y 3.1e+64))) (+ 1.0 (* -0.3333333333333333 (/ y (sqrt x)))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -1.4e+67) || !(y <= 3.1e+64)) {
tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(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.4d+67)) .or. (.not. (y <= 3.1d+64))) then
tmp = 1.0d0 + ((-0.3333333333333333d0) * (y / sqrt(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.4e+67) || !(y <= 3.1e+64)) {
tmp = 1.0 + (-0.3333333333333333 * (y / Math.sqrt(x)));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.4e+67) or not (y <= 3.1e+64): tmp = 1.0 + (-0.3333333333333333 * (y / math.sqrt(x))) else: tmp = 1.0 + (-1.0 / (x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.4e+67) || !(y <= 3.1e+64)) tmp = Float64(1.0 + Float64(-0.3333333333333333 * Float64(y / sqrt(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.4e+67) || ~((y <= 3.1e+64))) tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x))); else tmp = 1.0 + (-1.0 / (x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.4e+67], N[Not[LessEqual[y, 3.1e+64]], $MachinePrecision]], N[(1.0 + N[(-0.3333333333333333 * N[(y / N[Sqrt[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.4 \cdot 10^{+67} \lor \neg \left(y \leq 3.1 \cdot 10^{+64}\right):\\
\;\;\;\;1 + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -1.3999999999999999e67 or 3.0999999999999999e64 < y Initial program 99.4%
associate--l-99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
distribute-neg-frac99.4%
neg-mul-199.4%
*-commutative99.4%
associate-*r/99.3%
fma-def99.3%
associate-/r*99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 94.8%
associate-*r*94.9%
Simplified94.9%
expm1-log1p-u46.6%
expm1-udef46.6%
log1p-udef46.6%
add-exp-log94.9%
+-commutative94.9%
associate-*l*94.8%
fma-def94.8%
sqrt-div94.7%
metadata-eval94.7%
un-div-inv94.7%
Applied egg-rr94.7%
fma-udef94.7%
associate--l+94.7%
metadata-eval94.7%
+-rgt-identity94.7%
Simplified94.7%
if -1.3999999999999999e67 < y < 3.0999999999999999e64Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.8%
fma-def99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.8%
distribute-neg-frac99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 97.4%
add-sqr-sqrt0.0%
sqrt-unprod54.0%
frac-times54.0%
metadata-eval54.0%
metadata-eval54.0%
frac-times54.0%
pow154.0%
pow154.0%
pow-prod-up54.0%
metadata-eval54.0%
associate-/r*54.0%
*-commutative54.0%
metadata-eval54.0%
pow254.0%
sqrt-unprod54.1%
add-sqr-sqrt54.1%
inv-pow54.1%
Applied egg-rr54.1%
unpow-154.1%
*-commutative54.1%
associate-/r*54.1%
metadata-eval54.1%
metadata-eval54.1%
associate-*r/54.1%
clear-num54.1%
un-div-inv54.1%
clear-num54.1%
add-sqr-sqrt0.0%
sqrt-unprod72.9%
sqr-neg72.9%
mul-1-neg72.9%
mul-1-neg72.9%
sqrt-unprod97.3%
add-sqr-sqrt97.4%
associate-*r/97.4%
metadata-eval97.4%
clear-num97.4%
div-inv97.5%
metadata-eval97.5%
Applied egg-rr97.5%
Final simplification96.4%
(FPCore (x y) :precision binary64 (if (or (<= y -7.8e+66) (not (<= y 5.8e+64))) (+ 1.0 (/ (* y -0.3333333333333333) (sqrt x))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -7.8e+66) || !(y <= 5.8e+64)) {
tmp = 1.0 + ((y * -0.3333333333333333) / sqrt(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 <= (-7.8d+66)) .or. (.not. (y <= 5.8d+64))) then
tmp = 1.0d0 + ((y * (-0.3333333333333333d0)) / sqrt(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 <= -7.8e+66) || !(y <= 5.8e+64)) {
tmp = 1.0 + ((y * -0.3333333333333333) / Math.sqrt(x));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -7.8e+66) or not (y <= 5.8e+64): tmp = 1.0 + ((y * -0.3333333333333333) / math.sqrt(x)) else: tmp = 1.0 + (-1.0 / (x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -7.8e+66) || !(y <= 5.8e+64)) tmp = Float64(1.0 + Float64(Float64(y * -0.3333333333333333) / sqrt(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 <= -7.8e+66) || ~((y <= 5.8e+64))) tmp = 1.0 + ((y * -0.3333333333333333) / sqrt(x)); else tmp = 1.0 + (-1.0 / (x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -7.8e+66], N[Not[LessEqual[y, 5.8e+64]], $MachinePrecision]], N[(1.0 + N[(N[(y * -0.3333333333333333), $MachinePrecision] / N[Sqrt[x], $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 -7.8 \cdot 10^{+66} \lor \neg \left(y \leq 5.8 \cdot 10^{+64}\right):\\
\;\;\;\;1 + \frac{y \cdot -0.3333333333333333}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -7.8000000000000007e66 or 5.79999999999999986e64 < y Initial program 99.4%
associate--l-99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
distribute-neg-frac99.4%
neg-mul-199.4%
*-commutative99.4%
associate-*r/99.3%
fma-def99.3%
associate-/r*99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 94.8%
associate-*r*94.9%
Simplified94.9%
sqrt-div94.6%
metadata-eval94.6%
un-div-inv94.8%
Applied egg-rr94.8%
if -7.8000000000000007e66 < y < 5.79999999999999986e64Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.8%
fma-def99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.8%
distribute-neg-frac99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 97.4%
add-sqr-sqrt0.0%
sqrt-unprod54.0%
frac-times54.0%
metadata-eval54.0%
metadata-eval54.0%
frac-times54.0%
pow154.0%
pow154.0%
pow-prod-up54.0%
metadata-eval54.0%
associate-/r*54.0%
*-commutative54.0%
metadata-eval54.0%
pow254.0%
sqrt-unprod54.1%
add-sqr-sqrt54.1%
inv-pow54.1%
Applied egg-rr54.1%
unpow-154.1%
*-commutative54.1%
associate-/r*54.1%
metadata-eval54.1%
metadata-eval54.1%
associate-*r/54.1%
clear-num54.1%
un-div-inv54.1%
clear-num54.1%
add-sqr-sqrt0.0%
sqrt-unprod72.9%
sqr-neg72.9%
mul-1-neg72.9%
mul-1-neg72.9%
sqrt-unprod97.3%
add-sqr-sqrt97.4%
associate-*r/97.4%
metadata-eval97.4%
clear-num97.4%
div-inv97.5%
metadata-eval97.5%
Applied egg-rr97.5%
Final simplification96.4%
(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(1.0 + Float64(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[(1.0 + N[(N[(-0.1111111111111111 / x), $MachinePrecision] + N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \left(\frac{-0.1111111111111111}{x} + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\right)
\end{array}
Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.6%
fma-def99.6%
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%
fma-udef99.6%
+-commutative99.6%
associate-*r/99.6%
associate-*l/99.6%
*-commutative99.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(1.0 - Float64(Float64(0.1111111111111111 / x) + Float64(Float64(y / 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[(1.0 - N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(N[(y / 3.0), $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \left(\frac{0.1111111111111111}{x} + \frac{\frac{y}{3}}{\sqrt{x}}\right)
\end{array}
Initial program 99.6%
associate--l-99.6%
+-commutative99.6%
+-commutative99.6%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in x around 0 99.6%
Final simplification99.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ 0.012345679012345678 (* x x))))
(if (<= y -6.6e+108)
(+ 1.0 (sqrt t_0))
(if (<= y 1.35e+154)
(+ 1.0 (/ -1.0 (* x 9.0)))
(/ (+ -1.0 t_0) (+ (/ -0.1111111111111111 x) -1.0))))))
double code(double x, double y) {
double t_0 = 0.012345679012345678 / (x * x);
double tmp;
if (y <= -6.6e+108) {
tmp = 1.0 + sqrt(t_0);
} else if (y <= 1.35e+154) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = (-1.0 + t_0) / ((-0.1111111111111111 / x) + -1.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 = 0.012345679012345678d0 / (x * x)
if (y <= (-6.6d+108)) then
tmp = 1.0d0 + sqrt(t_0)
else if (y <= 1.35d+154) then
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
else
tmp = ((-1.0d0) + t_0) / (((-0.1111111111111111d0) / x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.012345679012345678 / (x * x);
double tmp;
if (y <= -6.6e+108) {
tmp = 1.0 + Math.sqrt(t_0);
} else if (y <= 1.35e+154) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = (-1.0 + t_0) / ((-0.1111111111111111 / x) + -1.0);
}
return tmp;
}
def code(x, y): t_0 = 0.012345679012345678 / (x * x) tmp = 0 if y <= -6.6e+108: tmp = 1.0 + math.sqrt(t_0) elif y <= 1.35e+154: tmp = 1.0 + (-1.0 / (x * 9.0)) else: tmp = (-1.0 + t_0) / ((-0.1111111111111111 / x) + -1.0) return tmp
function code(x, y) t_0 = Float64(0.012345679012345678 / Float64(x * x)) tmp = 0.0 if (y <= -6.6e+108) tmp = Float64(1.0 + sqrt(t_0)); elseif (y <= 1.35e+154) tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); else tmp = Float64(Float64(-1.0 + t_0) / Float64(Float64(-0.1111111111111111 / x) + -1.0)); end return tmp end
function tmp_2 = code(x, y) t_0 = 0.012345679012345678 / (x * x); tmp = 0.0; if (y <= -6.6e+108) tmp = 1.0 + sqrt(t_0); elseif (y <= 1.35e+154) tmp = 1.0 + (-1.0 / (x * 9.0)); else tmp = (-1.0 + t_0) / ((-0.1111111111111111 / x) + -1.0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.012345679012345678 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.6e+108], N[(1.0 + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+154], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 + t$95$0), $MachinePrecision] / N[(N[(-0.1111111111111111 / x), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{0.012345679012345678}{x \cdot x}\\
\mathbf{if}\;y \leq -6.6 \cdot 10^{+108}:\\
\;\;\;\;1 + \sqrt{t_0}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 + t_0}{\frac{-0.1111111111111111}{x} + -1}\\
\end{array}
\end{array}
if y < -6.60000000000000038e108Initial program 99.3%
associate--l-99.3%
sub-neg99.3%
+-commutative99.3%
distribute-neg-in99.3%
distribute-neg-frac99.3%
neg-mul-199.3%
*-commutative99.3%
associate-*r/99.1%
fma-def99.2%
associate-/r*99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 2.9%
add-sqr-sqrt0.0%
sqrt-unprod16.8%
frac-times16.8%
metadata-eval16.8%
Applied egg-rr16.8%
if -6.60000000000000038e108 < y < 1.35000000000000003e154Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
*-commutative99.7%
associate-*r/99.7%
fma-def99.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 88.0%
add-sqr-sqrt0.0%
sqrt-unprod48.0%
frac-times48.0%
metadata-eval48.0%
metadata-eval48.0%
frac-times48.0%
pow148.0%
pow148.0%
pow-prod-up48.0%
metadata-eval48.0%
associate-/r*48.0%
*-commutative48.0%
metadata-eval48.0%
pow248.0%
sqrt-unprod48.1%
add-sqr-sqrt48.1%
inv-pow48.1%
Applied egg-rr48.1%
unpow-148.1%
*-commutative48.1%
associate-/r*48.1%
metadata-eval48.1%
metadata-eval48.1%
associate-*r/48.1%
clear-num48.1%
un-div-inv48.1%
clear-num48.1%
add-sqr-sqrt0.0%
sqrt-unprod64.8%
sqr-neg64.8%
mul-1-neg64.8%
mul-1-neg64.8%
sqrt-unprod87.9%
add-sqr-sqrt88.0%
associate-*r/88.0%
metadata-eval88.0%
clear-num88.0%
div-inv88.1%
metadata-eval88.1%
Applied egg-rr88.1%
if 1.35000000000000003e154 < y Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.5%
fma-def99.5%
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 4.1%
add-sqr-sqrt0.0%
sqrt-unprod0.5%
frac-times0.5%
metadata-eval0.5%
metadata-eval0.5%
frac-times0.5%
pow10.5%
pow10.5%
pow-prod-up0.5%
metadata-eval0.5%
associate-/r*0.5%
*-commutative0.5%
metadata-eval0.5%
pow20.5%
sqrt-unprod0.6%
add-sqr-sqrt0.6%
frac-2neg0.6%
metadata-eval0.6%
div-inv0.6%
distribute-rgt-neg-in0.6%
metadata-eval0.6%
metadata-eval0.6%
div-inv0.6%
clear-num0.6%
Applied egg-rr0.6%
+-commutative0.6%
flip-+0.5%
mul-1-neg0.5%
mul-1-neg0.5%
sqr-neg0.5%
div-inv0.5%
div-inv0.5%
swap-sqr0.5%
metadata-eval0.5%
inv-pow0.5%
inv-pow0.5%
pow-prod-up0.5%
metadata-eval0.5%
metadata-eval0.5%
Applied egg-rr29.0%
Taylor expanded in x around 0 29.0%
unpow229.0%
Simplified29.0%
Final simplification69.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (/ -0.1111111111111111 x) -1.0)))
(if (<= y -3.1e+108)
(/ (+ -1.0 (/ -0.1111111111111111 (* x (* x 9.0)))) t_0)
(if (<= y 1.35e+154)
(+ 1.0 (/ -1.0 (* x 9.0)))
(/ (+ -1.0 (/ 0.012345679012345678 (* x x))) t_0)))))
double code(double x, double y) {
double t_0 = (-0.1111111111111111 / x) + -1.0;
double tmp;
if (y <= -3.1e+108) {
tmp = (-1.0 + (-0.1111111111111111 / (x * (x * 9.0)))) / t_0;
} else if (y <= 1.35e+154) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = (-1.0 + (0.012345679012345678 / (x * x))) / 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 = ((-0.1111111111111111d0) / x) + (-1.0d0)
if (y <= (-3.1d+108)) then
tmp = ((-1.0d0) + ((-0.1111111111111111d0) / (x * (x * 9.0d0)))) / t_0
else if (y <= 1.35d+154) then
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
else
tmp = ((-1.0d0) + (0.012345679012345678d0 / (x * x))) / t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (-0.1111111111111111 / x) + -1.0;
double tmp;
if (y <= -3.1e+108) {
tmp = (-1.0 + (-0.1111111111111111 / (x * (x * 9.0)))) / t_0;
} else if (y <= 1.35e+154) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = (-1.0 + (0.012345679012345678 / (x * x))) / t_0;
}
return tmp;
}
def code(x, y): t_0 = (-0.1111111111111111 / x) + -1.0 tmp = 0 if y <= -3.1e+108: tmp = (-1.0 + (-0.1111111111111111 / (x * (x * 9.0)))) / t_0 elif y <= 1.35e+154: tmp = 1.0 + (-1.0 / (x * 9.0)) else: tmp = (-1.0 + (0.012345679012345678 / (x * x))) / t_0 return tmp
function code(x, y) t_0 = Float64(Float64(-0.1111111111111111 / x) + -1.0) tmp = 0.0 if (y <= -3.1e+108) tmp = Float64(Float64(-1.0 + Float64(-0.1111111111111111 / Float64(x * Float64(x * 9.0)))) / t_0); elseif (y <= 1.35e+154) tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); else tmp = Float64(Float64(-1.0 + Float64(0.012345679012345678 / Float64(x * x))) / t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = (-0.1111111111111111 / x) + -1.0; tmp = 0.0; if (y <= -3.1e+108) tmp = (-1.0 + (-0.1111111111111111 / (x * (x * 9.0)))) / t_0; elseif (y <= 1.35e+154) tmp = 1.0 + (-1.0 / (x * 9.0)); else tmp = (-1.0 + (0.012345679012345678 / (x * x))) / t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(-0.1111111111111111 / x), $MachinePrecision] + -1.0), $MachinePrecision]}, If[LessEqual[y, -3.1e+108], N[(N[(-1.0 + N[(-0.1111111111111111 / N[(x * N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y, 1.35e+154], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 + N[(0.012345679012345678 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-0.1111111111111111}{x} + -1\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{+108}:\\
\;\;\;\;\frac{-1 + \frac{-0.1111111111111111}{x \cdot \left(x \cdot 9\right)}}{t_0}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 + \frac{0.012345679012345678}{x \cdot x}}{t_0}\\
\end{array}
\end{array}
if y < -3.1000000000000001e108Initial program 99.3%
associate--l-99.3%
sub-neg99.3%
+-commutative99.3%
distribute-neg-in99.3%
distribute-neg-frac99.3%
neg-mul-199.3%
*-commutative99.3%
associate-*r/99.1%
fma-def99.2%
associate-/r*99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
distribute-neg-frac99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 2.9%
add-sqr-sqrt0.0%
sqrt-unprod16.8%
frac-times16.8%
metadata-eval16.8%
metadata-eval16.8%
frac-times16.8%
pow116.8%
pow116.8%
pow-prod-up16.8%
metadata-eval16.8%
associate-/r*16.8%
*-commutative16.8%
metadata-eval16.8%
pow216.8%
sqrt-unprod5.9%
add-sqr-sqrt5.9%
frac-2neg5.9%
metadata-eval5.9%
div-inv5.9%
distribute-rgt-neg-in5.9%
metadata-eval5.9%
metadata-eval5.9%
div-inv5.9%
clear-num5.9%
Applied egg-rr5.9%
+-commutative5.9%
flip-+16.8%
mul-1-neg16.8%
mul-1-neg16.8%
sqr-neg16.8%
div-inv16.8%
div-inv16.8%
swap-sqr16.8%
metadata-eval16.8%
inv-pow16.8%
inv-pow16.8%
pow-prod-up16.8%
metadata-eval16.8%
metadata-eval16.8%
Applied egg-rr2.9%
metadata-eval2.9%
sqr-pow2.9%
metadata-eval2.9%
inv-pow2.9%
metadata-eval2.9%
inv-pow2.9%
swap-sqr2.9%
div-inv2.9%
div-inv2.9%
clear-num2.9%
frac-times2.9%
metadata-eval2.9%
clear-num2.9%
add-sqr-sqrt0.0%
sqrt-unprod16.8%
frac-times16.8%
metadata-eval16.8%
metadata-eval16.8%
frac-times16.8%
sqrt-unprod16.8%
add-sqr-sqrt16.8%
clear-num16.8%
div-inv16.8%
metadata-eval16.8%
Applied egg-rr16.8%
if -3.1000000000000001e108 < y < 1.35000000000000003e154Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
*-commutative99.7%
associate-*r/99.7%
fma-def99.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 88.0%
add-sqr-sqrt0.0%
sqrt-unprod48.0%
frac-times48.0%
metadata-eval48.0%
metadata-eval48.0%
frac-times48.0%
pow148.0%
pow148.0%
pow-prod-up48.0%
metadata-eval48.0%
associate-/r*48.0%
*-commutative48.0%
metadata-eval48.0%
pow248.0%
sqrt-unprod48.1%
add-sqr-sqrt48.1%
inv-pow48.1%
Applied egg-rr48.1%
unpow-148.1%
*-commutative48.1%
associate-/r*48.1%
metadata-eval48.1%
metadata-eval48.1%
associate-*r/48.1%
clear-num48.1%
un-div-inv48.1%
clear-num48.1%
add-sqr-sqrt0.0%
sqrt-unprod64.8%
sqr-neg64.8%
mul-1-neg64.8%
mul-1-neg64.8%
sqrt-unprod87.9%
add-sqr-sqrt88.0%
associate-*r/88.0%
metadata-eval88.0%
clear-num88.0%
div-inv88.1%
metadata-eval88.1%
Applied egg-rr88.1%
if 1.35000000000000003e154 < y Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.5%
fma-def99.5%
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 4.1%
add-sqr-sqrt0.0%
sqrt-unprod0.5%
frac-times0.5%
metadata-eval0.5%
metadata-eval0.5%
frac-times0.5%
pow10.5%
pow10.5%
pow-prod-up0.5%
metadata-eval0.5%
associate-/r*0.5%
*-commutative0.5%
metadata-eval0.5%
pow20.5%
sqrt-unprod0.6%
add-sqr-sqrt0.6%
frac-2neg0.6%
metadata-eval0.6%
div-inv0.6%
distribute-rgt-neg-in0.6%
metadata-eval0.6%
metadata-eval0.6%
div-inv0.6%
clear-num0.6%
Applied egg-rr0.6%
+-commutative0.6%
flip-+0.5%
mul-1-neg0.5%
mul-1-neg0.5%
sqr-neg0.5%
div-inv0.5%
div-inv0.5%
swap-sqr0.5%
metadata-eval0.5%
inv-pow0.5%
inv-pow0.5%
pow-prod-up0.5%
metadata-eval0.5%
metadata-eval0.5%
Applied egg-rr29.0%
Taylor expanded in x around 0 29.0%
unpow229.0%
Simplified29.0%
Final simplification69.4%
(FPCore (x y)
:precision binary64
(if (<= y 1e+154)
(+ 1.0 (/ -1.0 (* x 9.0)))
(/
(+ -1.0 (/ 0.012345679012345678 (* x x)))
(+ (/ -0.1111111111111111 x) -1.0))))
double code(double x, double y) {
double tmp;
if (y <= 1e+154) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = (-1.0 + (0.012345679012345678 / (x * x))) / ((-0.1111111111111111 / x) + -1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1d+154) then
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
else
tmp = ((-1.0d0) + (0.012345679012345678d0 / (x * x))) / (((-0.1111111111111111d0) / x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1e+154) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = (-1.0 + (0.012345679012345678 / (x * x))) / ((-0.1111111111111111 / x) + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1e+154: tmp = 1.0 + (-1.0 / (x * 9.0)) else: tmp = (-1.0 + (0.012345679012345678 / (x * x))) / ((-0.1111111111111111 / x) + -1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= 1e+154) tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); else tmp = Float64(Float64(-1.0 + Float64(0.012345679012345678 / Float64(x * x))) / Float64(Float64(-0.1111111111111111 / x) + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1e+154) tmp = 1.0 + (-1.0 / (x * 9.0)); else tmp = (-1.0 + (0.012345679012345678 / (x * x))) / ((-0.1111111111111111 / x) + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1e+154], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 + N[(0.012345679012345678 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(-0.1111111111111111 / x), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{+154}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 + \frac{0.012345679012345678}{x \cdot x}}{\frac{-0.1111111111111111}{x} + -1}\\
\end{array}
\end{array}
if y < 1.00000000000000004e154Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.6%
fma-def99.6%
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 72.2%
add-sqr-sqrt0.0%
sqrt-unprod42.2%
frac-times42.2%
metadata-eval42.2%
metadata-eval42.2%
frac-times42.2%
pow142.2%
pow142.2%
pow-prod-up42.2%
metadata-eval42.2%
associate-/r*42.2%
*-commutative42.2%
metadata-eval42.2%
pow242.2%
sqrt-unprod40.3%
add-sqr-sqrt40.3%
inv-pow40.3%
Applied egg-rr40.3%
unpow-140.3%
*-commutative40.3%
associate-/r*40.3%
metadata-eval40.3%
metadata-eval40.3%
associate-*r/40.3%
clear-num40.3%
un-div-inv40.3%
clear-num40.3%
add-sqr-sqrt0.0%
sqrt-unprod53.3%
sqr-neg53.3%
mul-1-neg53.3%
mul-1-neg53.3%
sqrt-unprod72.1%
add-sqr-sqrt72.2%
associate-*r/72.2%
metadata-eval72.2%
clear-num72.2%
div-inv72.2%
metadata-eval72.2%
Applied egg-rr72.2%
if 1.00000000000000004e154 < y Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.5%
fma-def99.5%
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 4.1%
add-sqr-sqrt0.0%
sqrt-unprod0.5%
frac-times0.5%
metadata-eval0.5%
metadata-eval0.5%
frac-times0.5%
pow10.5%
pow10.5%
pow-prod-up0.5%
metadata-eval0.5%
associate-/r*0.5%
*-commutative0.5%
metadata-eval0.5%
pow20.5%
sqrt-unprod0.6%
add-sqr-sqrt0.6%
frac-2neg0.6%
metadata-eval0.6%
div-inv0.6%
distribute-rgt-neg-in0.6%
metadata-eval0.6%
metadata-eval0.6%
div-inv0.6%
clear-num0.6%
Applied egg-rr0.6%
+-commutative0.6%
flip-+0.5%
mul-1-neg0.5%
mul-1-neg0.5%
sqr-neg0.5%
div-inv0.5%
div-inv0.5%
swap-sqr0.5%
metadata-eval0.5%
inv-pow0.5%
inv-pow0.5%
pow-prod-up0.5%
metadata-eval0.5%
metadata-eval0.5%
Applied egg-rr29.0%
Taylor expanded in x around 0 29.0%
unpow229.0%
Simplified29.0%
Final simplification67.2%
(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.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.6%
fma-def99.6%
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 64.2%
add-sqr-sqrt0.0%
sqrt-unprod37.3%
frac-times37.3%
metadata-eval37.3%
metadata-eval37.3%
frac-times37.3%
pow137.3%
pow137.3%
pow-prod-up37.3%
metadata-eval37.3%
associate-/r*37.3%
*-commutative37.3%
metadata-eval37.3%
pow237.3%
sqrt-unprod35.6%
add-sqr-sqrt35.6%
inv-pow35.6%
Applied egg-rr35.6%
unpow-135.6%
*-commutative35.6%
associate-/r*35.6%
metadata-eval35.6%
metadata-eval35.6%
associate-*r/35.6%
clear-num35.6%
un-div-inv35.6%
clear-num35.6%
add-sqr-sqrt0.0%
sqrt-unprod50.5%
sqr-neg50.5%
mul-1-neg50.5%
mul-1-neg50.5%
sqrt-unprod64.1%
add-sqr-sqrt64.2%
associate-*r/64.2%
metadata-eval64.2%
clear-num64.2%
div-inv64.3%
metadata-eval64.3%
Applied egg-rr64.3%
Final simplification64.3%
(FPCore (x y) :precision binary64 (if (<= x 4.5e-7) (/ -0.1111111111111111 x) 1.0))
double code(double x, double y) {
double tmp;
if (x <= 4.5e-7) {
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 <= 4.5d-7) 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 <= 4.5e-7) {
tmp = -0.1111111111111111 / x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 4.5e-7: tmp = -0.1111111111111111 / x else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 4.5e-7) tmp = Float64(-0.1111111111111111 / x); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 4.5e-7) tmp = -0.1111111111111111 / x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 4.5e-7], N[(-0.1111111111111111 / x), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.5 \cdot 10^{-7}:\\
\;\;\;\;\frac{-0.1111111111111111}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < 4.4999999999999998e-7Initial program 99.5%
associate--l-99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
distribute-neg-frac99.5%
neg-mul-199.5%
*-commutative99.5%
associate-*r/99.5%
fma-def99.5%
associate-/r*99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.5%
distribute-neg-frac99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 60.1%
add-sqr-sqrt0.0%
sqrt-unprod5.2%
frac-times5.2%
metadata-eval5.2%
metadata-eval5.2%
frac-times5.2%
pow15.2%
pow15.2%
pow-prod-up5.2%
metadata-eval5.2%
associate-/r*5.2%
*-commutative5.2%
metadata-eval5.2%
pow25.2%
sqrt-unprod1.6%
add-sqr-sqrt1.6%
frac-2neg1.6%
metadata-eval1.6%
div-inv1.6%
distribute-rgt-neg-in1.6%
metadata-eval1.6%
metadata-eval1.6%
div-inv1.6%
clear-num1.6%
Applied egg-rr1.6%
+-commutative1.6%
flip-+5.2%
mul-1-neg5.2%
mul-1-neg5.2%
sqr-neg5.2%
div-inv5.2%
div-inv5.2%
swap-sqr5.2%
metadata-eval5.2%
inv-pow5.2%
inv-pow5.2%
pow-prod-up5.2%
metadata-eval5.2%
metadata-eval5.2%
Applied egg-rr31.7%
Taylor expanded in x around 0 59.4%
if 4.4999999999999998e-7 < x Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.8%
fma-def99.8%
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 68.1%
add-sqr-sqrt0.0%
sqrt-unprod67.5%
frac-times67.5%
metadata-eval67.5%
metadata-eval67.5%
frac-times67.5%
pow167.5%
pow167.5%
pow-prod-up67.5%
metadata-eval67.5%
associate-/r*67.5%
*-commutative67.5%
metadata-eval67.5%
pow267.5%
sqrt-unprod67.5%
add-sqr-sqrt67.5%
frac-2neg67.5%
metadata-eval67.5%
div-inv67.5%
distribute-rgt-neg-in67.5%
metadata-eval67.5%
metadata-eval67.5%
div-inv67.5%
clear-num67.5%
Applied egg-rr67.5%
Taylor expanded in x around inf 67.5%
Final simplification63.6%
(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.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.6%
fma-def99.6%
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 64.2%
Final simplification64.2%
(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.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.6%
fma-def99.6%
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 64.2%
add-sqr-sqrt0.0%
sqrt-unprod37.3%
frac-times37.3%
metadata-eval37.3%
metadata-eval37.3%
frac-times37.3%
pow137.3%
pow137.3%
pow-prod-up37.3%
metadata-eval37.3%
associate-/r*37.3%
*-commutative37.3%
metadata-eval37.3%
pow237.3%
sqrt-unprod35.6%
add-sqr-sqrt35.6%
frac-2neg35.6%
metadata-eval35.6%
div-inv35.6%
distribute-rgt-neg-in35.6%
metadata-eval35.6%
metadata-eval35.6%
div-inv35.6%
clear-num35.6%
Applied egg-rr35.6%
Taylor expanded in x around inf 35.5%
Final simplification35.5%
(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 2023230
(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)))))