
(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 (sqrt x)) 3.0)))
double code(double x, double y) {
return (1.0 + (-1.0 / (x * 9.0))) - ((y / sqrt(x)) / 3.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 + ((-1.0d0) / (x * 9.0d0))) - ((y / sqrt(x)) / 3.0d0)
end function
public static double code(double x, double y) {
return (1.0 + (-1.0 / (x * 9.0))) - ((y / Math.sqrt(x)) / 3.0);
}
def code(x, y): return (1.0 + (-1.0 / (x * 9.0))) - ((y / math.sqrt(x)) / 3.0)
function code(x, y) return Float64(Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))) - Float64(Float64(y / sqrt(x)) / 3.0)) end
function tmp = code(x, y) tmp = (1.0 + (-1.0 / (x * 9.0))) - ((y / sqrt(x)) / 3.0); end
code[x_, y_] := N[(N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 + \frac{-1}{x \cdot 9}\right) - \frac{\frac{y}{\sqrt{x}}}{3}
\end{array}
Initial program 99.8%
*-commutative99.8%
associate-/r*99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(if (<= y -1.8e+38)
(+ 1.0 (* y (/ -0.3333333333333333 (sqrt x))))
(if (<= y 1.2e+53)
(+ 1.0 (/ -1.0 (* x 9.0)))
(+ 1.0 (* (/ 1.0 (sqrt x)) (* y -0.3333333333333333))))))
double code(double x, double y) {
double tmp;
if (y <= -1.8e+38) {
tmp = 1.0 + (y * (-0.3333333333333333 / sqrt(x)));
} else if (y <= 1.2e+53) {
tmp = 1.0 + (-1.0 / (x * 9.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.8d+38)) then
tmp = 1.0d0 + (y * ((-0.3333333333333333d0) / sqrt(x)))
else if (y <= 1.2d+53) then
tmp = 1.0d0 + ((-1.0d0) / (x * 9.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.8e+38) {
tmp = 1.0 + (y * (-0.3333333333333333 / Math.sqrt(x)));
} else if (y <= 1.2e+53) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = 1.0 + ((1.0 / Math.sqrt(x)) * (y * -0.3333333333333333));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.8e+38: tmp = 1.0 + (y * (-0.3333333333333333 / math.sqrt(x))) elif y <= 1.2e+53: tmp = 1.0 + (-1.0 / (x * 9.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.8e+38) tmp = Float64(1.0 + Float64(y * Float64(-0.3333333333333333 / sqrt(x)))); elseif (y <= 1.2e+53) tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.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.8e+38) tmp = 1.0 + (y * (-0.3333333333333333 / sqrt(x))); elseif (y <= 1.2e+53) tmp = 1.0 + (-1.0 / (x * 9.0)); else tmp = 1.0 + ((1.0 / sqrt(x)) * (y * -0.3333333333333333)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.8e+38], N[(1.0 + N[(y * N[(-0.3333333333333333 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+53], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $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.8 \cdot 10^{+38}:\\
\;\;\;\;1 + y \cdot \frac{-0.3333333333333333}{\sqrt{x}}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+53}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{1}{\sqrt{x}} \cdot \left(y \cdot -0.3333333333333333\right)\\
\end{array}
\end{array}
if y < -1.79999999999999985e38Initial 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%
*-commutative97.6%
*-commutative97.6%
Simplified97.6%
*-commutative97.6%
sqrt-div97.6%
metadata-eval97.6%
un-div-inv97.8%
Applied egg-rr97.8%
if -1.79999999999999985e38 < y < 1.2e53Initial 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%
clear-num52.4%
clear-num52.4%
frac-times52.4%
metadata-eval52.4%
metadata-eval52.4%
div-inv52.4%
metadata-eval52.4%
metadata-eval52.4%
distribute-rgt-neg-in52.4%
div-inv52.4%
metadata-eval52.4%
metadata-eval52.4%
distribute-rgt-neg-in52.4%
frac-times52.4%
metadata-eval52.4%
frac-2neg52.4%
metadata-eval52.4%
frac-2neg52.4%
sqrt-unprod52.4%
add-sqr-sqrt52.4%
frac-2neg52.4%
Applied egg-rr98.6%
if 1.2e53 < 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.55e+37) (not (<= y 4.8e+48))) (+ 1.0 (* y (/ -0.3333333333333333 (sqrt x)))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -1.55e+37) || !(y <= 4.8e+48)) {
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 <= (-1.55d+37)) .or. (.not. (y <= 4.8d+48))) 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 <= -1.55e+37) || !(y <= 4.8e+48)) {
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 <= -1.55e+37) or not (y <= 4.8e+48): 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 <= -1.55e+37) || !(y <= 4.8e+48)) tmp = Float64(1.0 + Float64(y * Float64(-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 <= -1.55e+37) || ~((y <= 4.8e+48))) 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, -1.55e+37], N[Not[LessEqual[y, 4.8e+48]], $MachinePrecision]], N[(1.0 + N[(y * N[(-0.3333333333333333 / 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.55 \cdot 10^{+37} \lor \neg \left(y \leq 4.8 \cdot 10^{+48}\right):\\
\;\;\;\;1 + y \cdot \frac{-0.3333333333333333}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -1.5500000000000001e37 or 4.8000000000000002e48 < 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%
*-commutative97.6%
*-commutative97.6%
Simplified97.6%
*-commutative97.6%
sqrt-div97.6%
metadata-eval97.6%
un-div-inv97.8%
Applied egg-rr97.8%
if -1.5500000000000001e37 < y < 4.8000000000000002e48Initial 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%
clear-num52.4%
clear-num52.4%
frac-times52.4%
metadata-eval52.4%
metadata-eval52.4%
div-inv52.4%
metadata-eval52.4%
metadata-eval52.4%
distribute-rgt-neg-in52.4%
div-inv52.4%
metadata-eval52.4%
metadata-eval52.4%
distribute-rgt-neg-in52.4%
frac-times52.4%
metadata-eval52.4%
frac-2neg52.4%
metadata-eval52.4%
frac-2neg52.4%
sqrt-unprod52.4%
add-sqr-sqrt52.4%
frac-2neg52.4%
Applied egg-rr98.6%
Final simplification98.2%
(FPCore (x y) :precision binary64 (- (+ 1.0 (/ -1.0 (* x 9.0))) (/ y (* (sqrt x) 3.0))))
double code(double x, double y) {
return (1.0 + (-1.0 / (x * 9.0))) - (y / (sqrt(x) * 3.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 + ((-1.0d0) / (x * 9.0d0))) - (y / (sqrt(x) * 3.0d0))
end function
public static double code(double x, double y) {
return (1.0 + (-1.0 / (x * 9.0))) - (y / (Math.sqrt(x) * 3.0));
}
def code(x, y): return (1.0 + (-1.0 / (x * 9.0))) - (y / (math.sqrt(x) * 3.0))
function code(x, y) return Float64(Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))) - Float64(y / Float64(sqrt(x) * 3.0))) end
function tmp = code(x, y) tmp = (1.0 + (-1.0 / (x * 9.0))) - (y / (sqrt(x) * 3.0)); end
code[x_, y_] := N[(N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(N[Sqrt[x], $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 + \frac{-1}{x \cdot 9}\right) - \frac{y}{\sqrt{x} \cdot 3}
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y) :precision binary64 (- (- 1.0 (/ 0.1111111111111111 x)) (/ (/ y (sqrt x)) 3.0)))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - ((y / sqrt(x)) / 3.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)) / 3.0d0)
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - ((y / Math.sqrt(x)) / 3.0);
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) - ((y / math.sqrt(x)) / 3.0)
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) - Float64(Float64(y / sqrt(x)) / 3.0)) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) - ((y / sqrt(x)) / 3.0); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] - N[(N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) - \frac{\frac{y}{\sqrt{x}}}{3}
\end{array}
Initial program 99.8%
*-commutative99.8%
associate-/r*99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 99.7%
(FPCore (x y) :precision binary64 (- (- 1.0 (/ 0.1111111111111111 x)) (/ y (* (sqrt x) 3.0))))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y / (sqrt(x) * 3.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) * 3.0d0))
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y / (Math.sqrt(x) * 3.0));
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) - (y / (math.sqrt(x) * 3.0))
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) - Float64(y / Float64(sqrt(x) * 3.0))) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) - (y / (sqrt(x) * 3.0)); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] - N[(y / N[(N[Sqrt[x], $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) - \frac{y}{\sqrt{x} \cdot 3}
\end{array}
Initial program 99.8%
Taylor expanded in x around 0 99.7%
Final simplification99.7%
(FPCore (x y) :precision binary64 (+ 1.0 (+ (/ -0.1111111111111111 x) (* y (/ -0.3333333333333333 (sqrt x))))))
double code(double x, double y) {
return 1.0 + ((-0.1111111111111111 / x) + (y * (-0.3333333333333333 / sqrt(x))));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 + (((-0.1111111111111111d0) / x) + (y * ((-0.3333333333333333d0) / sqrt(x))))
end function
public static double code(double x, double y) {
return 1.0 + ((-0.1111111111111111 / x) + (y * (-0.3333333333333333 / Math.sqrt(x))));
}
def code(x, y): return 1.0 + ((-0.1111111111111111 / x) + (y * (-0.3333333333333333 / math.sqrt(x))))
function code(x, y) return Float64(1.0 + Float64(Float64(-0.1111111111111111 / x) + Float64(y * Float64(-0.3333333333333333 / sqrt(x))))) end
function tmp = code(x, y) tmp = 1.0 + ((-0.1111111111111111 / x) + (y * (-0.3333333333333333 / sqrt(x)))); end
code[x_, y_] := N[(1.0 + N[(N[(-0.1111111111111111 / x), $MachinePrecision] + N[(y * N[(-0.3333333333333333 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \left(\frac{-0.1111111111111111}{x} + y \cdot \frac{-0.3333333333333333}{\sqrt{x}}\right)
\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%
fma-undefine99.6%
+-commutative99.6%
*-commutative99.6%
Applied egg-rr99.6%
Final simplification99.6%
(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.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%
clear-num34.3%
clear-num34.3%
frac-times34.3%
metadata-eval34.3%
metadata-eval34.3%
div-inv34.3%
metadata-eval34.3%
metadata-eval34.3%
distribute-rgt-neg-in34.3%
div-inv34.3%
metadata-eval34.3%
metadata-eval34.3%
distribute-rgt-neg-in34.3%
frac-times34.3%
metadata-eval34.3%
frac-2neg34.3%
metadata-eval34.3%
frac-2neg34.3%
sqrt-unprod32.1%
add-sqr-sqrt32.1%
frac-2neg32.1%
Applied egg-rr59.0%
(FPCore (x y) :precision binary64 (+ 1.0 (* -0.1111111111111111 (/ 1.0 x))))
double code(double x, double y) {
return 1.0 + (-0.1111111111111111 * (1.0 / x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 + ((-0.1111111111111111d0) * (1.0d0 / x))
end function
public static double code(double x, double y) {
return 1.0 + (-0.1111111111111111 * (1.0 / x));
}
def code(x, y): return 1.0 + (-0.1111111111111111 * (1.0 / x))
function code(x, y) return Float64(1.0 + Float64(-0.1111111111111111 * Float64(1.0 / x))) end
function tmp = code(x, y) tmp = 1.0 + (-0.1111111111111111 * (1.0 / x)); end
code[x_, y_] := N[(1.0 + N[(-0.1111111111111111 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + -0.1111111111111111 \cdot \frac{1}{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%
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%
(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)))))