
(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 9 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 (* 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}
Initial program 99.7%
Final simplification99.7%
(FPCore (x y)
:precision binary64
(if (<= y -1.1e+83)
(+ 1.0 (* -0.3333333333333333 (/ y (sqrt x))))
(if (<= y 9e+38)
(- 1.0 (pow (* x 9.0) -1.0))
(+ 1.0 (/ (pow x -0.5) (/ -3.0 y))))))
double code(double x, double y) {
double tmp;
if (y <= -1.1e+83) {
tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x)));
} else if (y <= 9e+38) {
tmp = 1.0 - pow((x * 9.0), -1.0);
} else {
tmp = 1.0 + (pow(x, -0.5) / (-3.0 / y));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.1d+83)) then
tmp = 1.0d0 + ((-0.3333333333333333d0) * (y / sqrt(x)))
else if (y <= 9d+38) then
tmp = 1.0d0 - ((x * 9.0d0) ** (-1.0d0))
else
tmp = 1.0d0 + ((x ** (-0.5d0)) / ((-3.0d0) / y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.1e+83) {
tmp = 1.0 + (-0.3333333333333333 * (y / Math.sqrt(x)));
} else if (y <= 9e+38) {
tmp = 1.0 - Math.pow((x * 9.0), -1.0);
} else {
tmp = 1.0 + (Math.pow(x, -0.5) / (-3.0 / y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.1e+83: tmp = 1.0 + (-0.3333333333333333 * (y / math.sqrt(x))) elif y <= 9e+38: tmp = 1.0 - math.pow((x * 9.0), -1.0) else: tmp = 1.0 + (math.pow(x, -0.5) / (-3.0 / y)) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.1e+83) tmp = Float64(1.0 + Float64(-0.3333333333333333 * Float64(y / sqrt(x)))); elseif (y <= 9e+38) tmp = Float64(1.0 - (Float64(x * 9.0) ^ -1.0)); else tmp = Float64(1.0 + Float64((x ^ -0.5) / Float64(-3.0 / y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.1e+83) tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x))); elseif (y <= 9e+38) tmp = 1.0 - ((x * 9.0) ^ -1.0); else tmp = 1.0 + ((x ^ -0.5) / (-3.0 / y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.1e+83], N[(1.0 + N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+38], N[(1.0 - N[Power[N[(x * 9.0), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Power[x, -0.5], $MachinePrecision] / N[(-3.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+83}:\\
\;\;\;\;1 + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+38}:\\
\;\;\;\;1 - {\left(x \cdot 9\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{{x}^{-0.5}}{\frac{-3}{y}}\\
\end{array}
\end{array}
if y < -1.09999999999999999e83Initial program 99.5%
associate--l-99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
distribute-frac-neg99.5%
sub-neg99.5%
neg-mul-199.5%
*-commutative99.5%
associate-/l*99.5%
fmm-def99.5%
associate-/r*99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 99.4%
associate-*r*99.5%
*-commutative99.5%
associate-*l*99.5%
Simplified99.5%
add-log-exp15.5%
*-un-lft-identity15.5%
log-prod15.5%
metadata-eval15.5%
add-log-exp99.5%
*-commutative99.5%
associate-*r*99.4%
sqrt-div99.6%
metadata-eval99.6%
un-div-inv99.6%
Applied egg-rr99.6%
+-lft-identity99.6%
Simplified99.6%
if -1.09999999999999999e83 < y < 8.99999999999999961e38Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
fmm-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 98.0%
add-sqr-sqrt0.0%
sqrt-unprod43.4%
frac-times43.4%
metadata-eval43.4%
metadata-eval43.4%
frac-times43.4%
clear-num43.4%
clear-num43.4%
frac-times43.4%
div-inv43.4%
metadata-eval43.4%
div-inv43.4%
metadata-eval43.4%
frac-times43.4%
sqrt-unprod43.5%
add-sqr-sqrt43.5%
metadata-eval43.5%
div-inv43.5%
frac-2neg43.5%
metadata-eval43.5%
clear-num43.5%
distribute-frac-neg243.5%
Applied egg-rr43.5%
add-sqr-sqrt0.0%
sqrt-unprod71.2%
frac-times71.2%
metadata-eval71.2%
metadata-eval71.2%
frac-times71.2%
clear-num71.2%
clear-num71.2%
frac-times71.1%
div-inv71.2%
metadata-eval71.2%
div-inv71.2%
metadata-eval71.2%
frac-times71.2%
sqrt-unprod97.8%
add-sqr-sqrt98.1%
inv-pow98.1%
Applied egg-rr98.1%
if 8.99999999999999961e38 < y Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-frac-neg99.7%
sub-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
fmm-def99.7%
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 inf 94.6%
associate-*r*94.6%
*-commutative94.6%
associate-*l*94.6%
Simplified94.6%
add-log-exp27.8%
*-un-lft-identity27.8%
log-prod27.8%
metadata-eval27.8%
add-log-exp94.6%
*-commutative94.6%
associate-*r*94.6%
sqrt-div94.5%
metadata-eval94.5%
un-div-inv94.7%
Applied egg-rr94.7%
+-lft-identity94.7%
Simplified94.7%
clear-num94.5%
un-div-inv94.6%
Applied egg-rr94.6%
associate-/r/94.6%
Simplified94.6%
associate-*l/94.6%
clear-num94.5%
div-inv94.4%
associate-/r*94.7%
pow1/294.7%
pow-flip94.7%
metadata-eval94.7%
associate-/r*94.8%
metadata-eval94.8%
Applied egg-rr94.8%
Final simplification97.6%
(FPCore (x y) :precision binary64 (if (or (<= y -9.2e+82) (not (<= y 9.5e+37))) (+ 1.0 (* -0.3333333333333333 (/ y (sqrt x)))) (- 1.0 (pow (* x 9.0) -1.0))))
double code(double x, double y) {
double tmp;
if ((y <= -9.2e+82) || !(y <= 9.5e+37)) {
tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x)));
} else {
tmp = 1.0 - pow((x * 9.0), -1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-9.2d+82)) .or. (.not. (y <= 9.5d+37))) then
tmp = 1.0d0 + ((-0.3333333333333333d0) * (y / sqrt(x)))
else
tmp = 1.0d0 - ((x * 9.0d0) ** (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -9.2e+82) || !(y <= 9.5e+37)) {
tmp = 1.0 + (-0.3333333333333333 * (y / Math.sqrt(x)));
} else {
tmp = 1.0 - Math.pow((x * 9.0), -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -9.2e+82) or not (y <= 9.5e+37): tmp = 1.0 + (-0.3333333333333333 * (y / math.sqrt(x))) else: tmp = 1.0 - math.pow((x * 9.0), -1.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= -9.2e+82) || !(y <= 9.5e+37)) tmp = Float64(1.0 + Float64(-0.3333333333333333 * Float64(y / sqrt(x)))); else tmp = Float64(1.0 - (Float64(x * 9.0) ^ -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -9.2e+82) || ~((y <= 9.5e+37))) tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x))); else tmp = 1.0 - ((x * 9.0) ^ -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -9.2e+82], N[Not[LessEqual[y, 9.5e+37]], $MachinePrecision]], N[(1.0 + N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[Power[N[(x * 9.0), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{+82} \lor \neg \left(y \leq 9.5 \cdot 10^{+37}\right):\\
\;\;\;\;1 + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 - {\left(x \cdot 9\right)}^{-1}\\
\end{array}
\end{array}
if y < -9.19999999999999953e82 or 9.4999999999999995e37 < y Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-frac-neg99.6%
sub-neg99.6%
neg-mul-199.6%
*-commutative99.6%
associate-/l*99.6%
fmm-def99.6%
associate-/r*99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 96.8%
associate-*r*96.8%
*-commutative96.8%
associate-*l*96.8%
Simplified96.8%
add-log-exp22.2%
*-un-lft-identity22.2%
log-prod22.2%
metadata-eval22.2%
add-log-exp96.8%
*-commutative96.8%
associate-*r*96.8%
sqrt-div96.8%
metadata-eval96.8%
un-div-inv96.9%
Applied egg-rr96.9%
+-lft-identity96.9%
Simplified96.9%
if -9.19999999999999953e82 < y < 9.4999999999999995e37Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
fmm-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 98.0%
add-sqr-sqrt0.0%
sqrt-unprod43.4%
frac-times43.4%
metadata-eval43.4%
metadata-eval43.4%
frac-times43.4%
clear-num43.4%
clear-num43.4%
frac-times43.4%
div-inv43.4%
metadata-eval43.4%
div-inv43.4%
metadata-eval43.4%
frac-times43.4%
sqrt-unprod43.5%
add-sqr-sqrt43.5%
metadata-eval43.5%
div-inv43.5%
frac-2neg43.5%
metadata-eval43.5%
clear-num43.5%
distribute-frac-neg243.5%
Applied egg-rr43.5%
add-sqr-sqrt0.0%
sqrt-unprod71.2%
frac-times71.2%
metadata-eval71.2%
metadata-eval71.2%
frac-times71.2%
clear-num71.2%
clear-num71.2%
frac-times71.1%
div-inv71.2%
metadata-eval71.2%
div-inv71.2%
metadata-eval71.2%
frac-times71.2%
sqrt-unprod97.8%
add-sqr-sqrt98.1%
inv-pow98.1%
Applied egg-rr98.1%
Final simplification97.6%
(FPCore (x y)
:precision binary64
(if (<= y -9.2e+82)
(+ 1.0 (* -0.3333333333333333 (/ y (sqrt x))))
(if (<= y 2.8e+38)
(- 1.0 (pow (* x 9.0) -1.0))
(+ 1.0 (/ y (* (sqrt x) -3.0))))))
double code(double x, double y) {
double tmp;
if (y <= -9.2e+82) {
tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x)));
} else if (y <= 2.8e+38) {
tmp = 1.0 - pow((x * 9.0), -1.0);
} else {
tmp = 1.0 + (y / (sqrt(x) * -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 <= (-9.2d+82)) then
tmp = 1.0d0 + ((-0.3333333333333333d0) * (y / sqrt(x)))
else if (y <= 2.8d+38) then
tmp = 1.0d0 - ((x * 9.0d0) ** (-1.0d0))
else
tmp = 1.0d0 + (y / (sqrt(x) * (-3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -9.2e+82) {
tmp = 1.0 + (-0.3333333333333333 * (y / Math.sqrt(x)));
} else if (y <= 2.8e+38) {
tmp = 1.0 - Math.pow((x * 9.0), -1.0);
} else {
tmp = 1.0 + (y / (Math.sqrt(x) * -3.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -9.2e+82: tmp = 1.0 + (-0.3333333333333333 * (y / math.sqrt(x))) elif y <= 2.8e+38: tmp = 1.0 - math.pow((x * 9.0), -1.0) else: tmp = 1.0 + (y / (math.sqrt(x) * -3.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= -9.2e+82) tmp = Float64(1.0 + Float64(-0.3333333333333333 * Float64(y / sqrt(x)))); elseif (y <= 2.8e+38) tmp = Float64(1.0 - (Float64(x * 9.0) ^ -1.0)); else tmp = Float64(1.0 + Float64(y / Float64(sqrt(x) * -3.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -9.2e+82) tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x))); elseif (y <= 2.8e+38) tmp = 1.0 - ((x * 9.0) ^ -1.0); else tmp = 1.0 + (y / (sqrt(x) * -3.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -9.2e+82], N[(1.0 + N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+38], N[(1.0 - N[Power[N[(x * 9.0), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y / N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{+82}:\\
\;\;\;\;1 + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+38}:\\
\;\;\;\;1 - {\left(x \cdot 9\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{y}{\sqrt{x} \cdot -3}\\
\end{array}
\end{array}
if y < -9.19999999999999953e82Initial program 99.5%
associate--l-99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
distribute-frac-neg99.5%
sub-neg99.5%
neg-mul-199.5%
*-commutative99.5%
associate-/l*99.5%
fmm-def99.5%
associate-/r*99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 99.4%
associate-*r*99.5%
*-commutative99.5%
associate-*l*99.5%
Simplified99.5%
add-log-exp15.5%
*-un-lft-identity15.5%
log-prod15.5%
metadata-eval15.5%
add-log-exp99.5%
*-commutative99.5%
associate-*r*99.4%
sqrt-div99.6%
metadata-eval99.6%
un-div-inv99.6%
Applied egg-rr99.6%
+-lft-identity99.6%
Simplified99.6%
if -9.19999999999999953e82 < y < 2.8e38Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
fmm-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 98.0%
add-sqr-sqrt0.0%
sqrt-unprod43.4%
frac-times43.4%
metadata-eval43.4%
metadata-eval43.4%
frac-times43.4%
clear-num43.4%
clear-num43.4%
frac-times43.4%
div-inv43.4%
metadata-eval43.4%
div-inv43.4%
metadata-eval43.4%
frac-times43.4%
sqrt-unprod43.5%
add-sqr-sqrt43.5%
metadata-eval43.5%
div-inv43.5%
frac-2neg43.5%
metadata-eval43.5%
clear-num43.5%
distribute-frac-neg243.5%
Applied egg-rr43.5%
add-sqr-sqrt0.0%
sqrt-unprod71.2%
frac-times71.2%
metadata-eval71.2%
metadata-eval71.2%
frac-times71.2%
clear-num71.2%
clear-num71.2%
frac-times71.1%
div-inv71.2%
metadata-eval71.2%
div-inv71.2%
metadata-eval71.2%
frac-times71.2%
sqrt-unprod97.8%
add-sqr-sqrt98.1%
inv-pow98.1%
Applied egg-rr98.1%
if 2.8e38 < y Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-frac-neg99.7%
sub-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
fmm-def99.7%
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 inf 94.6%
associate-*r*94.6%
*-commutative94.6%
associate-*l*94.6%
Simplified94.6%
add-log-exp27.8%
*-un-lft-identity27.8%
log-prod27.8%
metadata-eval27.8%
add-log-exp94.6%
*-commutative94.6%
associate-*r*94.6%
sqrt-div94.5%
metadata-eval94.5%
un-div-inv94.7%
Applied egg-rr94.7%
+-lft-identity94.7%
Simplified94.7%
*-commutative94.7%
associate-*l/94.6%
associate-*r/94.6%
clear-num94.6%
un-div-inv94.6%
div-inv94.8%
metadata-eval94.8%
Applied egg-rr94.8%
Final simplification97.6%
(FPCore (x y) :precision binary64 (if (<= x 1.15e+25) (+ 1.0 (/ (- (* -0.3333333333333333 (* y (sqrt x))) 0.1111111111111111) x)) (+ 1.0 (* y (/ -0.3333333333333333 (sqrt x))))))
double code(double x, double y) {
double tmp;
if (x <= 1.15e+25) {
tmp = 1.0 + (((-0.3333333333333333 * (y * sqrt(x))) - 0.1111111111111111) / x);
} 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 (x <= 1.15d+25) then
tmp = 1.0d0 + ((((-0.3333333333333333d0) * (y * sqrt(x))) - 0.1111111111111111d0) / x)
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 (x <= 1.15e+25) {
tmp = 1.0 + (((-0.3333333333333333 * (y * Math.sqrt(x))) - 0.1111111111111111) / x);
} else {
tmp = 1.0 + (y * (-0.3333333333333333 / Math.sqrt(x)));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.15e+25: tmp = 1.0 + (((-0.3333333333333333 * (y * math.sqrt(x))) - 0.1111111111111111) / x) else: tmp = 1.0 + (y * (-0.3333333333333333 / math.sqrt(x))) return tmp
function code(x, y) tmp = 0.0 if (x <= 1.15e+25) tmp = Float64(1.0 + Float64(Float64(Float64(-0.3333333333333333 * Float64(y * sqrt(x))) - 0.1111111111111111) / x)); else tmp = Float64(1.0 + Float64(y * Float64(-0.3333333333333333 / sqrt(x)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.15e+25) tmp = 1.0 + (((-0.3333333333333333 * (y * sqrt(x))) - 0.1111111111111111) / x); else tmp = 1.0 + (y * (-0.3333333333333333 / sqrt(x))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.15e+25], N[(1.0 + N[(N[(N[(-0.3333333333333333 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.1111111111111111), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * N[(-0.3333333333333333 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.15 \cdot 10^{+25}:\\
\;\;\;\;1 + \frac{-0.3333333333333333 \cdot \left(y \cdot \sqrt{x}\right) - 0.1111111111111111}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot \frac{-0.3333333333333333}{\sqrt{x}}\\
\end{array}
\end{array}
if x < 1.1499999999999999e25Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-frac-neg99.6%
sub-neg99.6%
neg-mul-199.6%
*-commutative99.6%
associate-/l*99.6%
fmm-def99.6%
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 x around 0 99.4%
if 1.1499999999999999e25 < x Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
fmm-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 inf 99.7%
associate-*r*99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
add-log-exp59.7%
*-un-lft-identity59.7%
log-prod59.7%
metadata-eval59.7%
add-log-exp99.8%
*-commutative99.8%
associate-*r*99.7%
sqrt-div99.8%
metadata-eval99.8%
un-div-inv99.8%
Applied egg-rr99.8%
+-lft-identity99.8%
Simplified99.8%
clear-num99.7%
un-div-inv99.7%
Applied egg-rr99.7%
associate-/r/99.8%
Simplified99.8%
Final simplification99.6%
(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.6%
metadata-eval99.6%
Simplified99.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 (- 1.0 (pow (* x 9.0) -1.0)))
double code(double x, double y) {
return 1.0 - pow((x * 9.0), -1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 - ((x * 9.0d0) ** (-1.0d0))
end function
public static double code(double x, double y) {
return 1.0 - Math.pow((x * 9.0), -1.0);
}
def code(x, y): return 1.0 - math.pow((x * 9.0), -1.0)
function code(x, y) return Float64(1.0 - (Float64(x * 9.0) ^ -1.0)) end
function tmp = code(x, y) tmp = 1.0 - ((x * 9.0) ^ -1.0); end
code[x_, y_] := N[(1.0 - N[Power[N[(x * 9.0), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - {\left(x \cdot 9\right)}^{-1}
\end{array}
Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-frac-neg99.7%
sub-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
fmm-def99.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 63.1%
add-sqr-sqrt0.0%
sqrt-unprod30.1%
frac-times30.1%
metadata-eval30.1%
metadata-eval30.1%
frac-times30.1%
clear-num30.1%
clear-num30.1%
frac-times30.1%
div-inv30.1%
metadata-eval30.1%
div-inv30.1%
metadata-eval30.1%
frac-times30.1%
sqrt-unprod29.0%
add-sqr-sqrt29.0%
metadata-eval29.0%
div-inv29.0%
frac-2neg29.0%
metadata-eval29.0%
clear-num29.0%
distribute-frac-neg229.0%
Applied egg-rr29.0%
add-sqr-sqrt0.0%
sqrt-unprod49.0%
frac-times49.0%
metadata-eval49.0%
metadata-eval49.0%
frac-times49.0%
clear-num49.0%
clear-num49.0%
frac-times49.0%
div-inv49.0%
metadata-eval49.0%
div-inv49.0%
metadata-eval49.0%
frac-times49.0%
sqrt-unprod63.0%
add-sqr-sqrt63.1%
inv-pow63.1%
Applied egg-rr63.1%
Final simplification63.1%
(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%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-frac-neg99.7%
sub-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
fmm-def99.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 63.1%
Final simplification63.1%
(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 2024130
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, D"
:precision binary64
:alt
(- (- 1.0 (/ (/ 1.0 x) 9.0)) (/ y (* 3.0 (sqrt x))))
(- (- 1.0 (/ 1.0 (* x 9.0))) (/ y (* 3.0 (sqrt x)))))