
(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 11 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 (+ (- 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.05e+95) (not (<= y 7e+55))) (* -0.3333333333333333 (/ y (sqrt x))) (- 1.0 (/ (/ 1.0 x) 9.0))))
double code(double x, double y) {
double tmp;
if ((y <= -1.05e+95) || !(y <= 7e+55)) {
tmp = -0.3333333333333333 * (y / sqrt(x));
} else {
tmp = 1.0 - ((1.0 / x) / 9.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-1.05d+95)) .or. (.not. (y <= 7d+55))) then
tmp = (-0.3333333333333333d0) * (y / sqrt(x))
else
tmp = 1.0d0 - ((1.0d0 / x) / 9.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.05e+95) || !(y <= 7e+55)) {
tmp = -0.3333333333333333 * (y / Math.sqrt(x));
} else {
tmp = 1.0 - ((1.0 / x) / 9.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.05e+95) or not (y <= 7e+55): tmp = -0.3333333333333333 * (y / math.sqrt(x)) else: tmp = 1.0 - ((1.0 / x) / 9.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.05e+95) || !(y <= 7e+55)) tmp = Float64(-0.3333333333333333 * Float64(y / sqrt(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.05e+95) || ~((y <= 7e+55))) tmp = -0.3333333333333333 * (y / sqrt(x)); else tmp = 1.0 - ((1.0 / x) / 9.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.05e+95], N[Not[LessEqual[y, 7e+55]], $MachinePrecision]], N[(-0.3333333333333333 * N[(y / N[Sqrt[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.05 \cdot 10^{+95} \lor \neg \left(y \leq 7 \cdot 10^{+55}\right):\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{\frac{1}{x}}{9}\\
\end{array}
\end{array}
if y < -1.05e95 or 7.00000000000000021e55 < 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 y around inf 95.7%
*-commutative95.7%
associate-*l*95.6%
Simplified95.6%
expm1-log1p-u46.3%
expm1-udef46.3%
associate-*r*46.3%
*-commutative46.3%
sqrt-div46.3%
metadata-eval46.3%
associate-*l/46.3%
*-un-lft-identity46.3%
Applied egg-rr46.3%
expm1-def46.3%
expm1-log1p95.7%
Simplified95.7%
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%
Final simplification95.3%
(FPCore (x y)
:precision binary64
(if (<= y -7.6e+94)
(* -0.3333333333333333 (/ y (sqrt x)))
(if (<= y 1.1e+54)
(- 1.0 (/ (/ 1.0 x) 9.0))
(* y (/ -0.3333333333333333 (sqrt x))))))
double code(double x, double y) {
double tmp;
if (y <= -7.6e+94) {
tmp = -0.3333333333333333 * (y / sqrt(x));
} else if (y <= 1.1e+54) {
tmp = 1.0 - ((1.0 / x) / 9.0);
} else {
tmp = y * (-0.3333333333333333 / 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 = (-0.3333333333333333d0) * (y / sqrt(x))
else if (y <= 1.1d+54) then
tmp = 1.0d0 - ((1.0d0 / x) / 9.0d0)
else
tmp = y * ((-0.3333333333333333d0) / sqrt(x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -7.6e+94) {
tmp = -0.3333333333333333 * (y / Math.sqrt(x));
} else if (y <= 1.1e+54) {
tmp = 1.0 - ((1.0 / x) / 9.0);
} else {
tmp = y * (-0.3333333333333333 / Math.sqrt(x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -7.6e+94: tmp = -0.3333333333333333 * (y / math.sqrt(x)) elif y <= 1.1e+54: tmp = 1.0 - ((1.0 / x) / 9.0) else: tmp = y * (-0.3333333333333333 / math.sqrt(x)) return tmp
function code(x, y) tmp = 0.0 if (y <= -7.6e+94) tmp = Float64(-0.3333333333333333 * Float64(y / sqrt(x))); elseif (y <= 1.1e+54) tmp = Float64(1.0 - Float64(Float64(1.0 / x) / 9.0)); else tmp = Float64(y * Float64(-0.3333333333333333 / sqrt(x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -7.6e+94) tmp = -0.3333333333333333 * (y / sqrt(x)); elseif (y <= 1.1e+54) tmp = 1.0 - ((1.0 / x) / 9.0); else tmp = y * (-0.3333333333333333 / sqrt(x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -7.6e+94], N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e+54], N[(1.0 - N[(N[(1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(-0.3333333333333333 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+94}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+54}:\\
\;\;\;\;1 - \frac{\frac{1}{x}}{9}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{\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%
*-commutative96.5%
associate-*l*96.3%
Simplified96.3%
expm1-log1p-u90.6%
expm1-udef90.6%
associate-*r*90.6%
*-commutative90.6%
sqrt-div90.6%
metadata-eval90.6%
associate-*l/90.6%
*-un-lft-identity90.6%
Applied egg-rr90.6%
expm1-def90.6%
expm1-log1p96.5%
Simplified96.5%
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 y around inf 94.9%
*-commutative94.9%
associate-*l*94.8%
Simplified94.8%
expm1-log1p-u0.0%
expm1-udef0.0%
associate-*r*0.0%
*-commutative0.0%
sqrt-div0.0%
metadata-eval0.0%
associate-*l/0.0%
*-un-lft-identity0.0%
Applied egg-rr0.0%
expm1-def0.0%
expm1-log1p94.9%
associate-*r/95.0%
associate-*l/95.0%
metadata-eval95.0%
distribute-neg-frac95.0%
*-commutative95.0%
distribute-neg-frac95.0%
metadata-eval95.0%
Simplified95.0%
Final simplification95.3%
(FPCore (x y)
:precision binary64
(if (<= y -1.35e+95)
(* -0.3333333333333333 (/ y (sqrt x)))
(if (<= y 1.25e+54)
(- 1.0 (/ (/ 1.0 x) 9.0))
(/ y (/ (sqrt x) -0.3333333333333333)))))
double code(double x, double y) {
double tmp;
if (y <= -1.35e+95) {
tmp = -0.3333333333333333 * (y / sqrt(x));
} else if (y <= 1.25e+54) {
tmp = 1.0 - ((1.0 / x) / 9.0);
} else {
tmp = y / (sqrt(x) / -0.3333333333333333);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.35d+95)) then
tmp = (-0.3333333333333333d0) * (y / sqrt(x))
else if (y <= 1.25d+54) then
tmp = 1.0d0 - ((1.0d0 / x) / 9.0d0)
else
tmp = y / (sqrt(x) / (-0.3333333333333333d0))
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(x));
} else if (y <= 1.25e+54) {
tmp = 1.0 - ((1.0 / x) / 9.0);
} else {
tmp = y / (Math.sqrt(x) / -0.3333333333333333);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.35e+95: tmp = -0.3333333333333333 * (y / math.sqrt(x)) elif y <= 1.25e+54: tmp = 1.0 - ((1.0 / x) / 9.0) else: tmp = y / (math.sqrt(x) / -0.3333333333333333) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.35e+95) tmp = Float64(-0.3333333333333333 * Float64(y / sqrt(x))); elseif (y <= 1.25e+54) tmp = Float64(1.0 - Float64(Float64(1.0 / x) / 9.0)); else tmp = Float64(y / Float64(sqrt(x) / -0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.35e+95) tmp = -0.3333333333333333 * (y / sqrt(x)); elseif (y <= 1.25e+54) tmp = 1.0 - ((1.0 / x) / 9.0); else tmp = y / (sqrt(x) / -0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.35e+95], N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e+54], N[(1.0 - N[(N[(1.0 / x), $MachinePrecision] / 9.0), $MachinePrecision]), $MachinePrecision], N[(y / N[(N[Sqrt[x], $MachinePrecision] / -0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+95}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+54}:\\
\;\;\;\;1 - \frac{\frac{1}{x}}{9}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{\sqrt{x}}{-0.3333333333333333}}\\
\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%
associate-*l*96.3%
Simplified96.3%
expm1-log1p-u90.6%
expm1-udef90.6%
associate-*r*90.6%
*-commutative90.6%
sqrt-div90.6%
metadata-eval90.6%
associate-*l/90.6%
*-un-lft-identity90.6%
Applied egg-rr90.6%
expm1-def90.6%
expm1-log1p96.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 y around inf 94.9%
*-commutative94.9%
associate-*l*94.8%
Simplified94.8%
expm1-log1p-u0.0%
expm1-udef0.0%
associate-*r*0.0%
*-commutative0.0%
sqrt-div0.0%
metadata-eval0.0%
associate-*l/0.0%
*-un-lft-identity0.0%
Applied egg-rr0.0%
expm1-def0.0%
expm1-log1p94.9%
*-commutative94.9%
associate-/r/95.1%
Simplified95.1%
Final simplification95.4%
(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)))))