
(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 10 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.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(if (<= y -1.05e+36)
(+ 1.0 (* y (/ -0.3333333333333333 (sqrt x))))
(if (<= y 1.85e+42)
(- 1.0 (pow (* x 9.0) -1.0))
(+ 1.0 (* (/ 1.0 (sqrt x)) (* y -0.3333333333333333))))))
double code(double x, double y) {
double tmp;
if (y <= -1.05e+36) {
tmp = 1.0 + (y * (-0.3333333333333333 / sqrt(x)));
} else if (y <= 1.85e+42) {
tmp = 1.0 - pow((x * 9.0), -1.0);
} else {
tmp = 1.0 + ((1.0 / sqrt(x)) * (y * -0.3333333333333333));
}
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 * ((-0.3333333333333333d0) / sqrt(x)))
else if (y <= 1.85d+42) then
tmp = 1.0d0 - ((x * 9.0d0) ** (-1.0d0))
else
tmp = 1.0d0 + ((1.0d0 / sqrt(x)) * (y * (-0.3333333333333333d0)))
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 * (-0.3333333333333333 / Math.sqrt(x)));
} else if (y <= 1.85e+42) {
tmp = 1.0 - Math.pow((x * 9.0), -1.0);
} else {
tmp = 1.0 + ((1.0 / Math.sqrt(x)) * (y * -0.3333333333333333));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.05e+36: tmp = 1.0 + (y * (-0.3333333333333333 / math.sqrt(x))) elif y <= 1.85e+42: tmp = 1.0 - math.pow((x * 9.0), -1.0) else: tmp = 1.0 + ((1.0 / math.sqrt(x)) * (y * -0.3333333333333333)) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.05e+36) tmp = Float64(1.0 + Float64(y * Float64(-0.3333333333333333 / sqrt(x)))); elseif (y <= 1.85e+42) tmp = Float64(1.0 - (Float64(x * 9.0) ^ -1.0)); else tmp = Float64(1.0 + Float64(Float64(1.0 / sqrt(x)) * Float64(y * -0.3333333333333333))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.05e+36) tmp = 1.0 + (y * (-0.3333333333333333 / sqrt(x))); elseif (y <= 1.85e+42) tmp = 1.0 - ((x * 9.0) ^ -1.0); else tmp = 1.0 + ((1.0 / sqrt(x)) * (y * -0.3333333333333333)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.05e+36], N[(1.0 + N[(y * N[(-0.3333333333333333 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e+42], N[(1.0 - N[Power[N[(x * 9.0), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(1.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(y * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+36}:\\
\;\;\;\;1 + y \cdot \frac{-0.3333333333333333}{\sqrt{x}}\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{+42}:\\
\;\;\;\;1 - {\left(x \cdot 9\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{1}{\sqrt{x}} \cdot \left(y \cdot -0.3333333333333333\right)\\
\end{array}
\end{array}
if y < -1.05000000000000002e36Initial 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.4%
fma-neg99.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 97.7%
associate-*r*97.6%
*-commutative97.6%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in x around 0 97.7%
associate-*r*97.6%
Simplified97.6%
sqrt-div97.6%
metadata-eval97.6%
div-inv97.8%
Applied egg-rr97.8%
if -1.05000000000000002e36 < y < 1.84999999999999998e42Initial program 99.9%
associate--l-99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
distribute-frac-neg99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*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 98.4%
add-sqr-sqrt0.0%
sqrt-unprod52.4%
frac-times52.4%
metadata-eval52.4%
metadata-eval52.4%
frac-times52.4%
clear-num52.4%
clear-num52.4%
frac-times52.4%
div-inv52.4%
metadata-eval52.4%
div-inv52.4%
metadata-eval52.4%
frac-times52.4%
sqrt-unprod52.4%
add-sqr-sqrt52.4%
metadata-eval52.4%
div-inv52.4%
frac-2neg52.4%
metadata-eval52.4%
clear-num52.4%
distribute-frac-neg252.4%
Applied egg-rr52.4%
add-sqr-sqrt0.0%
sqrt-unprod75.0%
frac-times75.0%
metadata-eval75.0%
metadata-eval75.0%
frac-times75.0%
clear-num75.0%
clear-num75.0%
frac-times75.0%
div-inv75.0%
metadata-eval75.0%
div-inv75.0%
metadata-eval75.0%
frac-times75.0%
sqrt-unprod98.3%
add-sqr-sqrt98.6%
inv-pow98.6%
Applied egg-rr98.6%
if 1.84999999999999998e42 < y 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.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 97.5%
associate-*r*97.6%
*-commutative97.6%
associate-*l*97.6%
Simplified97.6%
sqrt-div97.7%
metadata-eval97.7%
Applied egg-rr97.7%
Final simplification98.2%
(FPCore (x y) :precision binary64 (if (or (<= y -1.9e+38) (not (<= y 2.95e+44))) (+ 1.0 (* y (/ -0.3333333333333333 (sqrt x)))) (- 1.0 (pow (* x 9.0) -1.0))))
double code(double x, double y) {
double tmp;
if ((y <= -1.9e+38) || !(y <= 2.95e+44)) {
tmp = 1.0 + (y * (-0.3333333333333333 / 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 <= (-1.9d+38)) .or. (.not. (y <= 2.95d+44))) then
tmp = 1.0d0 + (y * ((-0.3333333333333333d0) / 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 <= -1.9e+38) || !(y <= 2.95e+44)) {
tmp = 1.0 + (y * (-0.3333333333333333 / Math.sqrt(x)));
} else {
tmp = 1.0 - Math.pow((x * 9.0), -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.9e+38) or not (y <= 2.95e+44): tmp = 1.0 + (y * (-0.3333333333333333 / 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 <= -1.9e+38) || !(y <= 2.95e+44)) tmp = Float64(1.0 + Float64(y * Float64(-0.3333333333333333 / 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 <= -1.9e+38) || ~((y <= 2.95e+44))) tmp = 1.0 + (y * (-0.3333333333333333 / sqrt(x))); else tmp = 1.0 - ((x * 9.0) ^ -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.9e+38], N[Not[LessEqual[y, 2.95e+44]], $MachinePrecision]], N[(1.0 + N[(y * N[(-0.3333333333333333 / 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 -1.9 \cdot 10^{+38} \lor \neg \left(y \leq 2.95 \cdot 10^{+44}\right):\\
\;\;\;\;1 + y \cdot \frac{-0.3333333333333333}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 - {\left(x \cdot 9\right)}^{-1}\\
\end{array}
\end{array}
if y < -1.8999999999999999e38 or 2.94999999999999982e44 < 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.5%
fma-neg99.5%
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 97.6%
associate-*r*97.6%
*-commutative97.6%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in x around 0 97.6%
associate-*r*97.6%
Simplified97.6%
sqrt-div97.6%
metadata-eval97.6%
div-inv97.8%
Applied egg-rr97.8%
if -1.8999999999999999e38 < y < 2.94999999999999982e44Initial program 99.9%
associate--l-99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
distribute-frac-neg99.9%
sub-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*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 98.4%
add-sqr-sqrt0.0%
sqrt-unprod52.4%
frac-times52.4%
metadata-eval52.4%
metadata-eval52.4%
frac-times52.4%
clear-num52.4%
clear-num52.4%
frac-times52.4%
div-inv52.4%
metadata-eval52.4%
div-inv52.4%
metadata-eval52.4%
frac-times52.4%
sqrt-unprod52.4%
add-sqr-sqrt52.4%
metadata-eval52.4%
div-inv52.4%
frac-2neg52.4%
metadata-eval52.4%
clear-num52.4%
distribute-frac-neg252.4%
Applied egg-rr52.4%
add-sqr-sqrt0.0%
sqrt-unprod75.0%
frac-times75.0%
metadata-eval75.0%
metadata-eval75.0%
frac-times75.0%
clear-num75.0%
clear-num75.0%
frac-times75.0%
div-inv75.0%
metadata-eval75.0%
div-inv75.0%
metadata-eval75.0%
frac-times75.0%
sqrt-unprod98.3%
add-sqr-sqrt98.6%
inv-pow98.6%
Applied egg-rr98.6%
Final simplification98.2%
(FPCore (x y) :precision binary64 (if (<= x 1400000000000.0) (+ 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 <= 1400000000000.0) {
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 <= 1400000000000.0d0) 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 <= 1400000000000.0) {
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 <= 1400000000000.0: 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 <= 1400000000000.0) 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 <= 1400000000000.0) 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, 1400000000000.0], 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 1400000000000:\\
\;\;\;\;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.4e12Initial 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.6%
fma-neg99.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.3%
if 1.4e12 < 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%
fma-neg99.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.6%
*-commutative99.6%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*r*99.6%
Simplified99.6%
sqrt-div99.7%
metadata-eval99.7%
div-inv99.8%
Applied egg-rr99.8%
Final simplification99.5%
(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.8%
sub-neg99.8%
*-commutative99.8%
associate-/r*99.7%
metadata-eval99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y) :precision binary64 (+ (- 1.0 (/ 0.1111111111111111 x)) (/ -0.3333333333333333 (/ (sqrt x) y))))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 / (sqrt(x) / y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (0.1111111111111111d0 / x)) + ((-0.3333333333333333d0) / (sqrt(x) / y))
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 / (Math.sqrt(x) / y));
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 / (math.sqrt(x) / y))
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) + Float64(-0.3333333333333333 / Float64(sqrt(x) / y))) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 / (sqrt(x) / y)); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] + N[(-0.3333333333333333 / N[(N[Sqrt[x], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) + \frac{-0.3333333333333333}{\frac{\sqrt{x}}{y}}
\end{array}
Initial program 99.8%
sub-neg99.8%
*-commutative99.8%
associate-/r*99.7%
metadata-eval99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
clear-num99.5%
un-div-inv99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x y) :precision binary64 (- (- 1.0 (/ 0.1111111111111111 x)) (/ y (sqrt (* x 9.0)))))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y / sqrt((x * 9.0)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (0.1111111111111111d0 / x)) - (y / sqrt((x * 9.0d0)))
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y / Math.sqrt((x * 9.0)));
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) - (y / math.sqrt((x * 9.0)))
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) - Float64(y / sqrt(Float64(x * 9.0)))) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) - (y / sqrt((x * 9.0))); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] - N[(y / N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) - \frac{y}{\sqrt{x \cdot 9}}
\end{array}
Initial program 99.8%
Taylor expanded in x around 0 99.7%
*-commutative99.7%
metadata-eval99.7%
sqrt-prod99.7%
pow199.7%
Applied egg-rr99.7%
unpow199.7%
Simplified99.7%
Final simplification99.7%
(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.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.7%
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 58.9%
add-sqr-sqrt0.0%
sqrt-unprod34.3%
frac-times34.3%
metadata-eval34.3%
metadata-eval34.3%
frac-times34.3%
clear-num34.3%
clear-num34.3%
frac-times34.3%
div-inv34.3%
metadata-eval34.3%
div-inv34.3%
metadata-eval34.3%
frac-times34.3%
sqrt-unprod32.1%
add-sqr-sqrt32.1%
metadata-eval32.1%
div-inv32.1%
frac-2neg32.1%
metadata-eval32.1%
clear-num32.1%
distribute-frac-neg232.1%
Applied egg-rr32.1%
add-sqr-sqrt0.0%
sqrt-unprod47.0%
frac-times47.0%
metadata-eval47.0%
metadata-eval47.0%
frac-times47.0%
clear-num47.0%
clear-num47.0%
frac-times47.0%
div-inv47.1%
metadata-eval47.1%
div-inv47.1%
metadata-eval47.1%
frac-times47.1%
sqrt-unprod58.9%
add-sqr-sqrt59.0%
inv-pow59.0%
Applied egg-rr59.0%
Final simplification59.0%
(FPCore (x y) :precision binary64 (+ 1.0 (* (/ 1.0 x) -0.1111111111111111)))
double code(double x, double y) {
return 1.0 + ((1.0 / x) * -0.1111111111111111);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 + ((1.0d0 / x) * (-0.1111111111111111d0))
end function
public static double code(double x, double y) {
return 1.0 + ((1.0 / x) * -0.1111111111111111);
}
def code(x, y): return 1.0 + ((1.0 / x) * -0.1111111111111111)
function code(x, y) return Float64(1.0 + Float64(Float64(1.0 / x) * -0.1111111111111111)) end
function tmp = code(x, y) tmp = 1.0 + ((1.0 / x) * -0.1111111111111111); end
code[x_, y_] := N[(1.0 + N[(N[(1.0 / x), $MachinePrecision] * -0.1111111111111111), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{1}{x} \cdot -0.1111111111111111
\end{array}
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.7%
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 58.9%
clear-num58.9%
associate-/r/58.9%
Applied egg-rr58.9%
Final simplification58.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.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.7%
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 58.9%
Final simplification58.9%
(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 2024096
(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)))))