
(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 15 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 -4.1e+48)
(+ 1.0 (/ -0.3333333333333333 (/ (sqrt x) y)))
(if (<= y 9.5e+26)
(+ 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 <= -4.1e+48) {
tmp = 1.0 + (-0.3333333333333333 / (sqrt(x) / y));
} else if (y <= 9.5e+26) {
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 <= (-4.1d+48)) then
tmp = 1.0d0 + ((-0.3333333333333333d0) / (sqrt(x) / y))
else if (y <= 9.5d+26) 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 <= -4.1e+48) {
tmp = 1.0 + (-0.3333333333333333 / (Math.sqrt(x) / y));
} else if (y <= 9.5e+26) {
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 <= -4.1e+48: tmp = 1.0 + (-0.3333333333333333 / (math.sqrt(x) / y)) elif y <= 9.5e+26: 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 <= -4.1e+48) tmp = Float64(1.0 + Float64(-0.3333333333333333 / Float64(sqrt(x) / y))); elseif (y <= 9.5e+26) 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 <= -4.1e+48) tmp = 1.0 + (-0.3333333333333333 / (sqrt(x) / y)); elseif (y <= 9.5e+26) 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, -4.1e+48], N[(1.0 + N[(-0.3333333333333333 / N[(N[Sqrt[x], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e+26], 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 -4.1 \cdot 10^{+48}:\\
\;\;\;\;1 + \frac{-0.3333333333333333}{\frac{\sqrt{x}}{y}}\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+26}:\\
\;\;\;\;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 < -4.1000000000000003e48Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.4%
fma-def99.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.5%
*-commutative97.5%
*-commutative97.5%
associate-*l*97.6%
*-commutative97.6%
Simplified97.6%
expm1-log1p-u91.2%
expm1-udef91.2%
sqrt-div91.2%
metadata-eval91.2%
associate-*l/91.2%
*-un-lft-identity91.2%
Applied egg-rr91.2%
expm1-def91.2%
expm1-log1p97.7%
associate-/l*97.6%
Simplified97.6%
if -4.1000000000000003e48 < y < 9.50000000000000054e26Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.8%
fma-def99.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.6%
div-inv98.7%
clear-num98.6%
div-inv98.7%
metadata-eval98.7%
Applied egg-rr98.7%
if 9.50000000000000054e26 < y Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
*-commutative99.7%
associate-*r/99.3%
fma-def99.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 87.4%
*-commutative87.4%
*-commutative87.4%
associate-*l*87.5%
*-commutative87.5%
Simplified87.5%
Final simplification96.0%
(FPCore (x y) :precision binary64 (if (or (<= y -2.9e+50) (not (<= y 4.8e+30))) (+ 1.0 (* y (/ -0.3333333333333333 (sqrt x)))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -2.9e+50) || !(y <= 4.8e+30)) {
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 <= (-2.9d+50)) .or. (.not. (y <= 4.8d+30))) 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 <= -2.9e+50) || !(y <= 4.8e+30)) {
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 <= -2.9e+50) or not (y <= 4.8e+30): 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 <= -2.9e+50) || !(y <= 4.8e+30)) 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 <= -2.9e+50) || ~((y <= 4.8e+30))) 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, -2.9e+50], N[Not[LessEqual[y, 4.8e+30]], $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 -2.9 \cdot 10^{+50} \lor \neg \left(y \leq 4.8 \cdot 10^{+30}\right):\\
\;\;\;\;1 + y \cdot \frac{-0.3333333333333333}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -2.9e50 or 4.7999999999999999e30 < y Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
*-commutative99.7%
associate-*r/99.3%
fma-def99.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 92.3%
*-commutative92.3%
*-commutative92.3%
associate-*l*92.4%
*-commutative92.4%
Simplified92.4%
expm1-log1p-u48.0%
expm1-udef48.0%
sqrt-div48.0%
metadata-eval48.0%
associate-*l/48.0%
*-un-lft-identity48.0%
Applied egg-rr48.0%
expm1-def48.0%
expm1-log1p92.5%
*-commutative92.5%
associate-*r/92.3%
Simplified92.3%
if -2.9e50 < y < 4.7999999999999999e30Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.8%
fma-def99.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.6%
div-inv98.7%
clear-num98.6%
div-inv98.7%
metadata-eval98.7%
Applied egg-rr98.7%
Final simplification95.9%
(FPCore (x y) :precision binary64 (if (or (<= y -4.1e+37) (not (<= y 4e+30))) (+ 1.0 (/ -0.3333333333333333 (/ (sqrt x) y))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -4.1e+37) || !(y <= 4e+30)) {
tmp = 1.0 + (-0.3333333333333333 / (sqrt(x) / y));
} 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 <= (-4.1d+37)) .or. (.not. (y <= 4d+30))) then
tmp = 1.0d0 + ((-0.3333333333333333d0) / (sqrt(x) / y))
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 <= -4.1e+37) || !(y <= 4e+30)) {
tmp = 1.0 + (-0.3333333333333333 / (Math.sqrt(x) / y));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -4.1e+37) or not (y <= 4e+30): tmp = 1.0 + (-0.3333333333333333 / (math.sqrt(x) / y)) else: tmp = 1.0 + (-1.0 / (x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -4.1e+37) || !(y <= 4e+30)) tmp = Float64(1.0 + Float64(-0.3333333333333333 / Float64(sqrt(x) / y))); 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 <= -4.1e+37) || ~((y <= 4e+30))) tmp = 1.0 + (-0.3333333333333333 / (sqrt(x) / y)); else tmp = 1.0 + (-1.0 / (x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -4.1e+37], N[Not[LessEqual[y, 4e+30]], $MachinePrecision]], N[(1.0 + N[(-0.3333333333333333 / N[(N[Sqrt[x], $MachinePrecision] / y), $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.1 \cdot 10^{+37} \lor \neg \left(y \leq 4 \cdot 10^{+30}\right):\\
\;\;\;\;1 + \frac{-0.3333333333333333}{\frac{\sqrt{x}}{y}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -4.0999999999999998e37 or 4.0000000000000001e30 < y Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
*-commutative99.7%
associate-*r/99.3%
fma-def99.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 92.3%
*-commutative92.3%
*-commutative92.3%
associate-*l*92.4%
*-commutative92.4%
Simplified92.4%
expm1-log1p-u48.0%
expm1-udef48.0%
sqrt-div48.0%
metadata-eval48.0%
associate-*l/48.0%
*-un-lft-identity48.0%
Applied egg-rr48.0%
expm1-def48.0%
expm1-log1p92.5%
associate-/l*92.4%
Simplified92.4%
if -4.0999999999999998e37 < y < 4.0000000000000001e30Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.8%
fma-def99.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.6%
div-inv98.7%
clear-num98.6%
div-inv98.7%
metadata-eval98.7%
Applied egg-rr98.7%
Final simplification96.0%
(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(1.0 - Float64(Float64(0.1111111111111111 / x) + Float64(Float64(y / 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[(1.0 - N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(N[(y / 3.0), $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \left(\frac{0.1111111111111111}{x} + \frac{\frac{y}{3}}{\sqrt{x}}\right)
\end{array}
Initial program 99.7%
associate--l-99.7%
+-commutative99.7%
+-commutative99.7%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
Final simplification99.7%
(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%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y) :precision binary64 (if (or (<= y -2.5e+54) (not (<= y 1.2e+104))) (* (* y -0.3333333333333333) (pow x -0.5)) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -2.5e+54) || !(y <= 1.2e+104)) {
tmp = (y * -0.3333333333333333) * pow(x, -0.5);
} 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 <= (-2.5d+54)) .or. (.not. (y <= 1.2d+104))) then
tmp = (y * (-0.3333333333333333d0)) * (x ** (-0.5d0))
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 <= -2.5e+54) || !(y <= 1.2e+104)) {
tmp = (y * -0.3333333333333333) * Math.pow(x, -0.5);
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -2.5e+54) or not (y <= 1.2e+104): tmp = (y * -0.3333333333333333) * math.pow(x, -0.5) else: tmp = 1.0 + (-1.0 / (x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -2.5e+54) || !(y <= 1.2e+104)) tmp = Float64(Float64(y * -0.3333333333333333) * (x ^ -0.5)); 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 <= -2.5e+54) || ~((y <= 1.2e+104))) tmp = (y * -0.3333333333333333) * (x ^ -0.5); else tmp = 1.0 + (-1.0 / (x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -2.5e+54], N[Not[LessEqual[y, 1.2e+104]], $MachinePrecision]], N[(N[(y * -0.3333333333333333), $MachinePrecision] * N[Power[x, -0.5], $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 -2.5 \cdot 10^{+54} \lor \neg \left(y \leq 1.2 \cdot 10^{+104}\right):\\
\;\;\;\;\left(y \cdot -0.3333333333333333\right) \cdot {x}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -2.50000000000000003e54 or 1.2e104 < y Initial program 99.6%
associate--l-99.6%
+-commutative99.6%
+-commutative99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 96.7%
associate-*r*96.8%
Simplified96.8%
expm1-log1p-u95.4%
expm1-udef50.4%
inv-pow50.4%
sqrt-pow150.4%
metadata-eval50.4%
Applied egg-rr50.4%
expm1-def95.4%
expm1-log1p96.9%
Simplified96.9%
if -2.50000000000000003e54 < y < 1.2e104Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.7%
fma-def99.7%
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 92.9%
div-inv92.9%
clear-num92.9%
div-inv92.9%
metadata-eval92.9%
Applied egg-rr92.9%
Final simplification94.3%
(FPCore (x y)
:precision binary64
(if (<= y -2.3e+54)
(/ (- y) (* 3.0 (sqrt x)))
(if (<= y 1.2e+104)
(+ 1.0 (/ -1.0 (* x 9.0)))
(* (* y -0.3333333333333333) (pow x -0.5)))))
double code(double x, double y) {
double tmp;
if (y <= -2.3e+54) {
tmp = -y / (3.0 * sqrt(x));
} else if (y <= 1.2e+104) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = (y * -0.3333333333333333) * pow(x, -0.5);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-2.3d+54)) then
tmp = -y / (3.0d0 * sqrt(x))
else if (y <= 1.2d+104) then
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
else
tmp = (y * (-0.3333333333333333d0)) * (x ** (-0.5d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -2.3e+54) {
tmp = -y / (3.0 * Math.sqrt(x));
} else if (y <= 1.2e+104) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = (y * -0.3333333333333333) * Math.pow(x, -0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.3e+54: tmp = -y / (3.0 * math.sqrt(x)) elif y <= 1.2e+104: tmp = 1.0 + (-1.0 / (x * 9.0)) else: tmp = (y * -0.3333333333333333) * math.pow(x, -0.5) return tmp
function code(x, y) tmp = 0.0 if (y <= -2.3e+54) tmp = Float64(Float64(-y) / Float64(3.0 * sqrt(x))); elseif (y <= 1.2e+104) tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); else tmp = Float64(Float64(y * -0.3333333333333333) * (x ^ -0.5)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.3e+54) tmp = -y / (3.0 * sqrt(x)); elseif (y <= 1.2e+104) tmp = 1.0 + (-1.0 / (x * 9.0)); else tmp = (y * -0.3333333333333333) * (x ^ -0.5); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.3e+54], N[((-y) / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+104], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * -0.3333333333333333), $MachinePrecision] * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+54}:\\
\;\;\;\;\frac{-y}{3 \cdot \sqrt{x}}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+104}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot -0.3333333333333333\right) \cdot {x}^{-0.5}\\
\end{array}
\end{array}
if y < -2.29999999999999994e54Initial program 99.6%
associate--l-99.6%
+-commutative99.6%
+-commutative99.6%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in y around inf 95.7%
associate-*r*95.8%
Simplified95.8%
associate-*l*95.7%
sqrt-div95.7%
metadata-eval95.7%
div-inv95.9%
frac-2neg95.9%
associate-*r/95.9%
Applied egg-rr95.9%
distribute-rgt-neg-out95.9%
*-commutative95.9%
distribute-frac-neg95.9%
metadata-eval95.9%
distribute-rgt-neg-in95.9%
distribute-lft-neg-out95.9%
associate-/l*95.9%
associate-/r/95.9%
metadata-eval95.9%
times-frac95.9%
*-rgt-identity95.9%
associate-/r*95.9%
neg-mul-195.9%
neg-mul-195.9%
times-frac95.9%
metadata-eval95.9%
*-lft-identity95.9%
distribute-frac-neg95.9%
distribute-frac-neg95.9%
associate-/l/95.9%
*-commutative95.9%
Simplified95.9%
if -2.29999999999999994e54 < y < 1.2e104Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.7%
fma-def99.7%
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 92.9%
div-inv92.9%
clear-num92.9%
div-inv92.9%
metadata-eval92.9%
Applied egg-rr92.9%
if 1.2e104 < y Initial program 99.6%
associate--l-99.6%
+-commutative99.6%
+-commutative99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in x around 0 99.5%
Taylor expanded in y around inf 98.1%
associate-*r*98.2%
Simplified98.2%
expm1-log1p-u96.6%
expm1-udef47.8%
inv-pow47.8%
sqrt-pow147.8%
metadata-eval47.8%
Applied egg-rr47.8%
expm1-def96.6%
expm1-log1p98.3%
Simplified98.3%
Final simplification94.4%
(FPCore (x y) :precision binary64 (if (or (<= y -2.5e+54) (not (<= y 1.2e+104))) (* y (/ -0.3333333333333333 (sqrt x))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -2.5e+54) || !(y <= 1.2e+104)) {
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 <= (-2.5d+54)) .or. (.not. (y <= 1.2d+104))) 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 <= -2.5e+54) || !(y <= 1.2e+104)) {
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 <= -2.5e+54) or not (y <= 1.2e+104): 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 <= -2.5e+54) || !(y <= 1.2e+104)) 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 <= -2.5e+54) || ~((y <= 1.2e+104))) 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, -2.5e+54], N[Not[LessEqual[y, 1.2e+104]], $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 -2.5 \cdot 10^{+54} \lor \neg \left(y \leq 1.2 \cdot 10^{+104}\right):\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -2.50000000000000003e54 or 1.2e104 < y Initial program 99.6%
associate--l-99.6%
+-commutative99.6%
+-commutative99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 96.7%
*-commutative96.7%
associate-*l*96.7%
unpow-196.7%
sqr-pow96.7%
metadata-eval96.7%
metadata-eval96.7%
rem-sqrt-square96.7%
rem-square-sqrt96.5%
fabs-sqr96.5%
rem-square-sqrt96.7%
Simplified96.7%
expm1-log1p-u47.3%
expm1-udef2.1%
metadata-eval2.1%
sqrt-pow12.1%
inv-pow2.1%
sqrt-div2.1%
metadata-eval2.1%
associate-*l/2.1%
metadata-eval2.1%
Applied egg-rr2.1%
expm1-def47.3%
expm1-log1p96.7%
Simplified96.7%
if -2.50000000000000003e54 < y < 1.2e104Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.7%
fma-def99.7%
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 92.9%
div-inv92.9%
clear-num92.9%
div-inv92.9%
metadata-eval92.9%
Applied egg-rr92.9%
Final simplification94.3%
(FPCore (x y) :precision binary64 (if (or (<= y -2e+54) (not (<= y 1.2e+104))) (/ -0.3333333333333333 (/ (sqrt x) y)) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -2e+54) || !(y <= 1.2e+104)) {
tmp = -0.3333333333333333 / (sqrt(x) / y);
} 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 <= (-2d+54)) .or. (.not. (y <= 1.2d+104))) then
tmp = (-0.3333333333333333d0) / (sqrt(x) / y)
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 <= -2e+54) || !(y <= 1.2e+104)) {
tmp = -0.3333333333333333 / (Math.sqrt(x) / y);
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -2e+54) or not (y <= 1.2e+104): tmp = -0.3333333333333333 / (math.sqrt(x) / y) else: tmp = 1.0 + (-1.0 / (x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -2e+54) || !(y <= 1.2e+104)) tmp = Float64(-0.3333333333333333 / Float64(sqrt(x) / y)); 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 <= -2e+54) || ~((y <= 1.2e+104))) tmp = -0.3333333333333333 / (sqrt(x) / y); else tmp = 1.0 + (-1.0 / (x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -2e+54], N[Not[LessEqual[y, 1.2e+104]], $MachinePrecision]], N[(-0.3333333333333333 / N[(N[Sqrt[x], $MachinePrecision] / y), $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 -2 \cdot 10^{+54} \lor \neg \left(y \leq 1.2 \cdot 10^{+104}\right):\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{\sqrt{x}}{y}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -2.0000000000000002e54 or 1.2e104 < y Initial program 99.6%
associate--l-99.6%
+-commutative99.6%
+-commutative99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 96.7%
associate-*r*96.8%
Simplified96.8%
associate-*l*96.7%
sqrt-div96.7%
metadata-eval96.7%
div-inv96.8%
clear-num96.8%
un-div-inv96.8%
Applied egg-rr96.8%
if -2.0000000000000002e54 < y < 1.2e104Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.7%
fma-def99.7%
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 92.9%
div-inv92.9%
clear-num92.9%
div-inv92.9%
metadata-eval92.9%
Applied egg-rr92.9%
Final simplification94.3%
(FPCore (x y)
:precision binary64
(if (<= y 1.4e+154)
(+ 1.0 (/ -1.0 (* x 9.0)))
(/
(- 1.0 (/ 0.012345679012345678 (* x x)))
(- 1.0 (/ -0.1111111111111111 x)))))
double code(double x, double y) {
double tmp;
if (y <= 1.4e+154) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = (1.0 - (0.012345679012345678 / (x * x))) / (1.0 - (-0.1111111111111111 / 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.4d+154) then
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
else
tmp = (1.0d0 - (0.012345679012345678d0 / (x * x))) / (1.0d0 - ((-0.1111111111111111d0) / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.4e+154) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = (1.0 - (0.012345679012345678 / (x * x))) / (1.0 - (-0.1111111111111111 / x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.4e+154: tmp = 1.0 + (-1.0 / (x * 9.0)) else: tmp = (1.0 - (0.012345679012345678 / (x * x))) / (1.0 - (-0.1111111111111111 / x)) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.4e+154) tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); else tmp = Float64(Float64(1.0 - Float64(0.012345679012345678 / Float64(x * x))) / Float64(1.0 - Float64(-0.1111111111111111 / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.4e+154) tmp = 1.0 + (-1.0 / (x * 9.0)); else tmp = (1.0 - (0.012345679012345678 / (x * x))) / (1.0 - (-0.1111111111111111 / x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.4e+154], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(0.012345679012345678 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(-0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \frac{0.012345679012345678}{x \cdot x}}{1 - \frac{-0.1111111111111111}{x}}\\
\end{array}
\end{array}
if y < 1.4e154Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
*-commutative99.7%
associate-*r/99.6%
fma-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 0 68.6%
div-inv68.6%
clear-num68.6%
div-inv68.6%
metadata-eval68.6%
Applied egg-rr68.6%
if 1.4e154 < y Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
*-commutative99.6%
associate-*r/99.1%
fma-def99.1%
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 0 3.6%
cancel-sign-sub-inv3.6%
metadata-eval3.6%
associate-*r/3.6%
metadata-eval3.6%
+-commutative3.6%
Simplified3.6%
add-sqr-sqrt0.0%
sqrt-unprod0.7%
frac-times0.7%
metadata-eval0.7%
metadata-eval0.7%
frac-times0.7%
pow10.7%
pow10.7%
pow-prod-up0.7%
clear-num0.7%
div-inv0.7%
metadata-eval0.7%
pow-plus0.7%
pow10.7%
sqrt-unprod0.7%
add-sqr-sqrt0.7%
inv-pow0.7%
Applied egg-rr0.7%
unpow-10.7%
Simplified0.7%
+-commutative0.7%
flip-+0.7%
metadata-eval0.7%
pow20.7%
*-commutative0.7%
associate-/r*0.7%
metadata-eval0.7%
metadata-eval0.7%
remove-double-neg0.7%
frac-2neg0.7%
pow20.7%
frac-times0.7%
metadata-eval0.7%
sqr-neg0.7%
*-commutative0.7%
associate-/r*0.7%
metadata-eval0.7%
metadata-eval0.7%
associate-/r*0.7%
neg-mul-10.7%
add-sqr-sqrt0.0%
sqrt-unprod1.5%
sqr-neg1.5%
sqrt-unprod25.5%
add-sqr-sqrt25.5%
Applied egg-rr25.5%
Final simplification63.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.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
*-commutative99.7%
associate-*r/99.6%
fma-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 0 61.0%
div-inv61.0%
clear-num61.0%
div-inv61.0%
metadata-eval61.0%
Applied egg-rr61.0%
Final simplification61.0%
(FPCore (x y) :precision binary64 (if (<= x 10.0) (/ -0.1111111111111111 x) 1.0))
double code(double x, double y) {
double tmp;
if (x <= 10.0) {
tmp = -0.1111111111111111 / x;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 10.0d0) then
tmp = (-0.1111111111111111d0) / x
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 10.0) {
tmp = -0.1111111111111111 / x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 10.0: tmp = -0.1111111111111111 / x else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 10.0) tmp = Float64(-0.1111111111111111 / x); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 10.0) tmp = -0.1111111111111111 / x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 10.0], N[(-0.1111111111111111 / x), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10:\\
\;\;\;\;\frac{-0.1111111111111111}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < 10Initial program 99.6%
associate--l-99.6%
+-commutative99.6%
+-commutative99.6%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in x around 0 99.6%
Taylor expanded in x around 0 60.2%
if 10 < x Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
*-commutative99.8%
associate-*r/99.7%
fma-def99.7%
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 x around inf 59.9%
Final simplification60.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-neg-frac99.7%
neg-mul-199.7%
*-commutative99.7%
associate-*r/99.6%
fma-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 0 61.0%
cancel-sign-sub-inv61.0%
metadata-eval61.0%
associate-*r/61.0%
metadata-eval61.0%
+-commutative61.0%
Simplified61.0%
Final simplification61.0%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
*-commutative99.7%
associate-*r/99.6%
fma-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 x around inf 29.2%
Final simplification29.2%
(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 2023224
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, D"
:precision binary64
:herbie-target
(- (- 1.0 (/ (/ 1.0 x) 9.0)) (/ y (* 3.0 (sqrt x))))
(- (- 1.0 (/ 1.0 (* x 9.0))) (/ y (* 3.0 (sqrt x)))))