(FPCore (x y) :precision binary64 (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))
(FPCore (x y) :precision binary64 (- (+ (* (* 3.0 y) (sqrt x)) (/ 0.3333333333333333 (sqrt x))) (* 3.0 (sqrt x))))
double code(double x, double y) {
return (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
double code(double x, double y) {
return (((3.0 * y) * sqrt(x)) + (0.3333333333333333 / sqrt(x))) - (3.0 * sqrt(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (3.0d0 * sqrt(x)) * ((y + (1.0d0 / (x * 9.0d0))) - 1.0d0)
end function
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (((3.0d0 * y) * sqrt(x)) + (0.3333333333333333d0 / sqrt(x))) - (3.0d0 * sqrt(x))
end function
public static double code(double x, double y) {
return (3.0 * Math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
public static double code(double x, double y) {
return (((3.0 * y) * Math.sqrt(x)) + (0.3333333333333333 / Math.sqrt(x))) - (3.0 * Math.sqrt(x));
}
def code(x, y): return (3.0 * math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0)
def code(x, y): return (((3.0 * y) * math.sqrt(x)) + (0.3333333333333333 / math.sqrt(x))) - (3.0 * math.sqrt(x))
function code(x, y) return Float64(Float64(3.0 * sqrt(x)) * Float64(Float64(y + Float64(1.0 / Float64(x * 9.0))) - 1.0)) end
function code(x, y) return Float64(Float64(Float64(Float64(3.0 * y) * sqrt(x)) + Float64(0.3333333333333333 / sqrt(x))) - Float64(3.0 * sqrt(x))) end
function tmp = code(x, y) tmp = (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0); end
function tmp = code(x, y) tmp = (((3.0 * y) * sqrt(x)) + (0.3333333333333333 / sqrt(x))) - (3.0 * sqrt(x)); end
code[x_, y_] := N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(N[(y + N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(N[(N[(N[(3.0 * y), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(0.3333333333333333 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\left(\left(3 \cdot y\right) \cdot \sqrt{x} + \frac{0.3333333333333333}{\sqrt{x}}\right) - 3 \cdot \sqrt{x}




Bits error versus x




Bits error versus y
Results
| Original | 0.4 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 0.4
Taylor expanded in y around 0 0.4
Applied sqrt-div_binary640.4
Applied associate-*r/_binary640.4
Simplified0.4
Applied associate-*r*_binary640.4
Final simplification0.4
herbie shell --seed 2022130
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(* 3.0 (+ (* y (sqrt x)) (* (- (/ 1.0 (* x 9.0)) 1.0) (sqrt x))))
(* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))