
(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 13 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 (/ 0.1111111111111111 x)) (/ y (sqrt (* x 9.0)))))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y / sqrt((x * 9.0)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (0.1111111111111111d0 / x)) - (y / sqrt((x * 9.0d0)))
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y / Math.sqrt((x * 9.0)));
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) - (y / math.sqrt((x * 9.0)))
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) - Float64(y / sqrt(Float64(x * 9.0)))) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) - (y / sqrt((x * 9.0))); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] - N[(y / N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) - \frac{y}{\sqrt{x \cdot 9}}
\end{array}
Initial program 99.7%
*-commutative99.7%
metadata-eval99.7%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in x around 0 99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(if (<= y -7.6e+94)
(* y (* -0.3333333333333333 (sqrt (/ 1.0 x))))
(if (<= y 1.1e+54)
(+ 1.0 (/ (/ -1.0 x) 9.0))
(* (* y -0.3333333333333333) (/ 1.0 (sqrt x))))))
double code(double x, double y) {
double tmp;
if (y <= -7.6e+94) {
tmp = y * (-0.3333333333333333 * sqrt((1.0 / x)));
} else if (y <= 1.1e+54) {
tmp = 1.0 + ((-1.0 / x) / 9.0);
} else {
tmp = (y * -0.3333333333333333) * (1.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 (y <= (-7.6d+94)) then
tmp = y * ((-0.3333333333333333d0) * sqrt((1.0d0 / x)))
else if (y <= 1.1d+54) then
tmp = 1.0d0 + (((-1.0d0) / x) / 9.0d0)
else
tmp = (y * (-0.3333333333333333d0)) * (1.0d0 / sqrt(x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -7.6e+94) {
tmp = y * (-0.3333333333333333 * Math.sqrt((1.0 / x)));
} else if (y <= 1.1e+54) {
tmp = 1.0 + ((-1.0 / x) / 9.0);
} else {
tmp = (y * -0.3333333333333333) * (1.0 / Math.sqrt(x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -7.6e+94: tmp = y * (-0.3333333333333333 * math.sqrt((1.0 / x))) elif y <= 1.1e+54: tmp = 1.0 + ((-1.0 / x) / 9.0) else: tmp = (y * -0.3333333333333333) * (1.0 / math.sqrt(x)) return tmp
function code(x, y) tmp = 0.0 if (y <= -7.6e+94) tmp = Float64(y * Float64(-0.3333333333333333 * sqrt(Float64(1.0 / x)))); elseif (y <= 1.1e+54) tmp = Float64(1.0 + Float64(Float64(-1.0 / x) / 9.0)); else tmp = Float64(Float64(y * -0.3333333333333333) * Float64(1.0 / sqrt(x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -7.6e+94) tmp = y * (-0.3333333333333333 * sqrt((1.0 / x))); elseif (y <= 1.1e+54) tmp = 1.0 + ((-1.0 / x) / 9.0); else tmp = (y * -0.3333333333333333) * (1.0 / sqrt(x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -7.6e+94], N[(y * N[(-0.3333333333333333 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e+54], N[(1.0 + N[(N[(-1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * -0.3333333333333333), $MachinePrecision] * N[(1.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+94}:\\
\;\;\;\;y \cdot \left(-0.3333333333333333 \cdot \sqrt{\frac{1}{x}}\right)\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+54}:\\
\;\;\;\;1 + \frac{\frac{-1}{x}}{9}\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot -0.3333333333333333\right) \cdot \frac{1}{\sqrt{x}}\\
\end{array}
\end{array}
if y < -7.5999999999999993e94Initial program 99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.8%
pow1/299.8%
Applied egg-rr99.8%
unpow1/299.8%
Simplified99.8%
Taylor expanded in y around inf 96.5%
associate-*r*96.3%
*-commutative96.3%
associate-*l*96.4%
Simplified96.4%
if -7.5999999999999993e94 < y < 1.09999999999999995e54Initial program 99.8%
sub-neg99.8%
distribute-frac-neg99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 95.1%
*-commutative95.1%
inv-pow95.1%
metadata-eval95.1%
unpow-prod-down95.0%
inv-pow95.0%
associate-/r*95.1%
Applied egg-rr95.1%
if 1.09999999999999995e54 < y Initial program 99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in y around inf 94.9%
associate-*r*94.8%
Simplified94.8%
sqrt-div95.0%
metadata-eval95.0%
Applied egg-rr95.0%
Final simplification95.3%
(FPCore (x y)
:precision binary64
(if (<= y -1.35e+95)
(* -0.3333333333333333 (* y (sqrt (/ 1.0 x))))
(if (<= y 1.25e+54)
(+ 1.0 (/ (/ -1.0 x) 9.0))
(* (* y -0.3333333333333333) (/ 1.0 (sqrt x))))))
double code(double x, double y) {
double tmp;
if (y <= -1.35e+95) {
tmp = -0.3333333333333333 * (y * sqrt((1.0 / x)));
} else if (y <= 1.25e+54) {
tmp = 1.0 + ((-1.0 / x) / 9.0);
} else {
tmp = (y * -0.3333333333333333) * (1.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 (y <= (-1.35d+95)) then
tmp = (-0.3333333333333333d0) * (y * sqrt((1.0d0 / x)))
else if (y <= 1.25d+54) then
tmp = 1.0d0 + (((-1.0d0) / x) / 9.0d0)
else
tmp = (y * (-0.3333333333333333d0)) * (1.0d0 / sqrt(x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.35e+95) {
tmp = -0.3333333333333333 * (y * Math.sqrt((1.0 / x)));
} else if (y <= 1.25e+54) {
tmp = 1.0 + ((-1.0 / x) / 9.0);
} else {
tmp = (y * -0.3333333333333333) * (1.0 / Math.sqrt(x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.35e+95: tmp = -0.3333333333333333 * (y * math.sqrt((1.0 / x))) elif y <= 1.25e+54: tmp = 1.0 + ((-1.0 / x) / 9.0) else: tmp = (y * -0.3333333333333333) * (1.0 / math.sqrt(x)) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.35e+95) tmp = Float64(-0.3333333333333333 * Float64(y * sqrt(Float64(1.0 / x)))); elseif (y <= 1.25e+54) tmp = Float64(1.0 + Float64(Float64(-1.0 / x) / 9.0)); else tmp = Float64(Float64(y * -0.3333333333333333) * Float64(1.0 / sqrt(x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.35e+95) tmp = -0.3333333333333333 * (y * sqrt((1.0 / x))); elseif (y <= 1.25e+54) tmp = 1.0 + ((-1.0 / x) / 9.0); else tmp = (y * -0.3333333333333333) * (1.0 / sqrt(x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.35e+95], N[(-0.3333333333333333 * N[(y * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e+54], N[(1.0 + N[(N[(-1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * -0.3333333333333333), $MachinePrecision] * N[(1.0 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+95}:\\
\;\;\;\;-0.3333333333333333 \cdot \left(y \cdot \sqrt{\frac{1}{x}}\right)\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+54}:\\
\;\;\;\;1 + \frac{\frac{-1}{x}}{9}\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot -0.3333333333333333\right) \cdot \frac{1}{\sqrt{x}}\\
\end{array}
\end{array}
if y < -1.35e95Initial program 99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.8%
pow1/299.8%
Applied egg-rr99.8%
unpow1/299.8%
Simplified99.8%
Taylor expanded in y around inf 96.5%
*-commutative96.5%
Simplified96.5%
if -1.35e95 < y < 1.25000000000000001e54Initial program 99.8%
sub-neg99.8%
distribute-frac-neg99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 95.1%
*-commutative95.1%
inv-pow95.1%
metadata-eval95.1%
unpow-prod-down95.0%
inv-pow95.0%
associate-/r*95.1%
Applied egg-rr95.1%
if 1.25000000000000001e54 < y Initial program 99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in y around inf 94.9%
associate-*r*94.8%
Simplified94.8%
sqrt-div95.0%
metadata-eval95.0%
Applied egg-rr95.0%
Final simplification95.3%
(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%
distribute-frac-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y) :precision binary64 (if (or (<= y -1.6e+95) (not (<= y 6.8e+54))) (* (* y -0.3333333333333333) (pow x -0.5)) (+ 1.0 (/ (/ -1.0 x) 9.0))))
double code(double x, double y) {
double tmp;
if ((y <= -1.6e+95) || !(y <= 6.8e+54)) {
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 <= (-1.6d+95)) .or. (.not. (y <= 6.8d+54))) 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 <= -1.6e+95) || !(y <= 6.8e+54)) {
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 <= -1.6e+95) or not (y <= 6.8e+54): 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 <= -1.6e+95) || !(y <= 6.8e+54)) tmp = Float64(Float64(y * -0.3333333333333333) * (x ^ -0.5)); else tmp = Float64(1.0 + Float64(Float64(-1.0 / x) / 9.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.6e+95) || ~((y <= 6.8e+54))) 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, -1.6e+95], N[Not[LessEqual[y, 6.8e+54]], $MachinePrecision]], N[(N[(y * -0.3333333333333333), $MachinePrecision] * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(-1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+95} \lor \neg \left(y \leq 6.8 \cdot 10^{+54}\right):\\
\;\;\;\;\left(y \cdot -0.3333333333333333\right) \cdot {x}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{-1}{x}}{9}\\
\end{array}
\end{array}
if y < -1.6e95 or 6.8000000000000001e54 < y Initial program 99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in y around inf 95.7%
associate-*r*95.6%
Simplified95.6%
add-log-exp30.6%
*-un-lft-identity30.6%
log-prod30.6%
metadata-eval30.6%
add-log-exp95.6%
inv-pow95.6%
sqrt-pow195.6%
metadata-eval95.6%
Applied egg-rr95.6%
+-lft-identity95.6%
Simplified95.6%
if -1.6e95 < y < 6.8000000000000001e54Initial program 99.8%
sub-neg99.8%
distribute-frac-neg99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 95.1%
*-commutative95.1%
inv-pow95.1%
metadata-eval95.1%
unpow-prod-down95.0%
inv-pow95.0%
associate-/r*95.1%
Applied egg-rr95.1%
Final simplification95.3%
(FPCore (x y)
:precision binary64
(if (<= y -1.05e+95)
(* y (* -0.3333333333333333 (sqrt (/ 1.0 x))))
(if (<= y 7e+55)
(+ 1.0 (/ (/ -1.0 x) 9.0))
(* (* y -0.3333333333333333) (pow x -0.5)))))
double code(double x, double y) {
double tmp;
if (y <= -1.05e+95) {
tmp = y * (-0.3333333333333333 * sqrt((1.0 / x)));
} else if (y <= 7e+55) {
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 <= (-1.05d+95)) then
tmp = y * ((-0.3333333333333333d0) * sqrt((1.0d0 / x)))
else if (y <= 7d+55) 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 <= -1.05e+95) {
tmp = y * (-0.3333333333333333 * Math.sqrt((1.0 / x)));
} else if (y <= 7e+55) {
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 <= -1.05e+95: tmp = y * (-0.3333333333333333 * math.sqrt((1.0 / x))) elif y <= 7e+55: 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 <= -1.05e+95) tmp = Float64(y * Float64(-0.3333333333333333 * sqrt(Float64(1.0 / x)))); elseif (y <= 7e+55) tmp = Float64(1.0 + Float64(Float64(-1.0 / 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 <= -1.05e+95) tmp = y * (-0.3333333333333333 * sqrt((1.0 / x))); elseif (y <= 7e+55) 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, -1.05e+95], N[(y * N[(-0.3333333333333333 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+55], N[(1.0 + N[(N[(-1.0 / x), $MachinePrecision] / 9.0), $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 -1.05 \cdot 10^{+95}:\\
\;\;\;\;y \cdot \left(-0.3333333333333333 \cdot \sqrt{\frac{1}{x}}\right)\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+55}:\\
\;\;\;\;1 + \frac{\frac{-1}{x}}{9}\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot -0.3333333333333333\right) \cdot {x}^{-0.5}\\
\end{array}
\end{array}
if y < -1.05e95Initial program 99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.8%
pow1/299.8%
Applied egg-rr99.8%
unpow1/299.8%
Simplified99.8%
Taylor expanded in y around inf 96.5%
associate-*r*96.3%
*-commutative96.3%
associate-*l*96.4%
Simplified96.4%
if -1.05e95 < y < 7.00000000000000021e55Initial program 99.8%
sub-neg99.8%
distribute-frac-neg99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 95.1%
*-commutative95.1%
inv-pow95.1%
metadata-eval95.1%
unpow-prod-down95.0%
inv-pow95.0%
associate-/r*95.1%
Applied egg-rr95.1%
if 7.00000000000000021e55 < y Initial program 99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in y around inf 94.9%
associate-*r*94.8%
Simplified94.8%
add-log-exp30.5%
*-un-lft-identity30.5%
log-prod30.5%
metadata-eval30.5%
add-log-exp94.8%
inv-pow94.8%
sqrt-pow194.9%
metadata-eval94.9%
Applied egg-rr94.9%
+-lft-identity94.9%
Simplified94.9%
Final simplification95.3%
(FPCore (x y) :precision binary64 (if (<= y -1.1e+137) (sqrt (/ 0.012345679012345678 (* x x))) (+ 1.0 (/ (/ -1.0 x) 9.0))))
double code(double x, double y) {
double tmp;
if (y <= -1.1e+137) {
tmp = sqrt((0.012345679012345678 / (x * 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.1d+137)) then
tmp = sqrt((0.012345679012345678d0 / (x * 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.1e+137) {
tmp = Math.sqrt((0.012345679012345678 / (x * x)));
} else {
tmp = 1.0 + ((-1.0 / x) / 9.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.1e+137: tmp = math.sqrt((0.012345679012345678 / (x * x))) else: tmp = 1.0 + ((-1.0 / x) / 9.0) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.1e+137) tmp = sqrt(Float64(0.012345679012345678 / Float64(x * x))); else tmp = Float64(1.0 + Float64(Float64(-1.0 / x) / 9.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.1e+137) tmp = sqrt((0.012345679012345678 / (x * x))); else tmp = 1.0 + ((-1.0 / x) / 9.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.1e+137], N[Sqrt[N[(0.012345679012345678 / N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(1.0 + N[(N[(-1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+137}:\\
\;\;\;\;\sqrt{\frac{0.012345679012345678}{x \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{-1}{x}}{9}\\
\end{array}
\end{array}
if y < -1.10000000000000008e137Initial program 99.5%
sub-neg99.5%
distribute-frac-neg99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
neg-mul-199.5%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 0.9%
div-inv0.9%
Applied egg-rr0.9%
un-div-inv0.9%
clear-num0.9%
add-sqr-sqrt0.0%
sqrt-unprod20.8%
div-inv20.8%
div-inv20.8%
swap-sqr20.8%
metadata-eval20.8%
metadata-eval20.8%
metadata-eval20.8%
metadata-eval20.8%
swap-sqr20.8%
sqrt-unprod4.7%
add-sqr-sqrt4.7%
metadata-eval4.7%
div-inv4.7%
clear-num4.7%
add-sqr-sqrt4.7%
sqrt-unprod20.8%
frac-times20.8%
metadata-eval20.8%
Applied egg-rr20.8%
if -1.10000000000000008e137 < y Initial program 99.7%
sub-neg99.7%
distribute-frac-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 72.6%
*-commutative72.6%
inv-pow72.6%
metadata-eval72.6%
unpow-prod-down72.6%
inv-pow72.6%
associate-/r*72.6%
Applied egg-rr72.6%
Final simplification64.3%
(FPCore (x y) :precision binary64 (if (<= x 0.0034) (* (/ 1.0 x) -0.1111111111111111) 1.0))
double code(double x, double y) {
double tmp;
if (x <= 0.0034) {
tmp = (1.0 / x) * -0.1111111111111111;
} 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 <= 0.0034d0) then
tmp = (1.0d0 / x) * (-0.1111111111111111d0)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.0034) {
tmp = (1.0 / x) * -0.1111111111111111;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.0034: tmp = (1.0 / x) * -0.1111111111111111 else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 0.0034) tmp = Float64(Float64(1.0 / x) * -0.1111111111111111); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.0034) tmp = (1.0 / x) * -0.1111111111111111; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.0034], N[(N[(1.0 / x), $MachinePrecision] * -0.1111111111111111), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0034:\\
\;\;\;\;\frac{1}{x} \cdot -0.1111111111111111\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < 0.00339999999999999981Initial program 99.6%
sub-neg99.6%
distribute-frac-neg99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
neg-mul-199.6%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 59.9%
div-inv60.0%
Applied egg-rr60.0%
if 0.00339999999999999981 < x Initial program 99.8%
sub-neg99.8%
distribute-frac-neg99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 61.3%
Final simplification60.6%
(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.7%
sub-neg99.7%
distribute-frac-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 61.4%
Final simplification61.4%
(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(Float64(-1.0 / 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[(N[(-1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{\frac{-1}{x}}{9}
\end{array}
Initial program 99.7%
sub-neg99.7%
distribute-frac-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 61.4%
*-commutative61.4%
inv-pow61.4%
metadata-eval61.4%
unpow-prod-down61.4%
inv-pow61.4%
associate-/r*61.4%
Applied egg-rr61.4%
Final simplification61.4%
(FPCore (x y) :precision binary64 (if (<= x 0.0034) (/ -0.1111111111111111 x) 1.0))
double code(double x, double y) {
double tmp;
if (x <= 0.0034) {
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 <= 0.0034d0) 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 <= 0.0034) {
tmp = -0.1111111111111111 / x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.0034: tmp = -0.1111111111111111 / x else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 0.0034) tmp = Float64(-0.1111111111111111 / x); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.0034) tmp = -0.1111111111111111 / x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.0034], N[(-0.1111111111111111 / x), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0034:\\
\;\;\;\;\frac{-0.1111111111111111}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < 0.00339999999999999981Initial program 99.6%
sub-neg99.6%
distribute-frac-neg99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
neg-mul-199.6%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 59.9%
if 0.00339999999999999981 < x Initial program 99.8%
sub-neg99.8%
distribute-frac-neg99.8%
*-commutative99.8%
associate-/r*99.8%
metadata-eval99.8%
neg-mul-199.8%
times-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 61.3%
Final simplification60.6%
(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%
sub-neg99.7%
distribute-frac-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 61.4%
cancel-sign-sub-inv61.4%
metadata-eval61.4%
associate-*r/61.4%
metadata-eval61.4%
Simplified61.4%
Final simplification61.4%
(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%
sub-neg99.7%
distribute-frac-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 31.6%
Final simplification31.6%
(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 2023279
(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)))))