
(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 (or (<= y -4.5e+56) (not (<= y 3e+63))) (- 1.0 (* 0.3333333333333333 (* y (sqrt (/ 1.0 x))))) (- 1.0 (pow (* x 9.0) -1.0))))
double code(double x, double y) {
double tmp;
if ((y <= -4.5e+56) || !(y <= 3e+63)) {
tmp = 1.0 - (0.3333333333333333 * (y * sqrt((1.0 / x))));
} 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.5d+56)) .or. (.not. (y <= 3d+63))) then
tmp = 1.0d0 - (0.3333333333333333d0 * (y * sqrt((1.0d0 / x))))
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.5e+56) || !(y <= 3e+63)) {
tmp = 1.0 - (0.3333333333333333 * (y * Math.sqrt((1.0 / x))));
} else {
tmp = 1.0 - Math.pow((x * 9.0), -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -4.5e+56) or not (y <= 3e+63): tmp = 1.0 - (0.3333333333333333 * (y * math.sqrt((1.0 / x)))) else: tmp = 1.0 - math.pow((x * 9.0), -1.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= -4.5e+56) || !(y <= 3e+63)) tmp = Float64(1.0 - Float64(0.3333333333333333 * Float64(y * sqrt(Float64(1.0 / x))))); 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.5e+56) || ~((y <= 3e+63))) tmp = 1.0 - (0.3333333333333333 * (y * sqrt((1.0 / x)))); else tmp = 1.0 - ((x * 9.0) ^ -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -4.5e+56], N[Not[LessEqual[y, 3e+63]], $MachinePrecision]], N[(1.0 - N[(0.3333333333333333 * N[(y * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $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.5 \cdot 10^{+56} \lor \neg \left(y \leq 3 \cdot 10^{+63}\right):\\
\;\;\;\;1 - 0.3333333333333333 \cdot \left(y \cdot \sqrt{\frac{1}{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - {\left(x \cdot 9\right)}^{-1}\\
\end{array}
\end{array}
if y < -4.5000000000000003e56 or 2.99999999999999999e63 < y Initial program 99.6%
Taylor expanded in x around inf 92.5%
if -4.5000000000000003e56 < y < 2.99999999999999999e63Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
fmm-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 97.3%
associate-*r/97.4%
metadata-eval97.4%
Simplified97.4%
metadata-eval97.4%
associate-/r*97.4%
*-commutative97.4%
inv-pow97.4%
Applied egg-rr97.4%
Final simplification95.5%
(FPCore (x y) :precision binary64 (if (or (<= y -1.45e+58) (not (<= y 6.2e+62))) (+ 1.0 (* -0.3333333333333333 (/ y (sqrt x)))) (- 1.0 (pow (* x 9.0) -1.0))))
double code(double x, double y) {
double tmp;
if ((y <= -1.45e+58) || !(y <= 6.2e+62)) {
tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x)));
} 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 <= (-1.45d+58)) .or. (.not. (y <= 6.2d+62))) then
tmp = 1.0d0 + ((-0.3333333333333333d0) * (y / sqrt(x)))
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 <= -1.45e+58) || !(y <= 6.2e+62)) {
tmp = 1.0 + (-0.3333333333333333 * (y / Math.sqrt(x)));
} else {
tmp = 1.0 - Math.pow((x * 9.0), -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.45e+58) or not (y <= 6.2e+62): tmp = 1.0 + (-0.3333333333333333 * (y / math.sqrt(x))) else: tmp = 1.0 - math.pow((x * 9.0), -1.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.45e+58) || !(y <= 6.2e+62)) tmp = Float64(1.0 + Float64(-0.3333333333333333 * Float64(y / sqrt(x)))); 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 <= -1.45e+58) || ~((y <= 6.2e+62))) tmp = 1.0 + (-0.3333333333333333 * (y / sqrt(x))); else tmp = 1.0 - ((x * 9.0) ^ -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.45e+58], N[Not[LessEqual[y, 6.2e+62]], $MachinePrecision]], N[(1.0 + N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $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 -1.45 \cdot 10^{+58} \lor \neg \left(y \leq 6.2 \cdot 10^{+62}\right):\\
\;\;\;\;1 + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 - {\left(x \cdot 9\right)}^{-1}\\
\end{array}
\end{array}
if y < -1.45000000000000001e58 or 6.20000000000000029e62 < y Initial program 99.6%
sub-neg99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
distribute-frac-neg99.6%
neg-mul-199.6%
times-frac99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 92.5%
if -1.45000000000000001e58 < y < 6.20000000000000029e62Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
fmm-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 97.3%
associate-*r/97.4%
metadata-eval97.4%
Simplified97.4%
metadata-eval97.4%
associate-/r*97.4%
*-commutative97.4%
inv-pow97.4%
Applied egg-rr97.4%
Final simplification95.4%
(FPCore (x y) :precision binary64 (if (or (<= y -3.1e+59) (not (<= y 4.9e+67))) (/ y (* (sqrt x) -3.0)) (- 1.0 (pow (* x 9.0) -1.0))))
double code(double x, double y) {
double tmp;
if ((y <= -3.1e+59) || !(y <= 4.9e+67)) {
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.1d+59)) .or. (.not. (y <= 4.9d+67))) 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.1e+59) || !(y <= 4.9e+67)) {
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.1e+59) or not (y <= 4.9e+67): 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.1e+59) || !(y <= 4.9e+67)) tmp = Float64(y / Float64(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.1e+59) || ~((y <= 4.9e+67))) 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.1e+59], N[Not[LessEqual[y, 4.9e+67]], $MachinePrecision]], N[(y / N[(N[Sqrt[x], $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 -3.1 \cdot 10^{+59} \lor \neg \left(y \leq 4.9 \cdot 10^{+67}\right):\\
\;\;\;\;\frac{y}{\sqrt{x} \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;1 - {\left(x \cdot 9\right)}^{-1}\\
\end{array}
\end{array}
if y < -3.10000000000000015e59 or 4.8999999999999999e67 < y Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-frac-neg99.6%
sub-neg99.6%
neg-mul-199.6%
*-commutative99.6%
associate-/l*99.6%
fmm-def99.6%
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 inf 87.1%
*-commutative87.1%
associate-*l*87.0%
*-commutative87.0%
Simplified87.0%
*-commutative87.0%
associate-*r*87.1%
metadata-eval87.1%
distribute-rgt-neg-in87.1%
associate-*l*87.0%
sqrt-div87.0%
metadata-eval87.0%
metadata-eval87.0%
div-inv87.0%
times-frac87.2%
*-un-lft-identity87.2%
*-commutative87.2%
distribute-neg-frac287.2%
*-commutative87.2%
distribute-rgt-neg-in87.2%
metadata-eval87.2%
Applied egg-rr87.2%
if -3.10000000000000015e59 < y < 4.8999999999999999e67Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
fmm-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 97.3%
associate-*r/97.4%
metadata-eval97.4%
Simplified97.4%
metadata-eval97.4%
associate-/r*97.4%
*-commutative97.4%
inv-pow97.4%
Applied egg-rr97.4%
Final simplification93.3%
(FPCore (x y) :precision binary64 (if (or (<= y -1.45e+61) (not (<= y 3.6e+80))) (/ y (* (sqrt x) -3.0)) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -1.45e+61) || !(y <= 3.6e+80)) {
tmp = y / (sqrt(x) * -3.0);
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-1.45d+61)) .or. (.not. (y <= 3.6d+80))) then
tmp = y / (sqrt(x) * (-3.0d0))
else
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.45e+61) || !(y <= 3.6e+80)) {
tmp = y / (Math.sqrt(x) * -3.0);
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.45e+61) or not (y <= 3.6e+80): tmp = y / (math.sqrt(x) * -3.0) else: tmp = 1.0 + (-1.0 / (x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.45e+61) || !(y <= 3.6e+80)) tmp = Float64(y / Float64(sqrt(x) * -3.0)); else tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.45e+61) || ~((y <= 3.6e+80))) tmp = y / (sqrt(x) * -3.0); else tmp = 1.0 + (-1.0 / (x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.45e+61], N[Not[LessEqual[y, 3.6e+80]], $MachinePrecision]], N[(y / N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+61} \lor \neg \left(y \leq 3.6 \cdot 10^{+80}\right):\\
\;\;\;\;\frac{y}{\sqrt{x} \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -1.45e61 or 3.59999999999999995e80 < y Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-frac-neg99.6%
sub-neg99.6%
neg-mul-199.6%
*-commutative99.6%
associate-/l*99.6%
fmm-def99.6%
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 inf 87.1%
*-commutative87.1%
associate-*l*87.0%
*-commutative87.0%
Simplified87.0%
*-commutative87.0%
associate-*r*87.1%
metadata-eval87.1%
distribute-rgt-neg-in87.1%
associate-*l*87.0%
sqrt-div87.0%
metadata-eval87.0%
metadata-eval87.0%
div-inv87.0%
times-frac87.2%
*-un-lft-identity87.2%
*-commutative87.2%
distribute-neg-frac287.2%
*-commutative87.2%
distribute-rgt-neg-in87.2%
metadata-eval87.2%
Applied egg-rr87.2%
if -1.45e61 < y < 3.59999999999999995e80Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
fmm-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 97.3%
associate-*r/97.4%
metadata-eval97.4%
Simplified97.4%
expm1-log1p-u93.1%
expm1-undefine93.0%
log1p-undefine93.0%
add-exp-log97.3%
add-sqr-sqrt97.1%
sqrt-unprod75.0%
frac-times75.1%
metadata-eval75.1%
metadata-eval75.1%
frac-times75.0%
sqrt-unprod0.0%
add-sqr-sqrt43.3%
Applied egg-rr43.3%
+-commutative43.3%
associate--l+43.3%
metadata-eval43.3%
Simplified43.3%
add-sqr-sqrt0.0%
sqrt-unprod75.1%
+-rgt-identity75.1%
clear-num75.1%
un-div-inv75.1%
+-rgt-identity75.1%
clear-num75.0%
div-inv75.1%
metadata-eval75.1%
metadata-eval75.1%
distribute-rgt-neg-in75.1%
add-sqr-sqrt75.0%
pow275.0%
sqrt-prod75.0%
metadata-eval75.0%
distribute-neg-frac275.0%
neg-mul-175.0%
div-inv75.0%
metadata-eval75.0%
metadata-eval75.0%
distribute-rgt-neg-in75.0%
add-sqr-sqrt75.0%
pow275.0%
sqrt-prod74.9%
metadata-eval74.9%
Applied egg-rr97.4%
Final simplification93.3%
(FPCore (x y) :precision binary64 (if (or (<= y -1.85e+61) (not (<= y 1.75e+77))) (* -0.3333333333333333 (/ y (sqrt x))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -1.85e+61) || !(y <= 1.75e+77)) {
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.85d+61)) .or. (.not. (y <= 1.75d+77))) 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.85e+61) || !(y <= 1.75e+77)) {
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.85e+61) or not (y <= 1.75e+77): 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.85e+61) || !(y <= 1.75e+77)) tmp = Float64(-0.3333333333333333 * Float64(y / sqrt(x))); else tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.85e+61) || ~((y <= 1.75e+77))) 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.85e+61], N[Not[LessEqual[y, 1.75e+77]], $MachinePrecision]], N[(-0.3333333333333333 * N[(y / 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 -1.85 \cdot 10^{+61} \lor \neg \left(y \leq 1.75 \cdot 10^{+77}\right):\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -1.85000000000000001e61 or 1.7500000000000001e77 < y Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-frac-neg99.6%
sub-neg99.6%
neg-mul-199.6%
*-commutative99.6%
associate-/l*99.6%
fmm-def99.6%
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 inf 87.1%
*-commutative87.1%
associate-*l*87.0%
*-commutative87.0%
Simplified87.0%
*-commutative87.0%
associate-*r*87.1%
metadata-eval87.1%
distribute-rgt-neg-in87.1%
associate-*l*87.0%
sqrt-div87.0%
metadata-eval87.0%
metadata-eval87.0%
div-inv87.0%
times-frac87.2%
*-un-lft-identity87.2%
*-commutative87.2%
neg-mul-187.2%
clear-num87.1%
*-commutative87.1%
associate-*r/87.1%
div-inv87.1%
associate-/r*87.1%
clear-num87.0%
Applied egg-rr87.0%
associate-/r/87.0%
associate-*l/87.1%
*-lft-identity87.1%
associate-/l/87.1%
associate-/r*87.1%
associate-/r/87.1%
metadata-eval87.1%
Simplified87.1%
associate-/l*87.1%
*-commutative87.1%
Applied egg-rr87.1%
if -1.85000000000000001e61 < y < 1.7500000000000001e77Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
fmm-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 97.3%
associate-*r/97.4%
metadata-eval97.4%
Simplified97.4%
expm1-log1p-u93.1%
expm1-undefine93.0%
log1p-undefine93.0%
add-exp-log97.3%
add-sqr-sqrt97.1%
sqrt-unprod75.0%
frac-times75.1%
metadata-eval75.1%
metadata-eval75.1%
frac-times75.0%
sqrt-unprod0.0%
add-sqr-sqrt43.3%
Applied egg-rr43.3%
+-commutative43.3%
associate--l+43.3%
metadata-eval43.3%
Simplified43.3%
add-sqr-sqrt0.0%
sqrt-unprod75.1%
+-rgt-identity75.1%
clear-num75.1%
un-div-inv75.1%
+-rgt-identity75.1%
clear-num75.0%
div-inv75.1%
metadata-eval75.1%
metadata-eval75.1%
distribute-rgt-neg-in75.1%
add-sqr-sqrt75.0%
pow275.0%
sqrt-prod75.0%
metadata-eval75.0%
distribute-neg-frac275.0%
neg-mul-175.0%
div-inv75.0%
metadata-eval75.0%
metadata-eval75.0%
distribute-rgt-neg-in75.0%
add-sqr-sqrt75.0%
pow275.0%
sqrt-prod74.9%
metadata-eval74.9%
Applied egg-rr97.4%
Final simplification93.3%
(FPCore (x y)
:precision binary64
(if (<= y -1.85e+61)
(* -0.3333333333333333 (/ y (sqrt x)))
(if (<= y 1.36e+70)
(+ 1.0 (/ -1.0 (* x 9.0)))
(/ -0.3333333333333333 (/ (sqrt x) y)))))
double code(double x, double y) {
double tmp;
if (y <= -1.85e+61) {
tmp = -0.3333333333333333 * (y / sqrt(x));
} else if (y <= 1.36e+70) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = -0.3333333333333333 / (sqrt(x) / y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.85d+61)) then
tmp = (-0.3333333333333333d0) * (y / sqrt(x))
else if (y <= 1.36d+70) then
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
else
tmp = (-0.3333333333333333d0) / (sqrt(x) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.85e+61) {
tmp = -0.3333333333333333 * (y / Math.sqrt(x));
} else if (y <= 1.36e+70) {
tmp = 1.0 + (-1.0 / (x * 9.0));
} else {
tmp = -0.3333333333333333 / (Math.sqrt(x) / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.85e+61: tmp = -0.3333333333333333 * (y / math.sqrt(x)) elif y <= 1.36e+70: tmp = 1.0 + (-1.0 / (x * 9.0)) else: tmp = -0.3333333333333333 / (math.sqrt(x) / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.85e+61) tmp = Float64(-0.3333333333333333 * Float64(y / sqrt(x))); elseif (y <= 1.36e+70) tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); else tmp = Float64(-0.3333333333333333 / Float64(sqrt(x) / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.85e+61) tmp = -0.3333333333333333 * (y / sqrt(x)); elseif (y <= 1.36e+70) tmp = 1.0 + (-1.0 / (x * 9.0)); else tmp = -0.3333333333333333 / (sqrt(x) / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.85e+61], N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.36e+70], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 / N[(N[Sqrt[x], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{+61}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{\sqrt{x}}\\
\mathbf{elif}\;y \leq 1.36 \cdot 10^{+70}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{\sqrt{x}}{y}}\\
\end{array}
\end{array}
if y < -1.85000000000000001e61Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-frac-neg99.6%
sub-neg99.6%
neg-mul-199.6%
*-commutative99.6%
associate-/l*99.5%
fmm-def99.4%
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 inf 84.6%
*-commutative84.6%
associate-*l*84.5%
*-commutative84.5%
Simplified84.5%
*-commutative84.5%
associate-*r*84.6%
metadata-eval84.6%
distribute-rgt-neg-in84.6%
associate-*l*84.5%
sqrt-div84.5%
metadata-eval84.5%
metadata-eval84.5%
div-inv84.5%
times-frac84.7%
*-un-lft-identity84.7%
*-commutative84.7%
neg-mul-184.7%
clear-num84.7%
*-commutative84.7%
associate-*r/84.6%
div-inv84.6%
associate-/r*84.7%
clear-num84.6%
Applied egg-rr84.6%
associate-/r/84.6%
associate-*l/84.7%
*-lft-identity84.7%
associate-/l/84.6%
associate-/r*84.6%
associate-/r/84.6%
metadata-eval84.6%
Simplified84.6%
associate-/l*84.6%
*-commutative84.6%
Applied egg-rr84.6%
if -1.85000000000000001e61 < y < 1.35999999999999995e70Initial program 99.8%
associate--l-99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
distribute-frac-neg99.8%
sub-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
fmm-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 97.3%
associate-*r/97.4%
metadata-eval97.4%
Simplified97.4%
expm1-log1p-u93.1%
expm1-undefine93.0%
log1p-undefine93.0%
add-exp-log97.3%
add-sqr-sqrt97.1%
sqrt-unprod75.0%
frac-times75.1%
metadata-eval75.1%
metadata-eval75.1%
frac-times75.0%
sqrt-unprod0.0%
add-sqr-sqrt43.3%
Applied egg-rr43.3%
+-commutative43.3%
associate--l+43.3%
metadata-eval43.3%
Simplified43.3%
add-sqr-sqrt0.0%
sqrt-unprod75.1%
+-rgt-identity75.1%
clear-num75.1%
un-div-inv75.1%
+-rgt-identity75.1%
clear-num75.0%
div-inv75.1%
metadata-eval75.1%
metadata-eval75.1%
distribute-rgt-neg-in75.1%
add-sqr-sqrt75.0%
pow275.0%
sqrt-prod75.0%
metadata-eval75.0%
distribute-neg-frac275.0%
neg-mul-175.0%
div-inv75.0%
metadata-eval75.0%
metadata-eval75.0%
distribute-rgt-neg-in75.0%
add-sqr-sqrt75.0%
pow275.0%
sqrt-prod74.9%
metadata-eval74.9%
Applied egg-rr97.4%
if 1.35999999999999995e70 < y Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-frac-neg99.6%
sub-neg99.6%
neg-mul-199.6%
*-commutative99.6%
associate-/l*99.7%
fmm-def99.7%
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 inf 89.7%
*-commutative89.7%
associate-*l*89.6%
*-commutative89.6%
Simplified89.6%
*-commutative89.6%
associate-*r*89.7%
metadata-eval89.7%
distribute-rgt-neg-in89.7%
associate-*l*89.6%
sqrt-div89.6%
metadata-eval89.6%
metadata-eval89.6%
div-inv89.6%
times-frac89.8%
*-un-lft-identity89.8%
*-commutative89.8%
neg-mul-189.8%
clear-num89.6%
*-commutative89.6%
associate-*r/89.6%
div-inv89.6%
associate-/r*89.6%
clear-num89.5%
Applied egg-rr89.5%
associate-/r/89.5%
associate-*l/89.6%
*-lft-identity89.6%
associate-/l/89.6%
associate-/r*89.7%
associate-/r/89.7%
metadata-eval89.7%
Simplified89.7%
clear-num89.6%
inv-pow89.6%
*-un-lft-identity89.6%
times-frac89.6%
metadata-eval89.6%
Applied egg-rr89.6%
unpow-189.6%
associate-/r*89.7%
metadata-eval89.7%
Simplified89.7%
Final simplification93.3%
(FPCore (x y) :precision binary64 (if (<= x 0.11) (- (/ -0.1111111111111111 x) (/ y (* 3.0 (sqrt x)))) (- 1.0 (* 0.3333333333333333 (* y (sqrt (/ 1.0 x)))))))
double code(double x, double y) {
double tmp;
if (x <= 0.11) {
tmp = (-0.1111111111111111 / x) - (y / (3.0 * sqrt(x)));
} else {
tmp = 1.0 - (0.3333333333333333 * (y * sqrt((1.0 / x))));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 0.11d0) then
tmp = ((-0.1111111111111111d0) / x) - (y / (3.0d0 * sqrt(x)))
else
tmp = 1.0d0 - (0.3333333333333333d0 * (y * sqrt((1.0d0 / x))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.11) {
tmp = (-0.1111111111111111 / x) - (y / (3.0 * Math.sqrt(x)));
} else {
tmp = 1.0 - (0.3333333333333333 * (y * Math.sqrt((1.0 / x))));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.11: tmp = (-0.1111111111111111 / x) - (y / (3.0 * math.sqrt(x))) else: tmp = 1.0 - (0.3333333333333333 * (y * math.sqrt((1.0 / x)))) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.11) tmp = Float64(Float64(-0.1111111111111111 / x) - Float64(y / Float64(3.0 * sqrt(x)))); else tmp = Float64(1.0 - Float64(0.3333333333333333 * Float64(y * sqrt(Float64(1.0 / x))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.11) tmp = (-0.1111111111111111 / x) - (y / (3.0 * sqrt(x))); else tmp = 1.0 - (0.3333333333333333 * (y * sqrt((1.0 / x)))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.11], N[(N[(-0.1111111111111111 / x), $MachinePrecision] - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(0.3333333333333333 * N[(y * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.11:\\
\;\;\;\;\frac{-0.1111111111111111}{x} - \frac{y}{3 \cdot \sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 - 0.3333333333333333 \cdot \left(y \cdot \sqrt{\frac{1}{x}}\right)\\
\end{array}
\end{array}
if x < 0.110000000000000001Initial program 99.6%
add-sqr-sqrt99.2%
pow299.2%
sqrt-prod99.1%
metadata-eval99.1%
Applied egg-rr99.1%
Taylor expanded in x around 0 98.0%
if 0.110000000000000001 < x Initial program 99.8%
Taylor expanded in x around inf 96.8%
Final simplification97.4%
(FPCore (x y) :precision binary64 (- (- 1.0 (/ 0.1111111111111111 x)) (/ y (* 3.0 (sqrt x)))))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y / (3.0 * sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (0.1111111111111111d0 / x)) - (y / (3.0d0 * sqrt(x)))
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) - (y / (3.0 * Math.sqrt(x)));
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) - (y / (3.0 * math.sqrt(x)))
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) - Float64(y / Float64(3.0 * sqrt(x)))) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) - (y / (3.0 * sqrt(x))); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) - \frac{y}{3 \cdot \sqrt{x}}
\end{array}
Initial program 99.7%
Taylor expanded in x around 0 99.7%
(FPCore (x y) :precision binary64 (+ (- 1.0 (/ 0.1111111111111111 x)) (* -0.3333333333333333 (/ y (sqrt x)))))
double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 * (y / sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - (0.1111111111111111d0 / x)) + ((-0.3333333333333333d0) * (y / sqrt(x)))
end function
public static double code(double x, double y) {
return (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 * (y / Math.sqrt(x)));
}
def code(x, y): return (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 * (y / math.sqrt(x)))
function code(x, y) return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) + Float64(-0.3333333333333333 * Float64(y / sqrt(x)))) end
function tmp = code(x, y) tmp = (1.0 - (0.1111111111111111 / x)) + (-0.3333333333333333 * (y / sqrt(x))); end
code[x_, y_] := N[(N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] + N[(-0.3333333333333333 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - \frac{0.1111111111111111}{x}\right) + -0.3333333333333333 \cdot \frac{y}{\sqrt{x}}
\end{array}
Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
(FPCore (x y)
:precision binary64
(if (<= y -3.9e+113)
(/
(- 1.0 (* (/ 0.1111111111111111 x) (/ 0.1111111111111111 x)))
(- 1.0 (/ 0.1111111111111111 x)))
(+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if (y <= -3.9e+113) {
tmp = (1.0 - ((0.1111111111111111 / x) * (0.1111111111111111 / x))) / (1.0 - (0.1111111111111111 / 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 <= (-3.9d+113)) then
tmp = (1.0d0 - ((0.1111111111111111d0 / x) * (0.1111111111111111d0 / x))) / (1.0d0 - (0.1111111111111111d0 / 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 <= -3.9e+113) {
tmp = (1.0 - ((0.1111111111111111 / x) * (0.1111111111111111 / x))) / (1.0 - (0.1111111111111111 / x));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.9e+113: tmp = (1.0 - ((0.1111111111111111 / x) * (0.1111111111111111 / x))) / (1.0 - (0.1111111111111111 / x)) else: tmp = 1.0 + (-1.0 / (x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= -3.9e+113) tmp = Float64(Float64(1.0 - Float64(Float64(0.1111111111111111 / x) * Float64(0.1111111111111111 / x))) / Float64(1.0 - Float64(0.1111111111111111 / 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 <= -3.9e+113) tmp = (1.0 - ((0.1111111111111111 / x) * (0.1111111111111111 / x))) / (1.0 - (0.1111111111111111 / x)); else tmp = 1.0 + (-1.0 / (x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.9e+113], N[(N[(1.0 - N[(N[(0.1111111111111111 / x), $MachinePrecision] * N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(0.1111111111111111 / 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 -3.9 \cdot 10^{+113}:\\
\;\;\;\;\frac{1 - \frac{0.1111111111111111}{x} \cdot \frac{0.1111111111111111}{x}}{1 - \frac{0.1111111111111111}{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -3.9000000000000002e113Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-frac-neg99.7%
sub-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.5%
fmm-def99.4%
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 3.2%
associate-*r/3.2%
metadata-eval3.2%
Simplified3.2%
expm1-log1p-u3.2%
expm1-undefine3.2%
log1p-undefine3.2%
add-exp-log3.2%
add-sqr-sqrt3.2%
sqrt-unprod3.2%
frac-times3.2%
metadata-eval3.2%
metadata-eval3.2%
frac-times3.2%
sqrt-unprod0.0%
add-sqr-sqrt6.5%
Applied egg-rr6.5%
+-commutative6.5%
associate--l+6.5%
metadata-eval6.5%
Simplified6.5%
+-rgt-identity6.5%
clear-num6.5%
div-inv6.5%
metadata-eval6.5%
metadata-eval6.5%
distribute-rgt-neg-in6.5%
add-sqr-sqrt6.5%
pow26.5%
sqrt-prod6.5%
metadata-eval6.5%
distribute-neg-frac26.5%
distribute-neg-frac6.5%
metadata-eval6.5%
unpow26.5%
swap-sqr6.5%
add-sqr-sqrt6.5%
metadata-eval6.5%
Applied egg-rr6.5%
sub-neg6.5%
flip-+24.1%
metadata-eval24.1%
distribute-neg-frac24.1%
metadata-eval24.1%
*-commutative24.1%
associate-/r*24.1%
metadata-eval24.1%
distribute-neg-frac24.1%
metadata-eval24.1%
*-commutative24.1%
associate-/r*24.1%
metadata-eval24.1%
distribute-neg-frac24.1%
metadata-eval24.1%
*-commutative24.1%
associate-/r*24.1%
metadata-eval24.1%
Applied egg-rr24.1%
if -3.9000000000000002e113 < y Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-frac-neg99.7%
sub-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
fmm-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 72.1%
associate-*r/72.1%
metadata-eval72.1%
Simplified72.1%
expm1-log1p-u69.0%
expm1-undefine69.0%
log1p-undefine69.0%
add-exp-log72.1%
add-sqr-sqrt71.9%
sqrt-unprod57.7%
frac-times57.7%
metadata-eval57.7%
metadata-eval57.7%
frac-times57.7%
sqrt-unprod0.0%
add-sqr-sqrt32.6%
Applied egg-rr32.6%
+-commutative32.6%
associate--l+32.6%
metadata-eval32.6%
Simplified32.6%
add-sqr-sqrt0.0%
sqrt-unprod57.7%
+-rgt-identity57.7%
clear-num57.7%
un-div-inv57.7%
+-rgt-identity57.7%
clear-num57.7%
div-inv57.7%
metadata-eval57.7%
metadata-eval57.7%
distribute-rgt-neg-in57.7%
add-sqr-sqrt57.7%
pow257.7%
sqrt-prod57.7%
metadata-eval57.7%
distribute-neg-frac257.7%
neg-mul-157.7%
div-inv57.6%
metadata-eval57.6%
metadata-eval57.6%
distribute-rgt-neg-in57.6%
add-sqr-sqrt57.6%
pow257.6%
sqrt-prod57.6%
metadata-eval57.6%
Applied egg-rr72.2%
Final simplification65.4%
(FPCore (x y) :precision binary64 (if (<= x 0.00095) (/ -0.1111111111111111 x) 1.0))
double code(double x, double y) {
double tmp;
if (x <= 0.00095) {
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.00095d0) 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.00095) {
tmp = -0.1111111111111111 / x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.00095: tmp = -0.1111111111111111 / x else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 0.00095) 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.00095) tmp = -0.1111111111111111 / x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.00095], N[(-0.1111111111111111 / x), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.00095:\\
\;\;\;\;\frac{-0.1111111111111111}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < 9.49999999999999998e-4Initial program 99.6%
associate--l-99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
distribute-frac-neg99.6%
sub-neg99.6%
neg-mul-199.6%
*-commutative99.6%
associate-/l*99.6%
fmm-def99.6%
associate-/r*99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 98.3%
Taylor expanded in y around 0 63.5%
if 9.49999999999999998e-4 < x Initial program 99.8%
Taylor expanded in x around inf 96.4%
Taylor expanded in y around 0 57.3%
(FPCore (x y) :precision binary64 (+ 1.0 (/ -1.0 (* x 9.0))))
double code(double x, double y) {
return 1.0 + (-1.0 / (x * 9.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
end function
public static double code(double x, double y) {
return 1.0 + (-1.0 / (x * 9.0));
}
def code(x, y): return 1.0 + (-1.0 / (x * 9.0))
function code(x, y) return Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))) end
function tmp = code(x, y) tmp = 1.0 + (-1.0 / (x * 9.0)); end
code[x_, y_] := N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{-1}{x \cdot 9}
\end{array}
Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-frac-neg99.7%
sub-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
fmm-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 62.4%
associate-*r/62.5%
metadata-eval62.5%
Simplified62.5%
expm1-log1p-u59.8%
expm1-undefine59.7%
log1p-undefine59.7%
add-exp-log62.4%
add-sqr-sqrt62.3%
sqrt-unprod50.0%
frac-times50.0%
metadata-eval50.0%
metadata-eval50.0%
frac-times50.0%
sqrt-unprod0.0%
add-sqr-sqrt28.9%
Applied egg-rr28.9%
+-commutative28.9%
associate--l+28.9%
metadata-eval28.9%
Simplified28.9%
add-sqr-sqrt0.0%
sqrt-unprod50.0%
+-rgt-identity50.0%
clear-num50.0%
un-div-inv50.0%
+-rgt-identity50.0%
clear-num50.0%
div-inv50.0%
metadata-eval50.0%
metadata-eval50.0%
distribute-rgt-neg-in50.0%
add-sqr-sqrt50.0%
pow250.0%
sqrt-prod50.0%
metadata-eval50.0%
distribute-neg-frac250.0%
neg-mul-150.0%
div-inv50.0%
metadata-eval50.0%
metadata-eval50.0%
distribute-rgt-neg-in50.0%
add-sqr-sqrt50.0%
pow250.0%
sqrt-prod49.9%
metadata-eval49.9%
Applied egg-rr62.5%
Final simplification62.5%
(FPCore (x y) :precision binary64 (- 1.0 (/ 0.1111111111111111 x)))
double code(double x, double y) {
return 1.0 - (0.1111111111111111 / x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 - (0.1111111111111111d0 / x)
end function
public static double code(double x, double y) {
return 1.0 - (0.1111111111111111 / x);
}
def code(x, y): return 1.0 - (0.1111111111111111 / x)
function code(x, y) return Float64(1.0 - Float64(0.1111111111111111 / x)) end
function tmp = code(x, y) tmp = 1.0 - (0.1111111111111111 / x); end
code[x_, y_] := N[(1.0 - N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{0.1111111111111111}{x}
\end{array}
Initial program 99.7%
associate--l-99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
distribute-frac-neg99.7%
sub-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
fmm-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 62.4%
associate-*r/62.5%
metadata-eval62.5%
Simplified62.5%
(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%
Taylor expanded in x around inf 64.1%
Taylor expanded in y around 0 28.8%
(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 2024181
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, D"
:precision binary64
:alt
(! :herbie-platform default (- (- 1 (/ (/ 1 x) 9)) (/ y (* 3 (sqrt x)))))
(- (- 1.0 (/ 1.0 (* x 9.0))) (/ y (* 3.0 (sqrt x)))))