
(FPCore (x y) :precision binary64 (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))
double code(double x, double y) {
return (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (3.0d0 * sqrt(x)) * ((y + (1.0d0 / (x * 9.0d0))) - 1.0d0)
end function
public static double code(double x, double y) {
return (3.0 * Math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
def code(x, y): return (3.0 * math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0)
function code(x, y) return Float64(Float64(3.0 * sqrt(x)) * Float64(Float64(y + Float64(1.0 / Float64(x * 9.0))) - 1.0)) end
function tmp = code(x, y) tmp = (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0); end
code[x_, y_] := N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(N[(y + N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))
double code(double x, double y) {
return (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (3.0d0 * sqrt(x)) * ((y + (1.0d0 / (x * 9.0d0))) - 1.0d0)
end function
public static double code(double x, double y) {
return (3.0 * Math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
def code(x, y): return (3.0 * math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0)
function code(x, y) return Float64(Float64(3.0 * sqrt(x)) * Float64(Float64(y + Float64(1.0 / Float64(x * 9.0))) - 1.0)) end
function tmp = code(x, y) tmp = (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0); end
code[x_, y_] := N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(N[(y + N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\end{array}
(FPCore (x y) :precision binary64 (* (sqrt (/ x 0.1111111111111111)) (+ (/ 0.1111111111111111 x) (+ y -1.0))))
double code(double x, double y) {
return sqrt((x / 0.1111111111111111)) * ((0.1111111111111111 / x) + (y + -1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt((x / 0.1111111111111111d0)) * ((0.1111111111111111d0 / x) + (y + (-1.0d0)))
end function
public static double code(double x, double y) {
return Math.sqrt((x / 0.1111111111111111)) * ((0.1111111111111111 / x) + (y + -1.0));
}
def code(x, y): return math.sqrt((x / 0.1111111111111111)) * ((0.1111111111111111 / x) + (y + -1.0))
function code(x, y) return Float64(sqrt(Float64(x / 0.1111111111111111)) * Float64(Float64(0.1111111111111111 / x) + Float64(y + -1.0))) end
function tmp = code(x, y) tmp = sqrt((x / 0.1111111111111111)) * ((0.1111111111111111 / x) + (y + -1.0)); end
code[x_, y_] := N[(N[Sqrt[N[(x / 0.1111111111111111), $MachinePrecision]], $MachinePrecision] * N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{x}{0.1111111111111111}} \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)
\end{array}
Initial program 99.5%
sub-neg99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
metadata-eval99.6%
div-inv99.6%
Applied egg-rr99.6%
(FPCore (x y)
:precision binary64
(if (<= x 6.1e-6)
(sqrt (/ 1.0 (* x 9.0)))
(if (or (<= x 2.9e+23) (not (<= x 1.6e+256)))
(* 3.0 (* y (sqrt x)))
(* (sqrt x) -3.0))))
double code(double x, double y) {
double tmp;
if (x <= 6.1e-6) {
tmp = sqrt((1.0 / (x * 9.0)));
} else if ((x <= 2.9e+23) || !(x <= 1.6e+256)) {
tmp = 3.0 * (y * sqrt(x));
} else {
tmp = sqrt(x) * -3.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 6.1d-6) then
tmp = sqrt((1.0d0 / (x * 9.0d0)))
else if ((x <= 2.9d+23) .or. (.not. (x <= 1.6d+256))) then
tmp = 3.0d0 * (y * sqrt(x))
else
tmp = sqrt(x) * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 6.1e-6) {
tmp = Math.sqrt((1.0 / (x * 9.0)));
} else if ((x <= 2.9e+23) || !(x <= 1.6e+256)) {
tmp = 3.0 * (y * Math.sqrt(x));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 6.1e-6: tmp = math.sqrt((1.0 / (x * 9.0))) elif (x <= 2.9e+23) or not (x <= 1.6e+256): tmp = 3.0 * (y * math.sqrt(x)) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 6.1e-6) tmp = sqrt(Float64(1.0 / Float64(x * 9.0))); elseif ((x <= 2.9e+23) || !(x <= 1.6e+256)) tmp = Float64(3.0 * Float64(y * sqrt(x))); else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 6.1e-6) tmp = sqrt((1.0 / (x * 9.0))); elseif ((x <= 2.9e+23) || ~((x <= 1.6e+256))) tmp = 3.0 * (y * sqrt(x)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 6.1e-6], N[Sqrt[N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 2.9e+23], N[Not[LessEqual[x, 1.6e+256]], $MachinePrecision]], N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.1 \cdot 10^{-6}:\\
\;\;\;\;\sqrt{\frac{1}{x \cdot 9}}\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+23} \lor \neg \left(x \leq 1.6 \cdot 10^{+256}\right):\\
\;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 6.10000000000000004e-6Initial program 99.4%
*-commutative99.4%
associate-*l*99.3%
associate--l+99.3%
distribute-lft-in99.3%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 76.6%
metadata-eval76.6%
sqrt-prod76.8%
div-inv77.7%
pow1/277.7%
Applied egg-rr77.7%
unpow1/277.7%
Simplified77.7%
clear-num77.6%
frac-2neg77.6%
metadata-eval77.6%
distribute-frac-neg277.6%
div-inv77.8%
metadata-eval77.8%
Applied egg-rr77.8%
distribute-neg-frac77.8%
metadata-eval77.8%
Applied egg-rr77.8%
if 6.10000000000000004e-6 < x < 2.90000000000000013e23 or 1.59999999999999998e256 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.6%
associate--l+99.6%
distribute-lft-in99.5%
fma-define99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.4%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 61.5%
if 2.90000000000000013e23 < x < 1.59999999999999998e256Initial program 99.5%
*-commutative99.5%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 58.4%
sub-neg58.4%
metadata-eval58.4%
associate-*r/58.4%
metadata-eval58.4%
+-commutative58.4%
metadata-eval58.4%
distribute-neg-frac58.4%
unsub-neg58.4%
Simplified58.4%
Taylor expanded in x around inf 58.4%
*-commutative58.4%
Simplified58.4%
Final simplification67.7%
(FPCore (x y)
:precision binary64
(if (<= x 9.2e-7)
(sqrt (/ 1.0 (* x 9.0)))
(if (<= x 8.4e+23)
(* 3.0 (* y (sqrt x)))
(if (<= x 3.3e+255)
(* (sqrt x) -3.0)
(* (sqrt (/ x 0.1111111111111111)) y)))))
double code(double x, double y) {
double tmp;
if (x <= 9.2e-7) {
tmp = sqrt((1.0 / (x * 9.0)));
} else if (x <= 8.4e+23) {
tmp = 3.0 * (y * sqrt(x));
} else if (x <= 3.3e+255) {
tmp = sqrt(x) * -3.0;
} else {
tmp = sqrt((x / 0.1111111111111111)) * y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 9.2d-7) then
tmp = sqrt((1.0d0 / (x * 9.0d0)))
else if (x <= 8.4d+23) then
tmp = 3.0d0 * (y * sqrt(x))
else if (x <= 3.3d+255) then
tmp = sqrt(x) * (-3.0d0)
else
tmp = sqrt((x / 0.1111111111111111d0)) * y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 9.2e-7) {
tmp = Math.sqrt((1.0 / (x * 9.0)));
} else if (x <= 8.4e+23) {
tmp = 3.0 * (y * Math.sqrt(x));
} else if (x <= 3.3e+255) {
tmp = Math.sqrt(x) * -3.0;
} else {
tmp = Math.sqrt((x / 0.1111111111111111)) * y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 9.2e-7: tmp = math.sqrt((1.0 / (x * 9.0))) elif x <= 8.4e+23: tmp = 3.0 * (y * math.sqrt(x)) elif x <= 3.3e+255: tmp = math.sqrt(x) * -3.0 else: tmp = math.sqrt((x / 0.1111111111111111)) * y return tmp
function code(x, y) tmp = 0.0 if (x <= 9.2e-7) tmp = sqrt(Float64(1.0 / Float64(x * 9.0))); elseif (x <= 8.4e+23) tmp = Float64(3.0 * Float64(y * sqrt(x))); elseif (x <= 3.3e+255) tmp = Float64(sqrt(x) * -3.0); else tmp = Float64(sqrt(Float64(x / 0.1111111111111111)) * y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 9.2e-7) tmp = sqrt((1.0 / (x * 9.0))); elseif (x <= 8.4e+23) tmp = 3.0 * (y * sqrt(x)); elseif (x <= 3.3e+255) tmp = sqrt(x) * -3.0; else tmp = sqrt((x / 0.1111111111111111)) * y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 9.2e-7], N[Sqrt[N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 8.4e+23], N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e+255], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision], N[(N[Sqrt[N[(x / 0.1111111111111111), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.2 \cdot 10^{-7}:\\
\;\;\;\;\sqrt{\frac{1}{x \cdot 9}}\\
\mathbf{elif}\;x \leq 8.4 \cdot 10^{+23}:\\
\;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+255}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x}{0.1111111111111111}} \cdot y\\
\end{array}
\end{array}
if x < 9.1999999999999998e-7Initial program 99.4%
*-commutative99.4%
associate-*l*99.3%
associate--l+99.3%
distribute-lft-in99.3%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 76.6%
metadata-eval76.6%
sqrt-prod76.8%
div-inv77.7%
pow1/277.7%
Applied egg-rr77.7%
unpow1/277.7%
Simplified77.7%
clear-num77.6%
frac-2neg77.6%
metadata-eval77.6%
distribute-frac-neg277.6%
div-inv77.8%
metadata-eval77.8%
Applied egg-rr77.8%
distribute-neg-frac77.8%
metadata-eval77.8%
Applied egg-rr77.8%
if 9.1999999999999998e-7 < x < 8.4000000000000005e23Initial program 99.6%
*-commutative99.6%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.1%
metadata-eval99.1%
metadata-eval99.1%
*-commutative99.1%
associate-/r*99.0%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around inf 63.3%
if 8.4000000000000005e23 < x < 3.29999999999999982e255Initial program 99.5%
*-commutative99.5%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 58.4%
sub-neg58.4%
metadata-eval58.4%
associate-*r/58.4%
metadata-eval58.4%
+-commutative58.4%
metadata-eval58.4%
distribute-neg-frac58.4%
unsub-neg58.4%
Simplified58.4%
Taylor expanded in x around inf 58.4%
*-commutative58.4%
Simplified58.4%
if 3.29999999999999982e255 < x Initial program 99.5%
sub-neg99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
metadata-eval99.6%
div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 60.8%
Final simplification67.7%
(FPCore (x y)
:precision binary64
(if (<= y -1.85e+44)
(* y (sqrt (* x 9.0)))
(if (<= y 40.0)
(* (sqrt x) (- -3.0 (/ -0.3333333333333333 x)))
(* (sqrt (/ x 0.1111111111111111)) y))))
double code(double x, double y) {
double tmp;
if (y <= -1.85e+44) {
tmp = y * sqrt((x * 9.0));
} else if (y <= 40.0) {
tmp = sqrt(x) * (-3.0 - (-0.3333333333333333 / x));
} else {
tmp = sqrt((x / 0.1111111111111111)) * 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+44)) then
tmp = y * sqrt((x * 9.0d0))
else if (y <= 40.0d0) then
tmp = sqrt(x) * ((-3.0d0) - ((-0.3333333333333333d0) / x))
else
tmp = sqrt((x / 0.1111111111111111d0)) * y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.85e+44) {
tmp = y * Math.sqrt((x * 9.0));
} else if (y <= 40.0) {
tmp = Math.sqrt(x) * (-3.0 - (-0.3333333333333333 / x));
} else {
tmp = Math.sqrt((x / 0.1111111111111111)) * y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.85e+44: tmp = y * math.sqrt((x * 9.0)) elif y <= 40.0: tmp = math.sqrt(x) * (-3.0 - (-0.3333333333333333 / x)) else: tmp = math.sqrt((x / 0.1111111111111111)) * y return tmp
function code(x, y) tmp = 0.0 if (y <= -1.85e+44) tmp = Float64(y * sqrt(Float64(x * 9.0))); elseif (y <= 40.0) tmp = Float64(sqrt(x) * Float64(-3.0 - Float64(-0.3333333333333333 / x))); else tmp = Float64(sqrt(Float64(x / 0.1111111111111111)) * y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.85e+44) tmp = y * sqrt((x * 9.0)); elseif (y <= 40.0) tmp = sqrt(x) * (-3.0 - (-0.3333333333333333 / x)); else tmp = sqrt((x / 0.1111111111111111)) * y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.85e+44], N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 40.0], N[(N[Sqrt[x], $MachinePrecision] * N[(-3.0 - N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x / 0.1111111111111111), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{+44}:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\
\mathbf{elif}\;y \leq 40:\\
\;\;\;\;\sqrt{x} \cdot \left(-3 - \frac{-0.3333333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x}{0.1111111111111111}} \cdot y\\
\end{array}
\end{array}
if y < -1.85e44Initial program 99.6%
sub-neg99.6%
+-commutative99.6%
associate-+l+99.6%
*-commutative99.6%
associate-/r*99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.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 81.6%
if -1.85e44 < y < 40Initial program 99.5%
*-commutative99.5%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.3%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 94.0%
sub-neg94.0%
metadata-eval94.0%
associate-*r/94.7%
metadata-eval94.7%
+-commutative94.7%
metadata-eval94.7%
distribute-neg-frac94.7%
unsub-neg94.7%
Simplified94.7%
if 40 < y Initial program 99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
metadata-eval99.6%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 76.4%
Final simplification87.9%
(FPCore (x y) :precision binary64 (if (<= x 0.11) (/ (* (sqrt x) (+ (/ 0.1111111111111111 x) y)) 0.3333333333333333) (* (+ y -1.0) (sqrt (* x 9.0)))))
double code(double x, double y) {
double tmp;
if (x <= 0.11) {
tmp = (sqrt(x) * ((0.1111111111111111 / x) + y)) / 0.3333333333333333;
} else {
tmp = (y + -1.0) * 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 = (sqrt(x) * ((0.1111111111111111d0 / x) + y)) / 0.3333333333333333d0
else
tmp = (y + (-1.0d0)) * 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 = (Math.sqrt(x) * ((0.1111111111111111 / x) + y)) / 0.3333333333333333;
} else {
tmp = (y + -1.0) * Math.sqrt((x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.11: tmp = (math.sqrt(x) * ((0.1111111111111111 / x) + y)) / 0.3333333333333333 else: tmp = (y + -1.0) * math.sqrt((x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.11) tmp = Float64(Float64(sqrt(x) * Float64(Float64(0.1111111111111111 / x) + y)) / 0.3333333333333333); else tmp = Float64(Float64(y + -1.0) * sqrt(Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.11) tmp = (sqrt(x) * ((0.1111111111111111 / x) + y)) / 0.3333333333333333; else tmp = (y + -1.0) * sqrt((x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.11], N[(N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.1111111111111111 / x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] / 0.3333333333333333), $MachinePrecision], N[(N[(y + -1.0), $MachinePrecision] * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.11:\\
\;\;\;\;\frac{\sqrt{x} \cdot \left(\frac{0.1111111111111111}{x} + y\right)}{0.3333333333333333}\\
\mathbf{else}:\\
\;\;\;\;\left(y + -1\right) \cdot \sqrt{x \cdot 9}\\
\end{array}
\end{array}
if x < 0.110000000000000001Initial program 99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
*-commutative99.3%
metadata-eval99.3%
sqrt-prod99.4%
pow1/299.4%
Applied egg-rr99.4%
unpow1/299.4%
Simplified99.4%
metadata-eval99.4%
div-inv99.5%
Applied egg-rr99.5%
*-commutative99.5%
sqrt-div99.5%
metadata-eval99.5%
associate-*r/99.4%
Applied egg-rr99.4%
Taylor expanded in y around inf 96.7%
if 0.110000000000000001 < x Initial program 99.5%
sub-neg99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in x around inf 99.3%
Final simplification98.1%
(FPCore (x y) :precision binary64 (if (<= x 1.9e-5) (* (* (sqrt x) 3.0) (+ (/ 0.1111111111111111 x) -1.0)) (* (+ y -1.0) (sqrt (* x 9.0)))))
double code(double x, double y) {
double tmp;
if (x <= 1.9e-5) {
tmp = (sqrt(x) * 3.0) * ((0.1111111111111111 / x) + -1.0);
} else {
tmp = (y + -1.0) * 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 <= 1.9d-5) then
tmp = (sqrt(x) * 3.0d0) * ((0.1111111111111111d0 / x) + (-1.0d0))
else
tmp = (y + (-1.0d0)) * sqrt((x * 9.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.9e-5) {
tmp = (Math.sqrt(x) * 3.0) * ((0.1111111111111111 / x) + -1.0);
} else {
tmp = (y + -1.0) * Math.sqrt((x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.9e-5: tmp = (math.sqrt(x) * 3.0) * ((0.1111111111111111 / x) + -1.0) else: tmp = (y + -1.0) * math.sqrt((x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 1.9e-5) tmp = Float64(Float64(sqrt(x) * 3.0) * Float64(Float64(0.1111111111111111 / x) + -1.0)); else tmp = Float64(Float64(y + -1.0) * sqrt(Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.9e-5) tmp = (sqrt(x) * 3.0) * ((0.1111111111111111 / x) + -1.0); else tmp = (y + -1.0) * sqrt((x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.9e-5], N[(N[(N[Sqrt[x], $MachinePrecision] * 3.0), $MachinePrecision] * N[(N[(0.1111111111111111 / x), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y + -1.0), $MachinePrecision] * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9 \cdot 10^{-5}:\\
\;\;\;\;\left(\sqrt{x} \cdot 3\right) \cdot \left(\frac{0.1111111111111111}{x} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + -1\right) \cdot \sqrt{x \cdot 9}\\
\end{array}
\end{array}
if x < 1.9000000000000001e-5Initial program 99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 77.5%
sub-neg77.5%
associate-*r/78.4%
metadata-eval78.4%
metadata-eval78.4%
+-commutative78.4%
Simplified78.4%
if 1.9000000000000001e-5 < x Initial program 99.5%
sub-neg99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in x around inf 97.5%
Final simplification88.8%
(FPCore (x y) :precision binary64 (if (<= x 9.4e-6) (* (sqrt x) (- -3.0 (/ -0.3333333333333333 x))) (* (+ y -1.0) (sqrt (* x 9.0)))))
double code(double x, double y) {
double tmp;
if (x <= 9.4e-6) {
tmp = sqrt(x) * (-3.0 - (-0.3333333333333333 / x));
} else {
tmp = (y + -1.0) * 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 <= 9.4d-6) then
tmp = sqrt(x) * ((-3.0d0) - ((-0.3333333333333333d0) / x))
else
tmp = (y + (-1.0d0)) * sqrt((x * 9.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 9.4e-6) {
tmp = Math.sqrt(x) * (-3.0 - (-0.3333333333333333 / x));
} else {
tmp = (y + -1.0) * Math.sqrt((x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 9.4e-6: tmp = math.sqrt(x) * (-3.0 - (-0.3333333333333333 / x)) else: tmp = (y + -1.0) * math.sqrt((x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 9.4e-6) tmp = Float64(sqrt(x) * Float64(-3.0 - Float64(-0.3333333333333333 / x))); else tmp = Float64(Float64(y + -1.0) * sqrt(Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 9.4e-6) tmp = sqrt(x) * (-3.0 - (-0.3333333333333333 / x)); else tmp = (y + -1.0) * sqrt((x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 9.4e-6], N[(N[Sqrt[x], $MachinePrecision] * N[(-3.0 - N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + -1.0), $MachinePrecision] * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.4 \cdot 10^{-6}:\\
\;\;\;\;\sqrt{x} \cdot \left(-3 - \frac{-0.3333333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + -1\right) \cdot \sqrt{x \cdot 9}\\
\end{array}
\end{array}
if x < 9.39999999999999979e-6Initial program 99.4%
*-commutative99.4%
associate-*l*99.3%
associate--l+99.3%
distribute-lft-in99.3%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 77.5%
sub-neg77.5%
metadata-eval77.5%
associate-*r/78.4%
metadata-eval78.4%
+-commutative78.4%
metadata-eval78.4%
distribute-neg-frac78.4%
unsub-neg78.4%
Simplified78.4%
if 9.39999999999999979e-6 < x Initial program 99.5%
sub-neg99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in x around inf 97.5%
Final simplification88.8%
(FPCore (x y) :precision binary64 (if (<= x 1.7e-6) (* (sqrt x) (- -3.0 (/ -0.3333333333333333 x))) (* (sqrt x) (- (* y 3.0) 3.0))))
double code(double x, double y) {
double tmp;
if (x <= 1.7e-6) {
tmp = sqrt(x) * (-3.0 - (-0.3333333333333333 / x));
} else {
tmp = sqrt(x) * ((y * 3.0) - 3.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1.7d-6) then
tmp = sqrt(x) * ((-3.0d0) - ((-0.3333333333333333d0) / x))
else
tmp = sqrt(x) * ((y * 3.0d0) - 3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.7e-6) {
tmp = Math.sqrt(x) * (-3.0 - (-0.3333333333333333 / x));
} else {
tmp = Math.sqrt(x) * ((y * 3.0) - 3.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.7e-6: tmp = math.sqrt(x) * (-3.0 - (-0.3333333333333333 / x)) else: tmp = math.sqrt(x) * ((y * 3.0) - 3.0) return tmp
function code(x, y) tmp = 0.0 if (x <= 1.7e-6) tmp = Float64(sqrt(x) * Float64(-3.0 - Float64(-0.3333333333333333 / x))); else tmp = Float64(sqrt(x) * Float64(Float64(y * 3.0) - 3.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.7e-6) tmp = sqrt(x) * (-3.0 - (-0.3333333333333333 / x)); else tmp = sqrt(x) * ((y * 3.0) - 3.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.7e-6], N[(N[Sqrt[x], $MachinePrecision] * N[(-3.0 - N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(y * 3.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.7 \cdot 10^{-6}:\\
\;\;\;\;\sqrt{x} \cdot \left(-3 - \frac{-0.3333333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(y \cdot 3 - 3\right)\\
\end{array}
\end{array}
if x < 1.70000000000000003e-6Initial program 99.4%
*-commutative99.4%
associate-*l*99.3%
associate--l+99.3%
distribute-lft-in99.3%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 77.5%
sub-neg77.5%
metadata-eval77.5%
associate-*r/78.4%
metadata-eval78.4%
+-commutative78.4%
metadata-eval78.4%
distribute-neg-frac78.4%
unsub-neg78.4%
Simplified78.4%
if 1.70000000000000003e-6 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 97.3%
Final simplification88.7%
(FPCore (x y) :precision binary64 (* (+ (/ 0.1111111111111111 x) (+ y -1.0)) (sqrt (* x 9.0))))
double code(double x, double y) {
return ((0.1111111111111111 / x) + (y + -1.0)) * sqrt((x * 9.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((0.1111111111111111d0 / x) + (y + (-1.0d0))) * sqrt((x * 9.0d0))
end function
public static double code(double x, double y) {
return ((0.1111111111111111 / x) + (y + -1.0)) * Math.sqrt((x * 9.0));
}
def code(x, y): return ((0.1111111111111111 / x) + (y + -1.0)) * math.sqrt((x * 9.0))
function code(x, y) return Float64(Float64(Float64(0.1111111111111111 / x) + Float64(y + -1.0)) * sqrt(Float64(x * 9.0))) end
function tmp = code(x, y) tmp = ((0.1111111111111111 / x) + (y + -1.0)) * sqrt((x * 9.0)); end
code[x_, y_] := N[(N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y + -1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right) \cdot \sqrt{x \cdot 9}
\end{array}
Initial program 99.5%
sub-neg99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y) :precision binary64 (* (sqrt x) (+ (+ (* y 3.0) (/ 0.3333333333333333 x)) -3.0)))
double code(double x, double y) {
return sqrt(x) * (((y * 3.0) + (0.3333333333333333 / x)) + -3.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt(x) * (((y * 3.0d0) + (0.3333333333333333d0 / x)) + (-3.0d0))
end function
public static double code(double x, double y) {
return Math.sqrt(x) * (((y * 3.0) + (0.3333333333333333 / x)) + -3.0);
}
def code(x, y): return math.sqrt(x) * (((y * 3.0) + (0.3333333333333333 / x)) + -3.0)
function code(x, y) return Float64(sqrt(x) * Float64(Float64(Float64(y * 3.0) + Float64(0.3333333333333333 / x)) + -3.0)) end
function tmp = code(x, y) tmp = sqrt(x) * (((y * 3.0) + (0.3333333333333333 / x)) + -3.0); end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * N[(N[(N[(y * 3.0), $MachinePrecision] + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x} \cdot \left(\left(y \cdot 3 + \frac{0.3333333333333333}{x}\right) + -3\right)
\end{array}
Initial program 99.5%
*-commutative99.5%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
fma-undefine99.4%
+-commutative99.4%
associate-+r+99.4%
Applied egg-rr99.4%
Final simplification99.4%
(FPCore (x y) :precision binary64 (* (sqrt x) (* (+ (/ 0.1111111111111111 x) (+ y -1.0)) 3.0)))
double code(double x, double y) {
return sqrt(x) * (((0.1111111111111111 / x) + (y + -1.0)) * 3.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt(x) * (((0.1111111111111111d0 / x) + (y + (-1.0d0))) * 3.0d0)
end function
public static double code(double x, double y) {
return Math.sqrt(x) * (((0.1111111111111111 / x) + (y + -1.0)) * 3.0);
}
def code(x, y): return math.sqrt(x) * (((0.1111111111111111 / x) + (y + -1.0)) * 3.0)
function code(x, y) return Float64(sqrt(x) * Float64(Float64(Float64(0.1111111111111111 / x) + Float64(y + -1.0)) * 3.0)) end
function tmp = code(x, y) tmp = sqrt(x) * (((0.1111111111111111 / x) + (y + -1.0)) * 3.0); end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * N[(N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y + -1.0), $MachinePrecision]), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x} \cdot \left(\left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right) \cdot 3\right)
\end{array}
Initial program 99.5%
sub-neg99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
metadata-eval99.6%
div-inv99.6%
Applied egg-rr99.6%
*-commutative99.6%
sqrt-div99.5%
metadata-eval99.5%
associate-*r/99.4%
Applied egg-rr99.4%
div-inv99.4%
*-commutative99.4%
metadata-eval99.4%
associate-*l*99.4%
Applied egg-rr99.4%
(FPCore (x y) :precision binary64 (if (<= x 300000.0) (sqrt (/ 1.0 (* x 9.0))) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if (x <= 300000.0) {
tmp = sqrt((1.0 / (x * 9.0)));
} else {
tmp = sqrt(x) * -3.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 300000.0d0) then
tmp = sqrt((1.0d0 / (x * 9.0d0)))
else
tmp = sqrt(x) * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 300000.0) {
tmp = Math.sqrt((1.0 / (x * 9.0)));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 300000.0: tmp = math.sqrt((1.0 / (x * 9.0))) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 300000.0) tmp = sqrt(Float64(1.0 / Float64(x * 9.0))); else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 300000.0) tmp = sqrt((1.0 / (x * 9.0))); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 300000.0], N[Sqrt[N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 300000:\\
\;\;\;\;\sqrt{\frac{1}{x \cdot 9}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 3e5Initial program 99.4%
*-commutative99.4%
associate-*l*99.3%
associate--l+99.3%
distribute-lft-in99.3%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 72.3%
metadata-eval72.3%
sqrt-prod72.5%
div-inv73.3%
pow1/273.3%
Applied egg-rr73.3%
unpow1/273.3%
Simplified73.3%
clear-num73.3%
frac-2neg73.3%
metadata-eval73.3%
distribute-frac-neg273.3%
div-inv73.4%
metadata-eval73.4%
Applied egg-rr73.4%
distribute-neg-frac73.4%
metadata-eval73.4%
Applied egg-rr73.4%
if 3e5 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 53.9%
sub-neg53.9%
metadata-eval53.9%
associate-*r/53.9%
metadata-eval53.9%
+-commutative53.9%
metadata-eval53.9%
distribute-neg-frac53.9%
unsub-neg53.9%
Simplified53.9%
Taylor expanded in x around inf 53.9%
*-commutative53.9%
Simplified53.9%
(FPCore (x y) :precision binary64 (if (<= x 300000.0) (sqrt (/ 0.1111111111111111 x)) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if (x <= 300000.0) {
tmp = sqrt((0.1111111111111111 / x));
} else {
tmp = sqrt(x) * -3.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 300000.0d0) then
tmp = sqrt((0.1111111111111111d0 / x))
else
tmp = sqrt(x) * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 300000.0) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 300000.0: tmp = math.sqrt((0.1111111111111111 / x)) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 300000.0) tmp = sqrt(Float64(0.1111111111111111 / x)); else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 300000.0) tmp = sqrt((0.1111111111111111 / x)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 300000.0], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 300000:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 3e5Initial program 99.4%
*-commutative99.4%
associate-*l*99.3%
associate--l+99.3%
distribute-lft-in99.3%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 72.3%
metadata-eval72.3%
sqrt-prod72.5%
div-inv73.3%
pow1/273.3%
Applied egg-rr73.3%
unpow1/273.3%
Simplified73.3%
if 3e5 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 53.9%
sub-neg53.9%
metadata-eval53.9%
associate-*r/53.9%
metadata-eval53.9%
+-commutative53.9%
metadata-eval53.9%
distribute-neg-frac53.9%
unsub-neg53.9%
Simplified53.9%
Taylor expanded in x around inf 53.9%
*-commutative53.9%
Simplified53.9%
(FPCore (x y) :precision binary64 (sqrt (/ 0.1111111111111111 x)))
double code(double x, double y) {
return sqrt((0.1111111111111111 / x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt((0.1111111111111111d0 / x))
end function
public static double code(double x, double y) {
return Math.sqrt((0.1111111111111111 / x));
}
def code(x, y): return math.sqrt((0.1111111111111111 / x))
function code(x, y) return sqrt(Float64(0.1111111111111111 / x)) end
function tmp = code(x, y) tmp = sqrt((0.1111111111111111 / x)); end
code[x_, y_] := N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{0.1111111111111111}{x}}
\end{array}
Initial program 99.5%
*-commutative99.5%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 36.3%
metadata-eval36.3%
sqrt-prod36.4%
div-inv36.8%
pow1/236.8%
Applied egg-rr36.8%
unpow1/236.8%
Simplified36.8%
(FPCore (x y) :precision binary64 (sqrt (* x 9.0)))
double code(double x, double y) {
return sqrt((x * 9.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt((x * 9.0d0))
end function
public static double code(double x, double y) {
return Math.sqrt((x * 9.0));
}
def code(x, y): return math.sqrt((x * 9.0))
function code(x, y) return sqrt(Float64(x * 9.0)) end
function tmp = code(x, y) tmp = sqrt((x * 9.0)); end
code[x_, y_] := N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x \cdot 9}
\end{array}
Initial program 99.5%
*-commutative99.5%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 63.9%
sub-neg63.9%
metadata-eval63.9%
associate-*r/64.3%
metadata-eval64.3%
+-commutative64.3%
metadata-eval64.3%
distribute-neg-frac64.3%
unsub-neg64.3%
Simplified64.3%
Taylor expanded in x around inf 28.5%
*-commutative28.5%
Simplified28.5%
add-sqr-sqrt0.0%
sqrt-unprod3.6%
swap-sqr3.6%
add-sqr-sqrt3.6%
metadata-eval3.6%
Applied egg-rr3.6%
(FPCore (x y) :precision binary64 (* 3.0 (+ (* y (sqrt x)) (* (- (/ 1.0 (* x 9.0)) 1.0) (sqrt x)))))
double code(double x, double y) {
return 3.0 * ((y * sqrt(x)) + (((1.0 / (x * 9.0)) - 1.0) * sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 3.0d0 * ((y * sqrt(x)) + (((1.0d0 / (x * 9.0d0)) - 1.0d0) * sqrt(x)))
end function
public static double code(double x, double y) {
return 3.0 * ((y * Math.sqrt(x)) + (((1.0 / (x * 9.0)) - 1.0) * Math.sqrt(x)));
}
def code(x, y): return 3.0 * ((y * math.sqrt(x)) + (((1.0 / (x * 9.0)) - 1.0) * math.sqrt(x)))
function code(x, y) return Float64(3.0 * Float64(Float64(y * sqrt(x)) + Float64(Float64(Float64(1.0 / Float64(x * 9.0)) - 1.0) * sqrt(x)))) end
function tmp = code(x, y) tmp = 3.0 * ((y * sqrt(x)) + (((1.0 / (x * 9.0)) - 1.0) * sqrt(x))); end
code[x_, y_] := N[(3.0 * N[(N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
3 \cdot \left(y \cdot \sqrt{x} + \left(\frac{1}{x \cdot 9} - 1\right) \cdot \sqrt{x}\right)
\end{array}
herbie shell --seed 2024146
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:alt
(! :herbie-platform default (* 3 (+ (* y (sqrt x)) (* (- (/ 1 (* x 9)) 1) (sqrt x)))))
(* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))