
(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 14 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 -8.5e+56) (not (<= y 2.4e+60))) (- 1.0 (* y (/ 0.3333333333333333 (sqrt x)))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -8.5e+56) || !(y <= 2.4e+60)) {
tmp = 1.0 - (y * (0.3333333333333333 / sqrt(x)));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-8.5d+56)) .or. (.not. (y <= 2.4d+60))) then
tmp = 1.0d0 - (y * (0.3333333333333333d0 / sqrt(x)))
else
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -8.5e+56) || !(y <= 2.4e+60)) {
tmp = 1.0 - (y * (0.3333333333333333 / Math.sqrt(x)));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -8.5e+56) or not (y <= 2.4e+60): tmp = 1.0 - (y * (0.3333333333333333 / math.sqrt(x))) else: tmp = 1.0 + (-1.0 / (x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -8.5e+56) || !(y <= 2.4e+60)) tmp = Float64(1.0 - Float64(y * Float64(0.3333333333333333 / sqrt(x)))); else tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -8.5e+56) || ~((y <= 2.4e+60))) tmp = 1.0 - (y * (0.3333333333333333 / sqrt(x))); else tmp = 1.0 + (-1.0 / (x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -8.5e+56], N[Not[LessEqual[y, 2.4e+60]], $MachinePrecision]], N[(1.0 - N[(y * N[(0.3333333333333333 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{+56} \lor \neg \left(y \leq 2.4 \cdot 10^{+60}\right):\\
\;\;\;\;1 - y \cdot \frac{0.3333333333333333}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -8.4999999999999998e56 or 2.4e60 < y Initial program 99.5%
Taylor expanded in x around inf 94.4%
metadata-eval94.4%
*-commutative94.4%
sqrt-div94.4%
metadata-eval94.4%
div-inv94.6%
times-frac94.6%
*-un-lft-identity94.6%
clear-num94.5%
*-un-lft-identity94.5%
times-frac94.6%
metadata-eval94.6%
Applied egg-rr94.6%
associate-/r*94.5%
metadata-eval94.5%
associate-/r/94.5%
*-commutative94.5%
Simplified94.5%
if -8.4999999999999998e56 < y < 2.4e60Initial 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%
fma-neg99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 97.8%
metadata-eval97.8%
distribute-neg-frac97.8%
add-sqr-sqrt97.7%
sqrt-unprod72.4%
frac-times72.5%
metadata-eval72.5%
metadata-eval72.5%
frac-times72.4%
sqrt-unprod0.0%
add-sqr-sqrt48.0%
Applied egg-rr48.0%
add-sqr-sqrt0.0%
sqrt-unprod72.4%
frac-times72.5%
metadata-eval72.5%
pow272.5%
Applied egg-rr72.5%
clear-num72.5%
sqrt-div73.0%
metadata-eval73.0%
div-inv73.1%
unpow273.1%
metadata-eval73.1%
metadata-eval73.1%
swap-sqr73.2%
sqrt-unprod97.7%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
Final simplification96.4%
(FPCore (x y) :precision binary64 (if (or (<= y -4.9e+54) (not (<= y 1.4e+60))) (- 1.0 (/ 0.3333333333333333 (/ (sqrt x) y))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -4.9e+54) || !(y <= 1.4e+60)) {
tmp = 1.0 - (0.3333333333333333 / (sqrt(x) / y));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-4.9d+54)) .or. (.not. (y <= 1.4d+60))) then
tmp = 1.0d0 - (0.3333333333333333d0 / (sqrt(x) / y))
else
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -4.9e+54) || !(y <= 1.4e+60)) {
tmp = 1.0 - (0.3333333333333333 / (Math.sqrt(x) / y));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -4.9e+54) or not (y <= 1.4e+60): tmp = 1.0 - (0.3333333333333333 / (math.sqrt(x) / y)) else: tmp = 1.0 + (-1.0 / (x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -4.9e+54) || !(y <= 1.4e+60)) tmp = Float64(1.0 - Float64(0.3333333333333333 / Float64(sqrt(x) / y))); else tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -4.9e+54) || ~((y <= 1.4e+60))) tmp = 1.0 - (0.3333333333333333 / (sqrt(x) / y)); else tmp = 1.0 + (-1.0 / (x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -4.9e+54], N[Not[LessEqual[y, 1.4e+60]], $MachinePrecision]], N[(1.0 - N[(0.3333333333333333 / N[(N[Sqrt[x], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{+54} \lor \neg \left(y \leq 1.4 \cdot 10^{+60}\right):\\
\;\;\;\;1 - \frac{0.3333333333333333}{\frac{\sqrt{x}}{y}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -4.90000000000000001e54 or 1.4e60 < y Initial program 99.5%
Taylor expanded in x around inf 94.4%
*-commutative94.4%
sqrt-div94.4%
metadata-eval94.4%
div-inv94.6%
clear-num94.5%
add-sqr-sqrt48.1%
sqrt-unprod29.1%
sqr-neg29.1%
sqrt-unprod3.0%
add-sqr-sqrt6.5%
distribute-neg-frac26.5%
div-inv6.5%
distribute-neg-frac26.5%
add-sqr-sqrt3.0%
sqrt-unprod29.1%
sqr-neg29.1%
sqrt-unprod48.1%
add-sqr-sqrt94.5%
Applied egg-rr94.5%
if -4.90000000000000001e54 < y < 1.4e60Initial 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%
fma-neg99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 97.8%
metadata-eval97.8%
distribute-neg-frac97.8%
add-sqr-sqrt97.7%
sqrt-unprod72.4%
frac-times72.5%
metadata-eval72.5%
metadata-eval72.5%
frac-times72.4%
sqrt-unprod0.0%
add-sqr-sqrt48.0%
Applied egg-rr48.0%
add-sqr-sqrt0.0%
sqrt-unprod72.4%
frac-times72.5%
metadata-eval72.5%
pow272.5%
Applied egg-rr72.5%
clear-num72.5%
sqrt-div73.0%
metadata-eval73.0%
div-inv73.1%
unpow273.1%
metadata-eval73.1%
metadata-eval73.1%
swap-sqr73.2%
sqrt-unprod97.7%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
Final simplification96.5%
(FPCore (x y) :precision binary64 (if (or (<= y -1.08e+55) (not (<= y 1.18e+60))) (- 1.0 (/ y (sqrt (* x 9.0)))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -1.08e+55) || !(y <= 1.18e+60)) {
tmp = 1.0 - (y / sqrt((x * 9.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.08d+55)) .or. (.not. (y <= 1.18d+60))) then
tmp = 1.0d0 - (y / sqrt((x * 9.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.08e+55) || !(y <= 1.18e+60)) {
tmp = 1.0 - (y / Math.sqrt((x * 9.0)));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.08e+55) or not (y <= 1.18e+60): tmp = 1.0 - (y / math.sqrt((x * 9.0))) else: tmp = 1.0 + (-1.0 / (x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.08e+55) || !(y <= 1.18e+60)) tmp = Float64(1.0 - Float64(y / sqrt(Float64(x * 9.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.08e+55) || ~((y <= 1.18e+60))) tmp = 1.0 - (y / sqrt((x * 9.0))); else tmp = 1.0 + (-1.0 / (x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.08e+55], N[Not[LessEqual[y, 1.18e+60]], $MachinePrecision]], N[(1.0 - N[(y / N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.08 \cdot 10^{+55} \lor \neg \left(y \leq 1.18 \cdot 10^{+60}\right):\\
\;\;\;\;1 - \frac{y}{\sqrt{x \cdot 9}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -1.08000000000000004e55 or 1.18000000000000008e60 < y Initial program 99.5%
Taylor expanded in x around inf 94.4%
metadata-eval94.4%
*-commutative94.4%
sqrt-div94.4%
metadata-eval94.4%
div-inv94.6%
times-frac94.6%
*-un-lft-identity94.6%
Applied egg-rr94.6%
*-commutative94.6%
metadata-eval94.6%
sqrt-prod94.7%
pow1/294.7%
Applied egg-rr94.7%
unpow1/294.7%
Simplified94.7%
if -1.08000000000000004e55 < y < 1.18000000000000008e60Initial 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%
fma-neg99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 97.8%
metadata-eval97.8%
distribute-neg-frac97.8%
add-sqr-sqrt97.7%
sqrt-unprod72.4%
frac-times72.5%
metadata-eval72.5%
metadata-eval72.5%
frac-times72.4%
sqrt-unprod0.0%
add-sqr-sqrt48.0%
Applied egg-rr48.0%
add-sqr-sqrt0.0%
sqrt-unprod72.4%
frac-times72.5%
metadata-eval72.5%
pow272.5%
Applied egg-rr72.5%
clear-num72.5%
sqrt-div73.0%
metadata-eval73.0%
div-inv73.1%
unpow273.1%
metadata-eval73.1%
metadata-eval73.1%
swap-sqr73.2%
sqrt-unprod97.7%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
Final simplification96.6%
(FPCore (x y) :precision binary64 (if (or (<= y -1.15e+67) (not (<= y 9.2e+79))) (* y (/ -0.3333333333333333 (sqrt x))) (+ 1.0 (/ -1.0 (* x 9.0)))))
double code(double x, double y) {
double tmp;
if ((y <= -1.15e+67) || !(y <= 9.2e+79)) {
tmp = y * (-0.3333333333333333 / sqrt(x));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-1.15d+67)) .or. (.not. (y <= 9.2d+79))) then
tmp = y * ((-0.3333333333333333d0) / sqrt(x))
else
tmp = 1.0d0 + ((-1.0d0) / (x * 9.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.15e+67) || !(y <= 9.2e+79)) {
tmp = y * (-0.3333333333333333 / Math.sqrt(x));
} else {
tmp = 1.0 + (-1.0 / (x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.15e+67) or not (y <= 9.2e+79): tmp = y * (-0.3333333333333333 / math.sqrt(x)) else: tmp = 1.0 + (-1.0 / (x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.15e+67) || !(y <= 9.2e+79)) tmp = Float64(y * Float64(-0.3333333333333333 / sqrt(x))); else tmp = Float64(1.0 + Float64(-1.0 / Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.15e+67) || ~((y <= 9.2e+79))) tmp = y * (-0.3333333333333333 / sqrt(x)); else tmp = 1.0 + (-1.0 / (x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.15e+67], N[Not[LessEqual[y, 9.2e+79]], $MachinePrecision]], N[(y * N[(-0.3333333333333333 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+67} \lor \neg \left(y \leq 9.2 \cdot 10^{+79}\right):\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\end{array}
\end{array}
if y < -1.1499999999999999e67 or 9.2000000000000002e79 < y Initial program 99.5%
Taylor expanded in x around 0 99.5%
Taylor expanded in y around inf 93.0%
*-commutative93.0%
*-commutative93.0%
associate-*r*93.1%
Simplified93.1%
*-commutative93.1%
sqrt-div93.0%
metadata-eval93.0%
un-div-inv93.1%
Applied egg-rr93.1%
if -1.1499999999999999e67 < y < 9.2000000000000002e79Initial 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%
fma-neg99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 95.2%
metadata-eval95.2%
distribute-neg-frac95.2%
add-sqr-sqrt95.1%
sqrt-unprod70.1%
frac-times70.1%
metadata-eval70.1%
metadata-eval70.1%
frac-times70.1%
sqrt-unprod0.0%
add-sqr-sqrt47.4%
Applied egg-rr47.4%
add-sqr-sqrt0.0%
sqrt-unprod70.1%
frac-times70.1%
metadata-eval70.1%
pow270.1%
Applied egg-rr70.1%
clear-num70.1%
sqrt-div70.6%
metadata-eval70.6%
div-inv70.7%
unpow270.7%
metadata-eval70.7%
metadata-eval70.7%
swap-sqr70.7%
sqrt-unprod95.2%
add-sqr-sqrt95.4%
Applied egg-rr95.4%
Final simplification94.5%
(FPCore (x y)
:precision binary64
(if (<= y -3e+68)
(* -0.3333333333333333 (* y (pow x -0.5)))
(if (<= y 2.6e+79)
(+ 1.0 (/ -1.0 (* x 9.0)))
(* y (/ -0.3333333333333333 (sqrt x))))))
double code(double x, double y) {
double tmp;
if (y <= -3e+68) {
tmp = -0.3333333333333333 * (y * pow(x, -0.5));
} else if (y <= 2.6e+79) {
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 <= (-3d+68)) then
tmp = (-0.3333333333333333d0) * (y * (x ** (-0.5d0)))
else if (y <= 2.6d+79) 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 <= -3e+68) {
tmp = -0.3333333333333333 * (y * Math.pow(x, -0.5));
} else if (y <= 2.6e+79) {
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 <= -3e+68: tmp = -0.3333333333333333 * (y * math.pow(x, -0.5)) elif y <= 2.6e+79: 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 <= -3e+68) tmp = Float64(-0.3333333333333333 * Float64(y * (x ^ -0.5))); elseif (y <= 2.6e+79) tmp = Float64(1.0 + Float64(-1.0 / Float64(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 <= -3e+68) tmp = -0.3333333333333333 * (y * (x ^ -0.5)); elseif (y <= 2.6e+79) 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, -3e+68], N[(-0.3333333333333333 * N[(y * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+79], N[(1.0 + N[(-1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(-0.3333333333333333 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+68}:\\
\;\;\;\;-0.3333333333333333 \cdot \left(y \cdot {x}^{-0.5}\right)\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+79}:\\
\;\;\;\;1 + \frac{-1}{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{\sqrt{x}}\\
\end{array}
\end{array}
if y < -3.0000000000000002e68Initial program 99.4%
Taylor expanded in x around 0 99.5%
Taylor expanded in y around inf 91.9%
*-commutative91.9%
*-commutative91.9%
associate-*r*91.9%
Simplified91.9%
*-un-lft-identity91.9%
inv-pow91.9%
sqrt-pow191.9%
metadata-eval91.9%
Applied egg-rr91.9%
*-lft-identity91.9%
Simplified91.9%
add-sqr-sqrt91.5%
sqrt-unprod59.3%
associate-*r*59.2%
associate-*r*59.3%
swap-sqr59.3%
*-commutative59.3%
*-commutative59.3%
metadata-eval59.3%
metadata-eval59.3%
swap-sqr59.3%
associate-*r*59.2%
associate-*r*59.2%
sqrt-unprod0.0%
add-log-exp0.0%
add-sqr-sqrt0.5%
*-un-lft-identity0.5%
Applied egg-rr91.9%
+-lft-identity91.9%
associate-*r*91.9%
*-commutative91.9%
Simplified91.9%
if -3.0000000000000002e68 < y < 2.60000000000000015e79Initial 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%
fma-neg99.8%
associate-/r*99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.6%
distribute-neg-frac99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 95.2%
metadata-eval95.2%
distribute-neg-frac95.2%
add-sqr-sqrt95.1%
sqrt-unprod70.1%
frac-times70.1%
metadata-eval70.1%
metadata-eval70.1%
frac-times70.1%
sqrt-unprod0.0%
add-sqr-sqrt47.4%
Applied egg-rr47.4%
add-sqr-sqrt0.0%
sqrt-unprod70.1%
frac-times70.1%
metadata-eval70.1%
pow270.1%
Applied egg-rr70.1%
clear-num70.1%
sqrt-div70.6%
metadata-eval70.6%
div-inv70.7%
unpow270.7%
metadata-eval70.7%
metadata-eval70.7%
swap-sqr70.7%
sqrt-unprod95.2%
add-sqr-sqrt95.4%
Applied egg-rr95.4%
if 2.60000000000000015e79 < y Initial program 99.6%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 94.2%
*-commutative94.2%
*-commutative94.2%
associate-*r*94.3%
Simplified94.3%
*-commutative94.3%
sqrt-div94.2%
metadata-eval94.2%
un-div-inv94.3%
Applied egg-rr94.3%
Final simplification94.5%
(FPCore (x y) :precision binary64 (if (<= x 0.11) (/ (- (* -0.3333333333333333 (* y (sqrt x))) 0.1111111111111111) x) (- 1.0 (/ y (sqrt (* x 9.0))))))
double code(double x, double y) {
double tmp;
if (x <= 0.11) {
tmp = ((-0.3333333333333333 * (y * sqrt(x))) - 0.1111111111111111) / x;
} else {
tmp = 1.0 - (y / sqrt((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 (x <= 0.11d0) then
tmp = (((-0.3333333333333333d0) * (y * sqrt(x))) - 0.1111111111111111d0) / x
else
tmp = 1.0d0 - (y / sqrt((x * 9.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.11) {
tmp = ((-0.3333333333333333 * (y * Math.sqrt(x))) - 0.1111111111111111) / x;
} else {
tmp = 1.0 - (y / Math.sqrt((x * 9.0)));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.11: tmp = ((-0.3333333333333333 * (y * math.sqrt(x))) - 0.1111111111111111) / x else: tmp = 1.0 - (y / math.sqrt((x * 9.0))) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.11) tmp = Float64(Float64(Float64(-0.3333333333333333 * Float64(y * sqrt(x))) - 0.1111111111111111) / x); else tmp = Float64(1.0 - Float64(y / sqrt(Float64(x * 9.0)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.11) tmp = ((-0.3333333333333333 * (y * sqrt(x))) - 0.1111111111111111) / x; else tmp = 1.0 - (y / sqrt((x * 9.0))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.11], N[(N[(N[(-0.3333333333333333 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.1111111111111111), $MachinePrecision] / x), $MachinePrecision], N[(1.0 - N[(y / N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.11:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot \left(y \cdot \sqrt{x}\right) - 0.1111111111111111}{x}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{y}{\sqrt{x \cdot 9}}\\
\end{array}
\end{array}
if x < 0.110000000000000001Initial program 99.6%
sub-neg99.6%
*-commutative99.6%
associate-/r*99.4%
metadata-eval99.4%
distribute-frac-neg99.4%
neg-mul-199.4%
times-frac99.4%
metadata-eval99.4%
Simplified99.4%
clear-num99.3%
un-div-inv99.4%
Applied egg-rr99.4%
Taylor expanded in x around 0 98.3%
if 0.110000000000000001 < x Initial program 99.8%
Taylor expanded in x around inf 98.9%
metadata-eval98.9%
*-commutative98.9%
sqrt-div98.9%
metadata-eval98.9%
div-inv99.0%
times-frac99.0%
*-un-lft-identity99.0%
Applied egg-rr99.0%
*-commutative99.0%
metadata-eval99.0%
sqrt-prod99.1%
pow1/299.1%
Applied egg-rr99.1%
unpow1/299.1%
Simplified99.1%
Final simplification98.7%
(FPCore (x y) :precision binary64 (- (+ 1.0 (* 0.1111111111111111 (/ -1.0 x))) (/ y (* 3.0 (sqrt x)))))
double code(double x, double y) {
return (1.0 + (0.1111111111111111 * (-1.0 / 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 * ((-1.0d0) / x))) - (y / (3.0d0 * sqrt(x)))
end function
public static double code(double x, double y) {
return (1.0 + (0.1111111111111111 * (-1.0 / x))) - (y / (3.0 * Math.sqrt(x)));
}
def code(x, y): return (1.0 + (0.1111111111111111 * (-1.0 / x))) - (y / (3.0 * math.sqrt(x)))
function code(x, y) return Float64(Float64(1.0 + Float64(0.1111111111111111 * Float64(-1.0 / x))) - Float64(y / Float64(3.0 * sqrt(x)))) end
function tmp = code(x, y) tmp = (1.0 + (0.1111111111111111 * (-1.0 / x))) - (y / (3.0 * sqrt(x))); end
code[x_, y_] := N[(N[(1.0 + N[(0.1111111111111111 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 + 0.1111111111111111 \cdot \frac{-1}{x}\right) - \frac{y}{3 \cdot \sqrt{x}}
\end{array}
Initial program 99.7%
Taylor expanded in x around 0 99.6%
div-inv99.6%
Applied egg-rr99.6%
Final simplification99.6%
(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.6%
metadata-eval99.6%
distribute-frac-neg99.6%
neg-mul-199.6%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.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%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
distribute-frac-neg99.6%
neg-mul-199.6%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 60.4%
Final simplification60.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(-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.6%
fma-neg99.6%
associate-/r*99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.5%
distribute-neg-frac99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 60.3%
metadata-eval60.3%
distribute-neg-frac60.3%
add-sqr-sqrt60.2%
sqrt-unprod46.4%
frac-times46.5%
metadata-eval46.5%
metadata-eval46.5%
frac-times46.4%
sqrt-unprod0.0%
add-sqr-sqrt30.6%
Applied egg-rr30.6%
add-sqr-sqrt0.0%
sqrt-unprod46.4%
frac-times46.5%
metadata-eval46.5%
pow246.5%
Applied egg-rr46.5%
clear-num46.5%
sqrt-div46.8%
metadata-eval46.8%
div-inv46.8%
unpow246.8%
metadata-eval46.8%
metadata-eval46.8%
swap-sqr46.8%
sqrt-unprod60.3%
add-sqr-sqrt60.4%
Applied egg-rr60.4%
Final simplification60.4%
(FPCore (x y) :precision binary64 (* (/ 1.0 x) -0.1111111111111111))
double code(double x, double y) {
return (1.0 / x) * -0.1111111111111111;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 / x) * (-0.1111111111111111d0)
end function
public static double code(double x, double y) {
return (1.0 / x) * -0.1111111111111111;
}
def code(x, y): return (1.0 / x) * -0.1111111111111111
function code(x, y) return Float64(Float64(1.0 / x) * -0.1111111111111111) end
function tmp = code(x, y) tmp = (1.0 / x) * -0.1111111111111111; end
code[x_, y_] := N[(N[(1.0 / x), $MachinePrecision] * -0.1111111111111111), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x} \cdot -0.1111111111111111
\end{array}
Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
distribute-frac-neg99.6%
neg-mul-199.6%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
clear-num99.5%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in x around 0 64.1%
Taylor expanded in y around 0 31.1%
clear-num31.2%
associate-/r/31.2%
Applied egg-rr31.2%
Final simplification31.2%
(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.6%
fma-neg99.6%
associate-/r*99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.5%
distribute-neg-frac99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 60.3%
Final simplification60.3%
(FPCore (x y) :precision binary64 (/ -0.1111111111111111 x))
double code(double x, double y) {
return -0.1111111111111111 / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (-0.1111111111111111d0) / x
end function
public static double code(double x, double y) {
return -0.1111111111111111 / x;
}
def code(x, y): return -0.1111111111111111 / x
function code(x, y) return Float64(-0.1111111111111111 / x) end
function tmp = code(x, y) tmp = -0.1111111111111111 / x; end
code[x_, y_] := N[(-0.1111111111111111 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{-0.1111111111111111}{x}
\end{array}
Initial program 99.7%
sub-neg99.7%
*-commutative99.7%
associate-/r*99.6%
metadata-eval99.6%
distribute-frac-neg99.6%
neg-mul-199.6%
times-frac99.6%
metadata-eval99.6%
Simplified99.6%
clear-num99.5%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in x around 0 64.1%
Taylor expanded in y around 0 31.1%
Final simplification31.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 2024075
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, D"
:precision binary64
:alt
(- (- 1.0 (/ (/ 1.0 x) 9.0)) (/ y (* 3.0 (sqrt x))))
(- (- 1.0 (/ 1.0 (* x 9.0))) (/ y (* 3.0 (sqrt x)))))