
(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 (/ -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.75e+96)
(- 1.0 (/ y (* 3.0 (sqrt x))))
(if (<= y 7.6e+65)
(+ 1.0 (/ 1.0 (* x -9.0)))
(+ 1.0 (* (sqrt (/ 1.0 x)) (* y -0.3333333333333333))))))
double code(double x, double y) {
double tmp;
if (y <= -1.75e+96) {
tmp = 1.0 - (y / (3.0 * sqrt(x)));
} else if (y <= 7.6e+65) {
tmp = 1.0 + (1.0 / (x * -9.0));
} else {
tmp = 1.0 + (sqrt((1.0 / 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.75d+96)) then
tmp = 1.0d0 - (y / (3.0d0 * sqrt(x)))
else if (y <= 7.6d+65) then
tmp = 1.0d0 + (1.0d0 / (x * (-9.0d0)))
else
tmp = 1.0d0 + (sqrt((1.0d0 / x)) * (y * (-0.3333333333333333d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.75e+96) {
tmp = 1.0 - (y / (3.0 * Math.sqrt(x)));
} else if (y <= 7.6e+65) {
tmp = 1.0 + (1.0 / (x * -9.0));
} else {
tmp = 1.0 + (Math.sqrt((1.0 / x)) * (y * -0.3333333333333333));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.75e+96: tmp = 1.0 - (y / (3.0 * math.sqrt(x))) elif y <= 7.6e+65: tmp = 1.0 + (1.0 / (x * -9.0)) else: tmp = 1.0 + (math.sqrt((1.0 / x)) * (y * -0.3333333333333333)) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.75e+96) tmp = Float64(1.0 - Float64(y / Float64(3.0 * sqrt(x)))); elseif (y <= 7.6e+65) tmp = Float64(1.0 + Float64(1.0 / Float64(x * -9.0))); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 / x)) * Float64(y * -0.3333333333333333))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.75e+96) tmp = 1.0 - (y / (3.0 * sqrt(x))); elseif (y <= 7.6e+65) tmp = 1.0 + (1.0 / (x * -9.0)); else tmp = 1.0 + (sqrt((1.0 / x)) * (y * -0.3333333333333333)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.75e+96], N[(1.0 - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.6e+65], N[(1.0 + N[(1.0 / N[(x * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] * N[(y * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+96}:\\
\;\;\;\;1 - \frac{y}{3 \cdot \sqrt{x}}\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{+65}:\\
\;\;\;\;1 + \frac{1}{x \cdot -9}\\
\mathbf{else}:\\
\;\;\;\;1 + \sqrt{\frac{1}{x}} \cdot \left(y \cdot -0.3333333333333333\right)\\
\end{array}
\end{array}
if y < -1.7499999999999999e96Initial program 99.6%
Taylor expanded in x around inf 99.4%
metadata-eval99.4%
*-commutative99.4%
sqrt-div99.3%
metadata-eval99.3%
un-div-inv99.4%
times-frac99.6%
*-un-lft-identity99.6%
Applied egg-rr99.6%
if -1.7499999999999999e96 < y < 7.60000000000000022e65Initial 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.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 97.9%
add-cube-cbrt97.2%
pow397.2%
Applied egg-rr97.2%
rem-cube-cbrt97.9%
clear-num97.9%
div-inv97.9%
metadata-eval97.9%
Applied egg-rr97.9%
if 7.60000000000000022e65 < y Initial 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.3%
fma-neg99.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 96.5%
associate-*r*96.5%
*-commutative96.5%
associate-*l*96.5%
Simplified96.5%
Final simplification97.9%
(FPCore (x y)
:precision binary64
(if (<= y -1.75e+96)
(- 1.0 (/ y (* 3.0 (sqrt x))))
(if (<= y 2.4e+66)
(+ 1.0 (/ 1.0 (* x -9.0)))
(- 1.0 (* 0.3333333333333333 (* y (sqrt (/ 1.0 x))))))))
double code(double x, double y) {
double tmp;
if (y <= -1.75e+96) {
tmp = 1.0 - (y / (3.0 * sqrt(x)));
} else if (y <= 2.4e+66) {
tmp = 1.0 + (1.0 / (x * -9.0));
} else {
tmp = 1.0 - (0.3333333333333333 * (y * sqrt((1.0 / x))));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.75d+96)) then
tmp = 1.0d0 - (y / (3.0d0 * sqrt(x)))
else if (y <= 2.4d+66) then
tmp = 1.0d0 + (1.0d0 / (x * (-9.0d0)))
else
tmp = 1.0d0 - (0.3333333333333333d0 * (y * sqrt((1.0d0 / x))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.75e+96) {
tmp = 1.0 - (y / (3.0 * Math.sqrt(x)));
} else if (y <= 2.4e+66) {
tmp = 1.0 + (1.0 / (x * -9.0));
} else {
tmp = 1.0 - (0.3333333333333333 * (y * Math.sqrt((1.0 / x))));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.75e+96: tmp = 1.0 - (y / (3.0 * math.sqrt(x))) elif y <= 2.4e+66: tmp = 1.0 + (1.0 / (x * -9.0)) else: tmp = 1.0 - (0.3333333333333333 * (y * math.sqrt((1.0 / x)))) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.75e+96) tmp = Float64(1.0 - Float64(y / Float64(3.0 * sqrt(x)))); elseif (y <= 2.4e+66) tmp = Float64(1.0 + Float64(1.0 / Float64(x * -9.0))); else tmp = Float64(1.0 - Float64(0.3333333333333333 * Float64(y * sqrt(Float64(1.0 / x))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.75e+96) tmp = 1.0 - (y / (3.0 * sqrt(x))); elseif (y <= 2.4e+66) tmp = 1.0 + (1.0 / (x * -9.0)); else tmp = 1.0 - (0.3333333333333333 * (y * sqrt((1.0 / x)))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.75e+96], N[(1.0 - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e+66], N[(1.0 + N[(1.0 / N[(x * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(0.3333333333333333 * N[(y * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+96}:\\
\;\;\;\;1 - \frac{y}{3 \cdot \sqrt{x}}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+66}:\\
\;\;\;\;1 + \frac{1}{x \cdot -9}\\
\mathbf{else}:\\
\;\;\;\;1 - 0.3333333333333333 \cdot \left(y \cdot \sqrt{\frac{1}{x}}\right)\\
\end{array}
\end{array}
if y < -1.7499999999999999e96Initial program 99.6%
Taylor expanded in x around inf 99.4%
metadata-eval99.4%
*-commutative99.4%
sqrt-div99.3%
metadata-eval99.3%
un-div-inv99.4%
times-frac99.6%
*-un-lft-identity99.6%
Applied egg-rr99.6%
if -1.7499999999999999e96 < y < 2.4000000000000002e66Initial 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.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 97.9%
add-cube-cbrt97.2%
pow397.2%
Applied egg-rr97.2%
rem-cube-cbrt97.9%
clear-num97.9%
div-inv97.9%
metadata-eval97.9%
Applied egg-rr97.9%
if 2.4000000000000002e66 < y Initial program 99.5%
Taylor expanded in x around inf 96.5%
Final simplification97.9%
(FPCore (x y) :precision binary64 (if (or (<= y -1.75e+96) (not (<= y 1.22e+67))) (- 1.0 (/ y (* 3.0 (sqrt x)))) (+ 1.0 (/ 1.0 (* x -9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -1.75e+96) || !(y <= 1.22e+67)) {
tmp = 1.0 - (y / (3.0 * 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.75d+96)) .or. (.not. (y <= 1.22d+67))) then
tmp = 1.0d0 - (y / (3.0d0 * 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.75e+96) || !(y <= 1.22e+67)) {
tmp = 1.0 - (y / (3.0 * Math.sqrt(x)));
} else {
tmp = 1.0 + (1.0 / (x * -9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.75e+96) or not (y <= 1.22e+67): tmp = 1.0 - (y / (3.0 * math.sqrt(x))) else: tmp = 1.0 + (1.0 / (x * -9.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.75e+96) || !(y <= 1.22e+67)) tmp = Float64(1.0 - Float64(y / Float64(3.0 * 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.75e+96) || ~((y <= 1.22e+67))) tmp = 1.0 - (y / (3.0 * sqrt(x))); else tmp = 1.0 + (1.0 / (x * -9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.75e+96], N[Not[LessEqual[y, 1.22e+67]], $MachinePrecision]], N[(1.0 - N[(y / N[(3.0 * 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.75 \cdot 10^{+96} \lor \neg \left(y \leq 1.22 \cdot 10^{+67}\right):\\
\;\;\;\;1 - \frac{y}{3 \cdot \sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{1}{x \cdot -9}\\
\end{array}
\end{array}
if y < -1.7499999999999999e96 or 1.22000000000000004e67 < y Initial program 99.6%
Taylor expanded in x around inf 97.9%
metadata-eval97.9%
*-commutative97.9%
sqrt-div97.8%
metadata-eval97.8%
un-div-inv97.8%
times-frac98.0%
*-un-lft-identity98.0%
Applied egg-rr98.0%
if -1.7499999999999999e96 < y < 1.22000000000000004e67Initial 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.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 97.9%
add-cube-cbrt97.2%
pow397.2%
Applied egg-rr97.2%
rem-cube-cbrt97.9%
clear-num97.9%
div-inv97.9%
metadata-eval97.9%
Applied egg-rr97.9%
Final simplification97.9%
(FPCore (x y)
:precision binary64
(if (<= y -2.7e+96)
(/ y (* (sqrt x) -3.0))
(if (<= y 2.3e+69)
(+ 1.0 (/ 1.0 (* x -9.0)))
(* (sqrt (/ 1.0 x)) (* y -0.3333333333333333)))))
double code(double x, double y) {
double tmp;
if (y <= -2.7e+96) {
tmp = y / (sqrt(x) * -3.0);
} else if (y <= 2.3e+69) {
tmp = 1.0 + (1.0 / (x * -9.0));
} else {
tmp = sqrt((1.0 / 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 <= (-2.7d+96)) then
tmp = y / (sqrt(x) * (-3.0d0))
else if (y <= 2.3d+69) then
tmp = 1.0d0 + (1.0d0 / (x * (-9.0d0)))
else
tmp = sqrt((1.0d0 / x)) * (y * (-0.3333333333333333d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -2.7e+96) {
tmp = y / (Math.sqrt(x) * -3.0);
} else if (y <= 2.3e+69) {
tmp = 1.0 + (1.0 / (x * -9.0));
} else {
tmp = Math.sqrt((1.0 / x)) * (y * -0.3333333333333333);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.7e+96: tmp = y / (math.sqrt(x) * -3.0) elif y <= 2.3e+69: tmp = 1.0 + (1.0 / (x * -9.0)) else: tmp = math.sqrt((1.0 / x)) * (y * -0.3333333333333333) return tmp
function code(x, y) tmp = 0.0 if (y <= -2.7e+96) tmp = Float64(y / Float64(sqrt(x) * -3.0)); elseif (y <= 2.3e+69) tmp = Float64(1.0 + Float64(1.0 / Float64(x * -9.0))); else tmp = Float64(sqrt(Float64(1.0 / x)) * Float64(y * -0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.7e+96) tmp = y / (sqrt(x) * -3.0); elseif (y <= 2.3e+69) tmp = 1.0 + (1.0 / (x * -9.0)); else tmp = sqrt((1.0 / x)) * (y * -0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.7e+96], N[(y / N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+69], N[(1.0 + N[(1.0 / N[(x * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] * N[(y * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{+96}:\\
\;\;\;\;\frac{y}{\sqrt{x} \cdot -3}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+69}:\\
\;\;\;\;1 + \frac{1}{x \cdot -9}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{1}{x}} \cdot \left(y \cdot -0.3333333333333333\right)\\
\end{array}
\end{array}
if y < -2.70000000000000022e96Initial program 99.6%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 97.4%
*-commutative97.4%
*-commutative97.4%
Simplified97.4%
pow197.4%
associate-*l*97.4%
sqrt-div97.4%
metadata-eval97.4%
associate-*l/97.5%
metadata-eval97.5%
Applied egg-rr97.5%
unpow197.5%
Simplified97.5%
clear-num97.6%
un-div-inv97.6%
div-inv97.6%
metadata-eval97.6%
Applied egg-rr97.6%
if -2.70000000000000022e96 < y < 2.30000000000000017e69Initial 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.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 97.9%
add-cube-cbrt97.2%
pow397.2%
Applied egg-rr97.2%
rem-cube-cbrt97.9%
clear-num97.9%
div-inv97.9%
metadata-eval97.9%
Applied egg-rr97.9%
if 2.30000000000000017e69 < y Initial program 99.5%
Taylor expanded in x around 0 99.5%
Taylor expanded in y around inf 94.6%
*-commutative94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in y around 0 94.6%
*-commutative94.6%
associate-*l*94.6%
*-commutative94.6%
Simplified94.6%
Final simplification97.2%
(FPCore (x y) :precision binary64 (if (or (<= y -4e+96) (not (<= y 8.8e+72))) (* y (/ -0.3333333333333333 (sqrt x))) (+ 1.0 (/ 1.0 (* x -9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -4e+96) || !(y <= 8.8e+72)) {
tmp = 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 <= (-4d+96)) .or. (.not. (y <= 8.8d+72))) then
tmp = 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 <= -4e+96) || !(y <= 8.8e+72)) {
tmp = 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 <= -4e+96) or not (y <= 8.8e+72): tmp = 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 <= -4e+96) || !(y <= 8.8e+72)) tmp = 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 <= -4e+96) || ~((y <= 8.8e+72))) tmp = 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, -4e+96], N[Not[LessEqual[y, 8.8e+72]], $MachinePrecision]], N[(y * N[(-0.3333333333333333 / 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 -4 \cdot 10^{+96} \lor \neg \left(y \leq 8.8 \cdot 10^{+72}\right):\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{1}{x \cdot -9}\\
\end{array}
\end{array}
if y < -4.0000000000000002e96 or 8.8e72 < y Initial program 99.6%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 95.9%
*-commutative95.9%
*-commutative95.9%
Simplified95.9%
pow195.9%
associate-*l*95.9%
sqrt-div95.8%
metadata-eval95.8%
associate-*l/95.8%
metadata-eval95.8%
Applied egg-rr95.8%
unpow195.8%
Simplified95.8%
if -4.0000000000000002e96 < y < 8.8e72Initial 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.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 97.9%
add-cube-cbrt97.2%
pow397.2%
Applied egg-rr97.2%
rem-cube-cbrt97.9%
clear-num97.9%
div-inv97.9%
metadata-eval97.9%
Applied egg-rr97.9%
Final simplification97.2%
(FPCore (x y) :precision binary64 (if (or (<= y -1.75e+96) (not (<= y 3.05e+68))) (/ y (* (sqrt x) -3.0)) (+ 1.0 (/ 1.0 (* x -9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -1.75e+96) || !(y <= 3.05e+68)) {
tmp = y / (sqrt(x) * -3.0);
} 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.75d+96)) .or. (.not. (y <= 3.05d+68))) then
tmp = y / (sqrt(x) * (-3.0d0))
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.75e+96) || !(y <= 3.05e+68)) {
tmp = y / (Math.sqrt(x) * -3.0);
} else {
tmp = 1.0 + (1.0 / (x * -9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.75e+96) or not (y <= 3.05e+68): tmp = y / (math.sqrt(x) * -3.0) else: tmp = 1.0 + (1.0 / (x * -9.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.75e+96) || !(y <= 3.05e+68)) tmp = Float64(y / Float64(sqrt(x) * -3.0)); 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.75e+96) || ~((y <= 3.05e+68))) tmp = y / (sqrt(x) * -3.0); else tmp = 1.0 + (1.0 / (x * -9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.75e+96], N[Not[LessEqual[y, 3.05e+68]], $MachinePrecision]], N[(y / N[(N[Sqrt[x], $MachinePrecision] * -3.0), $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.75 \cdot 10^{+96} \lor \neg \left(y \leq 3.05 \cdot 10^{+68}\right):\\
\;\;\;\;\frac{y}{\sqrt{x} \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{1}{x \cdot -9}\\
\end{array}
\end{array}
if y < -1.7499999999999999e96 or 3.05e68 < y Initial program 99.6%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 95.9%
*-commutative95.9%
*-commutative95.9%
Simplified95.9%
pow195.9%
associate-*l*95.9%
sqrt-div95.8%
metadata-eval95.8%
associate-*l/95.8%
metadata-eval95.8%
Applied egg-rr95.8%
unpow195.8%
Simplified95.8%
clear-num95.8%
un-div-inv95.8%
div-inv95.9%
metadata-eval95.9%
Applied egg-rr95.9%
if -1.7499999999999999e96 < y < 3.05e68Initial 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.7%
distribute-neg-frac99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 97.9%
add-cube-cbrt97.2%
pow397.2%
Applied egg-rr97.2%
rem-cube-cbrt97.9%
clear-num97.9%
div-inv97.9%
metadata-eval97.9%
Applied egg-rr97.9%
Final simplification97.2%
(FPCore (x y) :precision binary64 (if (<= x 0.11) (/ (+ 0.1111111111111111 (* 0.3333333333333333 (* y (sqrt x)))) (- x)) (- 1.0 (/ y (* 3.0 (sqrt x))))))
double code(double x, double y) {
double tmp;
if (x <= 0.11) {
tmp = (0.1111111111111111 + (0.3333333333333333 * (y * sqrt(x)))) / -x;
} else {
tmp = 1.0 - (y / (3.0 * 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 <= 0.11d0) then
tmp = (0.1111111111111111d0 + (0.3333333333333333d0 * (y * sqrt(x)))) / -x
else
tmp = 1.0d0 - (y / (3.0d0 * sqrt(x)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.11) {
tmp = (0.1111111111111111 + (0.3333333333333333 * (y * Math.sqrt(x)))) / -x;
} else {
tmp = 1.0 - (y / (3.0 * Math.sqrt(x)));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.11: tmp = (0.1111111111111111 + (0.3333333333333333 * (y * math.sqrt(x)))) / -x else: tmp = 1.0 - (y / (3.0 * math.sqrt(x))) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.11) tmp = Float64(Float64(0.1111111111111111 + Float64(0.3333333333333333 * Float64(y * sqrt(x)))) / Float64(-x)); else tmp = Float64(1.0 - Float64(y / Float64(3.0 * sqrt(x)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.11) tmp = (0.1111111111111111 + (0.3333333333333333 * (y * sqrt(x)))) / -x; else tmp = 1.0 - (y / (3.0 * sqrt(x))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.11], N[(N[(0.1111111111111111 + N[(0.3333333333333333 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-x)), $MachinePrecision], N[(1.0 - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.11:\\
\;\;\;\;\frac{0.1111111111111111 + 0.3333333333333333 \cdot \left(y \cdot \sqrt{x}\right)}{-x}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{y}{3 \cdot \sqrt{x}}\\
\end{array}
\end{array}
if x < 0.110000000000000001Initial program 99.6%
Taylor expanded in x around 0 97.6%
mul-1-neg97.6%
*-commutative97.6%
Simplified97.6%
if 0.110000000000000001 < x Initial program 99.8%
Taylor expanded in x around inf 98.4%
metadata-eval98.4%
*-commutative98.4%
sqrt-div98.4%
metadata-eval98.4%
un-div-inv98.4%
times-frac98.5%
*-un-lft-identity98.5%
Applied egg-rr98.5%
Final simplification98.0%
(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.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)) (/ 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.7%
Final simplification99.7%
(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.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.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.1%
add-cube-cbrt63.6%
pow363.6%
Applied egg-rr63.6%
rem-cube-cbrt64.1%
clear-num64.1%
div-inv64.1%
metadata-eval64.1%
Applied egg-rr64.1%
Final simplification64.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.6%
fma-neg99.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.1%
Final simplification64.1%
(FPCore (x y) :precision binary64 (/ 0.1111111111111111 (- x)))
double code(double x, double y) {
return 0.1111111111111111 / -x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.1111111111111111d0 / -x
end function
public static double code(double x, double y) {
return 0.1111111111111111 / -x;
}
def code(x, y): return 0.1111111111111111 / -x
function code(x, y) return Float64(0.1111111111111111 / Float64(-x)) end
function tmp = code(x, y) tmp = 0.1111111111111111 / -x; end
code[x_, y_] := N[(0.1111111111111111 / (-x)), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.1111111111111111}{-x}
\end{array}
Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
+-commutative99.6%
associate-+r-99.6%
*-commutative99.6%
associate-*l/99.6%
associate-*r/99.6%
add-sqr-sqrt99.5%
sqrt-unprod78.3%
frac-times78.4%
metadata-eval78.4%
metadata-eval78.4%
frac-times78.3%
sqrt-unprod0.0%
add-sqr-sqrt66.3%
Applied egg-rr66.3%
Taylor expanded in x around 0 31.3%
Taylor expanded in y around 0 3.0%
metadata-eval3.0%
distribute-neg-frac3.0%
add-sqr-sqrt0.0%
sqrt-unprod20.4%
frac-times20.5%
metadata-eval20.5%
metadata-eval20.5%
frac-times20.4%
sqrt-unprod32.7%
add-sqr-sqrt32.8%
Applied egg-rr32.8%
Final simplification32.8%
(FPCore (x y) :precision binary64 (/ 0.1111111111111111 x))
double code(double x, double y) {
return 0.1111111111111111 / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.1111111111111111d0 / x
end function
public static double code(double x, double y) {
return 0.1111111111111111 / x;
}
def code(x, y): return 0.1111111111111111 / x
function code(x, y) return Float64(0.1111111111111111 / x) end
function tmp = code(x, y) tmp = 0.1111111111111111 / x; end
code[x_, y_] := N[(0.1111111111111111 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.1111111111111111}{x}
\end{array}
Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
+-commutative99.6%
associate-+r-99.6%
*-commutative99.6%
associate-*l/99.6%
associate-*r/99.6%
add-sqr-sqrt99.5%
sqrt-unprod78.3%
frac-times78.4%
metadata-eval78.4%
metadata-eval78.4%
frac-times78.3%
sqrt-unprod0.0%
add-sqr-sqrt66.3%
Applied egg-rr66.3%
Taylor expanded in x around 0 31.3%
Taylor expanded in y around 0 3.0%
Final simplification3.0%
(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 2024078
(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)))))