
(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)) 3.0)))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - ((y / sqrt(x)) / 3.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (0.1111111111111111d0 / x)) - ((y / sqrt(x)) / 3.0d0)
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - ((y / Math.sqrt(x)) / 3.0);
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) - ((y / math.sqrt(x)) / 3.0)
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) - Float64(Float64(y / sqrt(x)) / 3.0)) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) - ((y / sqrt(x)) / 3.0); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] - N[(N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) - \frac{\frac{y}{\sqrt{x}}}{3}
\end{array}
Initial program 99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
*-commutative99.7%
metadata-eval99.7%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
expm1-log1p-u72.4%
expm1-udef72.4%
sqrt-prod72.4%
metadata-eval72.4%
Applied egg-rr72.4%
expm1-def72.4%
expm1-log1p99.7%
associate-/r*99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y) :precision binary64 (if (or (<= y -4.6e+52) (not (<= y 2.05e+65))) (+ 1.0 (* (/ y (sqrt x)) -0.3333333333333333)) (- 1.0 (pow (* x 9.0) -1.0))))
double code(double x, double y) {
double tmp;
if ((y <= -4.6e+52) || !(y <= 2.05e+65)) {
tmp = 1.0 + ((y / sqrt(x)) * -0.3333333333333333);
} else {
tmp = 1.0 - pow((x * 9.0), -1.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.6d+52)) .or. (.not. (y <= 2.05d+65))) then
tmp = 1.0d0 + ((y / sqrt(x)) * (-0.3333333333333333d0))
else
tmp = 1.0d0 - ((x * 9.0d0) ** (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -4.6e+52) || !(y <= 2.05e+65)) {
tmp = 1.0 + ((y / Math.sqrt(x)) * -0.3333333333333333);
} else {
tmp = 1.0 - Math.pow((x * 9.0), -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -4.6e+52) or not (y <= 2.05e+65): tmp = 1.0 + ((y / math.sqrt(x)) * -0.3333333333333333) else: tmp = 1.0 - math.pow((x * 9.0), -1.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= -4.6e+52) || !(y <= 2.05e+65)) tmp = Float64(1.0 + Float64(Float64(y / sqrt(x)) * -0.3333333333333333)); else tmp = Float64(1.0 - (Float64(x * 9.0) ^ -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -4.6e+52) || ~((y <= 2.05e+65))) tmp = 1.0 + ((y / sqrt(x)) * -0.3333333333333333); else tmp = 1.0 - ((x * 9.0) ^ -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -4.6e+52], N[Not[LessEqual[y, 2.05e+65]], $MachinePrecision]], N[(1.0 + N[(N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[Power[N[(x * 9.0), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+52} \lor \neg \left(y \leq 2.05 \cdot 10^{+65}\right):\\
\;\;\;\;1 + \frac{y}{\sqrt{x}} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;1 - {\left(x \cdot 9\right)}^{-1}\\
\end{array}
\end{array}
if y < -4.6e52 or 2.0500000000000001e65 < 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%
times-frac99.6%
*-commutative99.6%
fma-def99.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 inf 95.0%
*-commutative95.0%
Simplified95.0%
pow1/285.5%
inv-pow85.5%
pow-pow85.5%
metadata-eval85.5%
metadata-eval85.5%
pow-prod-up85.4%
pow1/285.4%
inv-pow85.4%
Applied egg-rr94.9%
associate-*r/85.4%
*-rgt-identity85.4%
Simplified94.9%
associate-*r/71.8%
associate-/l*85.4%
pow185.4%
pow1/285.4%
pow-div85.6%
metadata-eval85.6%
pow1/285.6%
expm1-log1p-u37.5%
expm1-udef37.4%
Applied egg-rr46.2%
expm1-def37.5%
expm1-log1p85.6%
Simplified95.2%
if -4.6e52 < y < 2.0500000000000001e65Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac99.7%
*-commutative99.7%
fma-def99.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 95.0%
associate-*r/95.1%
metadata-eval95.1%
Simplified95.1%
div-inv95.0%
metadata-eval95.0%
inv-pow95.0%
unpow-prod-down95.1%
*-commutative95.1%
Applied egg-rr95.1%
Final simplification95.2%
(FPCore (x y) :precision binary64 (if (or (<= y -2.1e+54) (not (<= y 4.2e+66))) (+ 1.0 (/ (/ y (sqrt x)) -3.0)) (- 1.0 (pow (* x 9.0) -1.0))))
double code(double x, double y) {
double tmp;
if ((y <= -2.1e+54) || !(y <= 4.2e+66)) {
tmp = 1.0 + ((y / sqrt(x)) / -3.0);
} else {
tmp = 1.0 - pow((x * 9.0), -1.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.1d+54)) .or. (.not. (y <= 4.2d+66))) then
tmp = 1.0d0 + ((y / sqrt(x)) / (-3.0d0))
else
tmp = 1.0d0 - ((x * 9.0d0) ** (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -2.1e+54) || !(y <= 4.2e+66)) {
tmp = 1.0 + ((y / Math.sqrt(x)) / -3.0);
} else {
tmp = 1.0 - Math.pow((x * 9.0), -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -2.1e+54) or not (y <= 4.2e+66): tmp = 1.0 + ((y / math.sqrt(x)) / -3.0) else: tmp = 1.0 - math.pow((x * 9.0), -1.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= -2.1e+54) || !(y <= 4.2e+66)) tmp = Float64(1.0 + Float64(Float64(y / sqrt(x)) / -3.0)); else tmp = Float64(1.0 - (Float64(x * 9.0) ^ -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -2.1e+54) || ~((y <= 4.2e+66))) tmp = 1.0 + ((y / sqrt(x)) / -3.0); else tmp = 1.0 - ((x * 9.0) ^ -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -2.1e+54], N[Not[LessEqual[y, 4.2e+66]], $MachinePrecision]], N[(1.0 + N[(N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[Power[N[(x * 9.0), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+54} \lor \neg \left(y \leq 4.2 \cdot 10^{+66}\right):\\
\;\;\;\;1 + \frac{\frac{y}{\sqrt{x}}}{-3}\\
\mathbf{else}:\\
\;\;\;\;1 - {\left(x \cdot 9\right)}^{-1}\\
\end{array}
\end{array}
if y < -2.09999999999999986e54 or 4.20000000000000011e66 < 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%
times-frac99.6%
*-commutative99.6%
fma-def99.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 inf 95.0%
*-commutative95.0%
Simplified95.0%
pow1/285.5%
inv-pow85.5%
pow-pow85.5%
metadata-eval85.5%
metadata-eval85.5%
pow-prod-up85.4%
pow1/285.4%
inv-pow85.4%
Applied egg-rr94.9%
associate-*r/85.4%
*-rgt-identity85.4%
Simplified94.9%
associate-*l*85.4%
pow1/285.4%
pow185.4%
pow-div85.4%
metadata-eval85.4%
metadata-eval85.4%
sqrt-pow185.4%
inv-pow85.4%
associate-*r*85.5%
add-sqr-sqrt85.5%
sqr-neg85.5%
sqrt-unprod0.0%
add-sqr-sqrt1.0%
distribute-rgt-neg-in1.0%
sqrt-div1.0%
metadata-eval1.0%
div-inv1.0%
metadata-eval1.0%
metadata-eval1.0%
div-inv1.0%
Applied egg-rr95.4%
if -2.09999999999999986e54 < y < 4.20000000000000011e66Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac99.7%
*-commutative99.7%
fma-def99.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 95.0%
associate-*r/95.1%
metadata-eval95.1%
Simplified95.1%
div-inv95.0%
metadata-eval95.0%
inv-pow95.0%
unpow-prod-down95.1%
*-commutative95.1%
Applied egg-rr95.1%
Final simplification95.2%
(FPCore (x y) :precision binary64 (+ 1.0 (+ (* (/ y (sqrt x)) -0.3333333333333333) (/ -0.1111111111111111 x))))
double code(double x, double y) {
return 1.0 + (((y / sqrt(x)) * -0.3333333333333333) + (-0.1111111111111111 / x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 + (((y / sqrt(x)) * (-0.3333333333333333d0)) + ((-0.1111111111111111d0) / x))
end function
public static double code(double x, double y) {
return 1.0 + (((y / Math.sqrt(x)) * -0.3333333333333333) + (-0.1111111111111111 / x));
}
def code(x, y): return 1.0 + (((y / math.sqrt(x)) * -0.3333333333333333) + (-0.1111111111111111 / x))
function code(x, y) return Float64(1.0 + Float64(Float64(Float64(y / sqrt(x)) * -0.3333333333333333) + Float64(-0.1111111111111111 / x))) end
function tmp = code(x, y) tmp = 1.0 + (((y / sqrt(x)) * -0.3333333333333333) + (-0.1111111111111111 / x)); end
code[x_, y_] := N[(1.0 + N[(N[(N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] + N[(-0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \left(\frac{y}{\sqrt{x}} \cdot -0.3333333333333333 + \frac{-0.1111111111111111}{x}\right)
\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%
times-frac99.7%
*-commutative99.7%
fma-def99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
fma-udef99.6%
Applied egg-rr99.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(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.6%
Final simplification99.6%
(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%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
*-commutative99.7%
metadata-eval99.7%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y) :precision binary64 (- (- 1.0 (/ 0.1111111111111111 x)) (/ y (* (sqrt x) 3.0))))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y / (sqrt(x) * 3.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (0.1111111111111111d0 / x)) - (y / (sqrt(x) * 3.0d0))
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y / (Math.sqrt(x) * 3.0));
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) - (y / (math.sqrt(x) * 3.0))
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) - Float64(y / Float64(sqrt(x) * 3.0))) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) - (y / (sqrt(x) * 3.0)); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] - N[(y / N[(N[Sqrt[x], $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) - \frac{y}{\sqrt{x} \cdot 3}
\end{array}
Initial program 99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y) :precision binary64 (if (or (<= y -3.3e+55) (not (<= y 1.35e+100))) (/ (/ y (sqrt x)) -3.0) (- 1.0 (pow (* x 9.0) -1.0))))
double code(double x, double y) {
double tmp;
if ((y <= -3.3e+55) || !(y <= 1.35e+100)) {
tmp = (y / sqrt(x)) / -3.0;
} else {
tmp = 1.0 - pow((x * 9.0), -1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-3.3d+55)) .or. (.not. (y <= 1.35d+100))) then
tmp = (y / sqrt(x)) / (-3.0d0)
else
tmp = 1.0d0 - ((x * 9.0d0) ** (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -3.3e+55) || !(y <= 1.35e+100)) {
tmp = (y / Math.sqrt(x)) / -3.0;
} else {
tmp = 1.0 - Math.pow((x * 9.0), -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -3.3e+55) or not (y <= 1.35e+100): tmp = (y / math.sqrt(x)) / -3.0 else: tmp = 1.0 - math.pow((x * 9.0), -1.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= -3.3e+55) || !(y <= 1.35e+100)) tmp = Float64(Float64(y / sqrt(x)) / -3.0); else tmp = Float64(1.0 - (Float64(x * 9.0) ^ -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -3.3e+55) || ~((y <= 1.35e+100))) tmp = (y / sqrt(x)) / -3.0; else tmp = 1.0 - ((x * 9.0) ^ -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -3.3e+55], N[Not[LessEqual[y, 1.35e+100]], $MachinePrecision]], N[(N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision], N[(1.0 - N[Power[N[(x * 9.0), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{+55} \lor \neg \left(y \leq 1.35 \cdot 10^{+100}\right):\\
\;\;\;\;\frac{\frac{y}{\sqrt{x}}}{-3}\\
\mathbf{else}:\\
\;\;\;\;1 - {\left(x \cdot 9\right)}^{-1}\\
\end{array}
\end{array}
if y < -3.3e55 or 1.34999999999999999e100 < y Initial program 99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
Taylor expanded in y around inf 89.9%
*-commutative89.9%
Simplified89.9%
pow1/289.9%
inv-pow89.9%
pow-pow89.9%
metadata-eval89.9%
metadata-eval89.9%
pow-prod-up89.8%
pow1/289.8%
inv-pow89.8%
Applied egg-rr89.8%
associate-*r/89.8%
*-rgt-identity89.8%
Simplified89.8%
associate-*l*89.7%
pow1/289.7%
pow189.7%
pow-div89.8%
metadata-eval89.8%
metadata-eval89.8%
sqrt-pow189.8%
inv-pow89.8%
associate-*r*89.9%
add-sqr-sqrt89.9%
sqr-neg89.9%
sqrt-unprod0.0%
add-sqr-sqrt0.8%
distribute-rgt-neg-in0.8%
sqrt-div0.8%
metadata-eval0.8%
div-inv0.8%
metadata-eval0.8%
metadata-eval0.8%
div-inv0.8%
Applied egg-rr90.2%
if -3.3e55 < y < 1.34999999999999999e100Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac99.7%
*-commutative99.7%
fma-def99.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.7%
associate-*r/92.8%
metadata-eval92.8%
Simplified92.8%
div-inv92.7%
metadata-eval92.7%
inv-pow92.7%
unpow-prod-down92.8%
*-commutative92.8%
Applied egg-rr92.8%
Final simplification91.8%
(FPCore (x y) :precision binary64 (if (or (<= y -3.3e+55) (not (<= y 2.6e+100))) (* (/ y (sqrt x)) -0.3333333333333333) (- 1.0 (/ 0.1111111111111111 x))))
double code(double x, double y) {
double tmp;
if ((y <= -3.3e+55) || !(y <= 2.6e+100)) {
tmp = (y / sqrt(x)) * -0.3333333333333333;
} else {
tmp = 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 <= (-3.3d+55)) .or. (.not. (y <= 2.6d+100))) then
tmp = (y / sqrt(x)) * (-0.3333333333333333d0)
else
tmp = 1.0d0 - (0.1111111111111111d0 / x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -3.3e+55) || !(y <= 2.6e+100)) {
tmp = (y / Math.sqrt(x)) * -0.3333333333333333;
} else {
tmp = 1.0 - (0.1111111111111111 / x);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -3.3e+55) or not (y <= 2.6e+100): tmp = (y / math.sqrt(x)) * -0.3333333333333333 else: tmp = 1.0 - (0.1111111111111111 / x) return tmp
function code(x, y) tmp = 0.0 if ((y <= -3.3e+55) || !(y <= 2.6e+100)) tmp = Float64(Float64(y / sqrt(x)) * -0.3333333333333333); else tmp = Float64(1.0 - Float64(0.1111111111111111 / x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -3.3e+55) || ~((y <= 2.6e+100))) tmp = (y / sqrt(x)) * -0.3333333333333333; else tmp = 1.0 - (0.1111111111111111 / x); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -3.3e+55], N[Not[LessEqual[y, 2.6e+100]], $MachinePrecision]], N[(N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{+55} \lor \neg \left(y \leq 2.6 \cdot 10^{+100}\right):\\
\;\;\;\;\frac{y}{\sqrt{x}} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{0.1111111111111111}{x}\\
\end{array}
\end{array}
if y < -3.3e55 or 2.6000000000000002e100 < y Initial program 99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
Taylor expanded in y around inf 89.9%
*-commutative89.9%
Simplified89.9%
pow1/289.9%
inv-pow89.9%
pow-pow89.9%
metadata-eval89.9%
metadata-eval89.9%
pow-prod-up89.8%
pow1/289.8%
inv-pow89.8%
Applied egg-rr89.8%
associate-*r/89.8%
*-rgt-identity89.8%
Simplified89.8%
associate-*r/74.9%
associate-/l*89.8%
pow189.8%
pow1/289.8%
pow-div90.0%
metadata-eval90.0%
pow1/290.0%
expm1-log1p-u37.4%
expm1-udef37.2%
Applied egg-rr37.2%
expm1-def37.4%
expm1-log1p90.0%
Simplified90.0%
if -3.3e55 < y < 2.6000000000000002e100Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac99.7%
*-commutative99.7%
fma-def99.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.7%
associate-*r/92.8%
metadata-eval92.8%
Simplified92.8%
Final simplification91.7%
(FPCore (x y) :precision binary64 (if (or (<= y -1.45e+55) (not (<= y 1.35e+100))) (/ (/ y (sqrt x)) -3.0) (- 1.0 (/ 0.1111111111111111 x))))
double code(double x, double y) {
double tmp;
if ((y <= -1.45e+55) || !(y <= 1.35e+100)) {
tmp = (y / sqrt(x)) / -3.0;
} else {
tmp = 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.45d+55)) .or. (.not. (y <= 1.35d+100))) then
tmp = (y / sqrt(x)) / (-3.0d0)
else
tmp = 1.0d0 - (0.1111111111111111d0 / x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.45e+55) || !(y <= 1.35e+100)) {
tmp = (y / Math.sqrt(x)) / -3.0;
} else {
tmp = 1.0 - (0.1111111111111111 / x);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.45e+55) or not (y <= 1.35e+100): tmp = (y / math.sqrt(x)) / -3.0 else: tmp = 1.0 - (0.1111111111111111 / x) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.45e+55) || !(y <= 1.35e+100)) tmp = Float64(Float64(y / sqrt(x)) / -3.0); else tmp = Float64(1.0 - Float64(0.1111111111111111 / x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.45e+55) || ~((y <= 1.35e+100))) tmp = (y / sqrt(x)) / -3.0; else tmp = 1.0 - (0.1111111111111111 / x); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.45e+55], N[Not[LessEqual[y, 1.35e+100]], $MachinePrecision]], N[(N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision], N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+55} \lor \neg \left(y \leq 1.35 \cdot 10^{+100}\right):\\
\;\;\;\;\frac{\frac{y}{\sqrt{x}}}{-3}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{0.1111111111111111}{x}\\
\end{array}
\end{array}
if y < -1.4499999999999999e55 or 1.34999999999999999e100 < y Initial program 99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
Taylor expanded in y around inf 89.9%
*-commutative89.9%
Simplified89.9%
pow1/289.9%
inv-pow89.9%
pow-pow89.9%
metadata-eval89.9%
metadata-eval89.9%
pow-prod-up89.8%
pow1/289.8%
inv-pow89.8%
Applied egg-rr89.8%
associate-*r/89.8%
*-rgt-identity89.8%
Simplified89.8%
associate-*l*89.7%
pow1/289.7%
pow189.7%
pow-div89.8%
metadata-eval89.8%
metadata-eval89.8%
sqrt-pow189.8%
inv-pow89.8%
associate-*r*89.9%
add-sqr-sqrt89.9%
sqr-neg89.9%
sqrt-unprod0.0%
add-sqr-sqrt0.8%
distribute-rgt-neg-in0.8%
sqrt-div0.8%
metadata-eval0.8%
div-inv0.8%
metadata-eval0.8%
metadata-eval0.8%
div-inv0.8%
Applied egg-rr90.2%
if -1.4499999999999999e55 < y < 1.34999999999999999e100Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac99.7%
*-commutative99.7%
fma-def99.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.7%
associate-*r/92.8%
metadata-eval92.8%
Simplified92.8%
Final simplification91.8%
(FPCore (x y) :precision binary64 (if (<= x 0.05) (/ -0.1111111111111111 x) 1.0))
double code(double x, double y) {
double tmp;
if (x <= 0.05) {
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.05d0) 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.05) {
tmp = -0.1111111111111111 / x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.05: tmp = -0.1111111111111111 / x else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 0.05) 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.05) tmp = -0.1111111111111111 / x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.05], N[(-0.1111111111111111 / x), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.05:\\
\;\;\;\;\frac{-0.1111111111111111}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < 0.050000000000000003Initial program 99.6%
*-commutative99.6%
associate-/r*99.5%
metadata-eval99.5%
Simplified99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.5%
pow1/299.5%
Applied egg-rr99.5%
unpow1/299.5%
Simplified99.5%
Taylor expanded in x around 0 66.0%
if 0.050000000000000003 < 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%
times-frac99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.8%
distribute-neg-frac99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 57.1%
Final simplification61.4%
(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%
times-frac99.7%
*-commutative99.7%
fma-def99.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 62.2%
associate-*r/62.3%
metadata-eval62.3%
Simplified62.3%
Final simplification62.3%
(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%
times-frac99.7%
*-commutative99.7%
fma-def99.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 x around inf 30.1%
Final simplification30.1%
(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 2023195
(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)))))