
(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 13 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.4%
+-commutative99.4%
associate--l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.5%
pow1/299.5%
Applied egg-rr99.5%
unpow1/299.5%
Simplified99.5%
metadata-eval99.5%
div-inv99.6%
Applied egg-rr99.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sqrt (/ x 0.1111111111111111)) y)) (t_1 (pow (* x 9.0) -0.5)))
(if (<= y -8200000.0)
t_0
(if (<= y -5.5e-101)
t_1
(if (<= y 1.3e-123) (* (sqrt x) -3.0) (if (<= y 7.2e+28) t_1 t_0))))))
double code(double x, double y) {
double t_0 = sqrt((x / 0.1111111111111111)) * y;
double t_1 = pow((x * 9.0), -0.5);
double tmp;
if (y <= -8200000.0) {
tmp = t_0;
} else if (y <= -5.5e-101) {
tmp = t_1;
} else if (y <= 1.3e-123) {
tmp = sqrt(x) * -3.0;
} else if (y <= 7.2e+28) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((x / 0.1111111111111111d0)) * y
t_1 = (x * 9.0d0) ** (-0.5d0)
if (y <= (-8200000.0d0)) then
tmp = t_0
else if (y <= (-5.5d-101)) then
tmp = t_1
else if (y <= 1.3d-123) then
tmp = sqrt(x) * (-3.0d0)
else if (y <= 7.2d+28) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt((x / 0.1111111111111111)) * y;
double t_1 = Math.pow((x * 9.0), -0.5);
double tmp;
if (y <= -8200000.0) {
tmp = t_0;
} else if (y <= -5.5e-101) {
tmp = t_1;
} else if (y <= 1.3e-123) {
tmp = Math.sqrt(x) * -3.0;
} else if (y <= 7.2e+28) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = math.sqrt((x / 0.1111111111111111)) * y t_1 = math.pow((x * 9.0), -0.5) tmp = 0 if y <= -8200000.0: tmp = t_0 elif y <= -5.5e-101: tmp = t_1 elif y <= 1.3e-123: tmp = math.sqrt(x) * -3.0 elif y <= 7.2e+28: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(sqrt(Float64(x / 0.1111111111111111)) * y) t_1 = Float64(x * 9.0) ^ -0.5 tmp = 0.0 if (y <= -8200000.0) tmp = t_0; elseif (y <= -5.5e-101) tmp = t_1; elseif (y <= 1.3e-123) tmp = Float64(sqrt(x) * -3.0); elseif (y <= 7.2e+28) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt((x / 0.1111111111111111)) * y; t_1 = (x * 9.0) ^ -0.5; tmp = 0.0; if (y <= -8200000.0) tmp = t_0; elseif (y <= -5.5e-101) tmp = t_1; elseif (y <= 1.3e-123) tmp = sqrt(x) * -3.0; elseif (y <= 7.2e+28) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[N[(x / 0.1111111111111111), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[y, -8200000.0], t$95$0, If[LessEqual[y, -5.5e-101], t$95$1, If[LessEqual[y, 1.3e-123], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision], If[LessEqual[y, 7.2e+28], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{x}{0.1111111111111111}} \cdot y\\
t_1 := {\left(x \cdot 9\right)}^{-0.5}\\
\mathbf{if}\;y \leq -8200000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{-101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-123}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -8.2e6 or 7.1999999999999999e28 < y Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
sub-neg99.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%
Taylor expanded in y around inf 77.3%
if -8.2e6 < y < -5.49999999999999973e-101 or 1.29999999999999998e-123 < y < 7.1999999999999999e28Initial program 99.3%
*-commutative99.3%
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 61.1%
metadata-eval61.1%
sqrt-prod60.9%
div-inv61.0%
pow1/261.0%
Applied egg-rr61.0%
unpow1/261.0%
Simplified61.0%
clear-num61.1%
sqrt-div61.1%
metadata-eval61.1%
div-inv61.1%
metadata-eval61.1%
pow1/261.1%
pow-flip61.3%
metadata-eval61.3%
Applied egg-rr61.3%
if -5.49999999999999973e-101 < y < 1.29999999999999998e-123Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 62.8%
Taylor expanded in y around 0 62.8%
*-commutative62.8%
Simplified62.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (sqrt (* x 9.0)))) (t_1 (pow (* x 9.0) -0.5)))
(if (<= y -500000.0)
t_0
(if (<= y -6.5e-101)
t_1
(if (<= y 1.3e-123) (* (sqrt x) -3.0) (if (<= y 4.5e+27) t_1 t_0))))))
double code(double x, double y) {
double t_0 = y * sqrt((x * 9.0));
double t_1 = pow((x * 9.0), -0.5);
double tmp;
if (y <= -500000.0) {
tmp = t_0;
} else if (y <= -6.5e-101) {
tmp = t_1;
} else if (y <= 1.3e-123) {
tmp = sqrt(x) * -3.0;
} else if (y <= 4.5e+27) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y * sqrt((x * 9.0d0))
t_1 = (x * 9.0d0) ** (-0.5d0)
if (y <= (-500000.0d0)) then
tmp = t_0
else if (y <= (-6.5d-101)) then
tmp = t_1
else if (y <= 1.3d-123) then
tmp = sqrt(x) * (-3.0d0)
else if (y <= 4.5d+27) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * Math.sqrt((x * 9.0));
double t_1 = Math.pow((x * 9.0), -0.5);
double tmp;
if (y <= -500000.0) {
tmp = t_0;
} else if (y <= -6.5e-101) {
tmp = t_1;
} else if (y <= 1.3e-123) {
tmp = Math.sqrt(x) * -3.0;
} else if (y <= 4.5e+27) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = y * math.sqrt((x * 9.0)) t_1 = math.pow((x * 9.0), -0.5) tmp = 0 if y <= -500000.0: tmp = t_0 elif y <= -6.5e-101: tmp = t_1 elif y <= 1.3e-123: tmp = math.sqrt(x) * -3.0 elif y <= 4.5e+27: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(y * sqrt(Float64(x * 9.0))) t_1 = Float64(x * 9.0) ^ -0.5 tmp = 0.0 if (y <= -500000.0) tmp = t_0; elseif (y <= -6.5e-101) tmp = t_1; elseif (y <= 1.3e-123) tmp = Float64(sqrt(x) * -3.0); elseif (y <= 4.5e+27) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = y * sqrt((x * 9.0)); t_1 = (x * 9.0) ^ -0.5; tmp = 0.0; if (y <= -500000.0) tmp = t_0; elseif (y <= -6.5e-101) tmp = t_1; elseif (y <= 1.3e-123) tmp = sqrt(x) * -3.0; elseif (y <= 4.5e+27) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[y, -500000.0], t$95$0, If[LessEqual[y, -6.5e-101], t$95$1, If[LessEqual[y, 1.3e-123], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision], If[LessEqual[y, 4.5e+27], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \sqrt{x \cdot 9}\\
t_1 := {\left(x \cdot 9\right)}^{-0.5}\\
\mathbf{if}\;y \leq -500000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-123}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -5e5 or 4.4999999999999999e27 < y Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
sub-neg99.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%
Taylor expanded in y around inf 77.3%
if -5e5 < y < -6.4999999999999996e-101 or 1.29999999999999998e-123 < y < 4.4999999999999999e27Initial program 99.3%
*-commutative99.3%
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 61.1%
metadata-eval61.1%
sqrt-prod60.9%
div-inv61.0%
pow1/261.0%
Applied egg-rr61.0%
unpow1/261.0%
Simplified61.0%
clear-num61.1%
sqrt-div61.1%
metadata-eval61.1%
div-inv61.1%
metadata-eval61.1%
pow1/261.1%
pow-flip61.3%
metadata-eval61.3%
Applied egg-rr61.3%
if -6.4999999999999996e-101 < y < 1.29999999999999998e-123Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 62.8%
Taylor expanded in y around 0 62.8%
*-commutative62.8%
Simplified62.8%
Final simplification69.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sqrt x) (* y 3.0))) (t_1 (pow (* x 9.0) -0.5)))
(if (<= y -5800000.0)
t_0
(if (<= y -3.2e-102)
t_1
(if (<= y 1.3e-123) (* (sqrt x) -3.0) (if (<= y 7.6e+27) t_1 t_0))))))
double code(double x, double y) {
double t_0 = sqrt(x) * (y * 3.0);
double t_1 = pow((x * 9.0), -0.5);
double tmp;
if (y <= -5800000.0) {
tmp = t_0;
} else if (y <= -3.2e-102) {
tmp = t_1;
} else if (y <= 1.3e-123) {
tmp = sqrt(x) * -3.0;
} else if (y <= 7.6e+27) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt(x) * (y * 3.0d0)
t_1 = (x * 9.0d0) ** (-0.5d0)
if (y <= (-5800000.0d0)) then
tmp = t_0
else if (y <= (-3.2d-102)) then
tmp = t_1
else if (y <= 1.3d-123) then
tmp = sqrt(x) * (-3.0d0)
else if (y <= 7.6d+27) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt(x) * (y * 3.0);
double t_1 = Math.pow((x * 9.0), -0.5);
double tmp;
if (y <= -5800000.0) {
tmp = t_0;
} else if (y <= -3.2e-102) {
tmp = t_1;
} else if (y <= 1.3e-123) {
tmp = Math.sqrt(x) * -3.0;
} else if (y <= 7.6e+27) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = math.sqrt(x) * (y * 3.0) t_1 = math.pow((x * 9.0), -0.5) tmp = 0 if y <= -5800000.0: tmp = t_0 elif y <= -3.2e-102: tmp = t_1 elif y <= 1.3e-123: tmp = math.sqrt(x) * -3.0 elif y <= 7.6e+27: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(sqrt(x) * Float64(y * 3.0)) t_1 = Float64(x * 9.0) ^ -0.5 tmp = 0.0 if (y <= -5800000.0) tmp = t_0; elseif (y <= -3.2e-102) tmp = t_1; elseif (y <= 1.3e-123) tmp = Float64(sqrt(x) * -3.0); elseif (y <= 7.6e+27) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt(x) * (y * 3.0); t_1 = (x * 9.0) ^ -0.5; tmp = 0.0; if (y <= -5800000.0) tmp = t_0; elseif (y <= -3.2e-102) tmp = t_1; elseif (y <= 1.3e-123) tmp = sqrt(x) * -3.0; elseif (y <= 7.6e+27) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[x], $MachinePrecision] * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[y, -5800000.0], t$95$0, If[LessEqual[y, -3.2e-102], t$95$1, If[LessEqual[y, 1.3e-123], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision], If[LessEqual[y, 7.6e+27], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x} \cdot \left(y \cdot 3\right)\\
t_1 := {\left(x \cdot 9\right)}^{-0.5}\\
\mathbf{if}\;y \leq -5800000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{-102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-123}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -5.8e6 or 7.60000000000000043e27 < y Initial program 99.4%
*-commutative99.4%
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 inf 77.1%
*-commutative77.1%
associate-*l*77.2%
*-commutative77.2%
Simplified77.2%
if -5.8e6 < y < -3.19999999999999986e-102 or 1.29999999999999998e-123 < y < 7.60000000000000043e27Initial program 99.3%
*-commutative99.3%
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 61.1%
metadata-eval61.1%
sqrt-prod60.9%
div-inv61.0%
pow1/261.0%
Applied egg-rr61.0%
unpow1/261.0%
Simplified61.0%
clear-num61.1%
sqrt-div61.1%
metadata-eval61.1%
div-inv61.1%
metadata-eval61.1%
pow1/261.1%
pow-flip61.3%
metadata-eval61.3%
Applied egg-rr61.3%
if -3.19999999999999986e-102 < y < 1.29999999999999998e-123Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 62.8%
Taylor expanded in y around 0 62.8%
*-commutative62.8%
Simplified62.8%
Final simplification69.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 3.0 (* y (sqrt x)))) (t_1 (pow (* x 9.0) -0.5)))
(if (<= y -720000.0)
t_0
(if (<= y -1.8e-102)
t_1
(if (<= y 1.3e-123) (* (sqrt x) -3.0) (if (<= y 4.6e+27) t_1 t_0))))))
double code(double x, double y) {
double t_0 = 3.0 * (y * sqrt(x));
double t_1 = pow((x * 9.0), -0.5);
double tmp;
if (y <= -720000.0) {
tmp = t_0;
} else if (y <= -1.8e-102) {
tmp = t_1;
} else if (y <= 1.3e-123) {
tmp = sqrt(x) * -3.0;
} else if (y <= 4.6e+27) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 3.0d0 * (y * sqrt(x))
t_1 = (x * 9.0d0) ** (-0.5d0)
if (y <= (-720000.0d0)) then
tmp = t_0
else if (y <= (-1.8d-102)) then
tmp = t_1
else if (y <= 1.3d-123) then
tmp = sqrt(x) * (-3.0d0)
else if (y <= 4.6d+27) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 3.0 * (y * Math.sqrt(x));
double t_1 = Math.pow((x * 9.0), -0.5);
double tmp;
if (y <= -720000.0) {
tmp = t_0;
} else if (y <= -1.8e-102) {
tmp = t_1;
} else if (y <= 1.3e-123) {
tmp = Math.sqrt(x) * -3.0;
} else if (y <= 4.6e+27) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 3.0 * (y * math.sqrt(x)) t_1 = math.pow((x * 9.0), -0.5) tmp = 0 if y <= -720000.0: tmp = t_0 elif y <= -1.8e-102: tmp = t_1 elif y <= 1.3e-123: tmp = math.sqrt(x) * -3.0 elif y <= 4.6e+27: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(3.0 * Float64(y * sqrt(x))) t_1 = Float64(x * 9.0) ^ -0.5 tmp = 0.0 if (y <= -720000.0) tmp = t_0; elseif (y <= -1.8e-102) tmp = t_1; elseif (y <= 1.3e-123) tmp = Float64(sqrt(x) * -3.0); elseif (y <= 4.6e+27) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 3.0 * (y * sqrt(x)); t_1 = (x * 9.0) ^ -0.5; tmp = 0.0; if (y <= -720000.0) tmp = t_0; elseif (y <= -1.8e-102) tmp = t_1; elseif (y <= 1.3e-123) tmp = sqrt(x) * -3.0; elseif (y <= 4.6e+27) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[y, -720000.0], t$95$0, If[LessEqual[y, -1.8e-102], t$95$1, If[LessEqual[y, 1.3e-123], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision], If[LessEqual[y, 4.6e+27], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(y \cdot \sqrt{x}\right)\\
t_1 := {\left(x \cdot 9\right)}^{-0.5}\\
\mathbf{if}\;y \leq -720000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-123}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -7.2e5 or 4.6000000000000001e27 < y Initial program 99.4%
*-commutative99.4%
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 inf 77.1%
if -7.2e5 < y < -1.8e-102 or 1.29999999999999998e-123 < y < 4.6000000000000001e27Initial program 99.3%
*-commutative99.3%
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 61.1%
metadata-eval61.1%
sqrt-prod60.9%
div-inv61.0%
pow1/261.0%
Applied egg-rr61.0%
unpow1/261.0%
Simplified61.0%
clear-num61.1%
sqrt-div61.1%
metadata-eval61.1%
div-inv61.1%
metadata-eval61.1%
pow1/261.1%
pow-flip61.3%
metadata-eval61.3%
Applied egg-rr61.3%
if -1.8e-102 < y < 1.29999999999999998e-123Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 62.8%
Taylor expanded in y around 0 62.8%
*-commutative62.8%
Simplified62.8%
Final simplification69.3%
(FPCore (x y) :precision binary64 (if (<= x 3.8e-38) (pow (* x 9.0) -0.5) (* (sqrt (* x 9.0)) (+ y -1.0))))
double code(double x, double y) {
double tmp;
if (x <= 3.8e-38) {
tmp = pow((x * 9.0), -0.5);
} else {
tmp = sqrt((x * 9.0)) * (y + -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 <= 3.8d-38) then
tmp = (x * 9.0d0) ** (-0.5d0)
else
tmp = sqrt((x * 9.0d0)) * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 3.8e-38) {
tmp = Math.pow((x * 9.0), -0.5);
} else {
tmp = Math.sqrt((x * 9.0)) * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 3.8e-38: tmp = math.pow((x * 9.0), -0.5) else: tmp = math.sqrt((x * 9.0)) * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= 3.8e-38) tmp = Float64(x * 9.0) ^ -0.5; else tmp = Float64(sqrt(Float64(x * 9.0)) * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 3.8e-38) tmp = (x * 9.0) ^ -0.5; else tmp = sqrt((x * 9.0)) * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 3.8e-38], N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision], N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.8 \cdot 10^{-38}:\\
\;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x \cdot 9} \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < 3.8e-38Initial program 99.2%
*-commutative99.2%
associate-*l*99.1%
associate--l+99.1%
distribute-lft-in99.1%
fma-define99.1%
sub-neg99.1%
+-commutative99.1%
distribute-lft-in99.1%
metadata-eval99.1%
metadata-eval99.1%
*-commutative99.1%
associate-/r*99.1%
associate-*r/99.2%
metadata-eval99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 79.1%
metadata-eval79.1%
sqrt-prod79.2%
div-inv79.2%
pow1/279.2%
Applied egg-rr79.2%
unpow1/279.2%
Simplified79.2%
clear-num79.3%
sqrt-div79.2%
metadata-eval79.2%
div-inv79.3%
metadata-eval79.3%
pow1/279.3%
pow-flip79.5%
metadata-eval79.5%
Applied egg-rr79.5%
if 3.8e-38 < x Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
sub-neg99.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%
Taylor expanded in x around inf 97.0%
Final simplification89.8%
(FPCore (x y) :precision binary64 (if (<= x 9.8e-39) (pow (* x 9.0) -0.5) (* 3.0 (* (sqrt x) (+ y -1.0)))))
double code(double x, double y) {
double tmp;
if (x <= 9.8e-39) {
tmp = pow((x * 9.0), -0.5);
} else {
tmp = 3.0 * (sqrt(x) * (y + -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 <= 9.8d-39) then
tmp = (x * 9.0d0) ** (-0.5d0)
else
tmp = 3.0d0 * (sqrt(x) * (y + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 9.8e-39) {
tmp = Math.pow((x * 9.0), -0.5);
} else {
tmp = 3.0 * (Math.sqrt(x) * (y + -1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 9.8e-39: tmp = math.pow((x * 9.0), -0.5) else: tmp = 3.0 * (math.sqrt(x) * (y + -1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 9.8e-39) tmp = Float64(x * 9.0) ^ -0.5; else tmp = Float64(3.0 * Float64(sqrt(x) * Float64(y + -1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 9.8e-39) tmp = (x * 9.0) ^ -0.5; else tmp = 3.0 * (sqrt(x) * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 9.8e-39], N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision], N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.8 \cdot 10^{-39}:\\
\;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if x < 9.79999999999999947e-39Initial program 99.2%
*-commutative99.2%
associate-*l*99.1%
associate--l+99.1%
distribute-lft-in99.1%
fma-define99.1%
sub-neg99.1%
+-commutative99.1%
distribute-lft-in99.1%
metadata-eval99.1%
metadata-eval99.1%
*-commutative99.1%
associate-/r*99.1%
associate-*r/99.2%
metadata-eval99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 79.1%
metadata-eval79.1%
sqrt-prod79.2%
div-inv79.2%
pow1/279.2%
Applied egg-rr79.2%
unpow1/279.2%
Simplified79.2%
clear-num79.3%
sqrt-div79.2%
metadata-eval79.2%
div-inv79.3%
metadata-eval79.3%
pow1/279.3%
pow-flip79.5%
metadata-eval79.5%
Applied egg-rr79.5%
if 9.79999999999999947e-39 < x Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 96.9%
Final simplification89.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.4%
+-commutative99.4%
associate--l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.5%
pow1/299.5%
Applied egg-rr99.5%
unpow1/299.5%
Simplified99.5%
Final simplification99.5%
(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.4%
*-commutative99.4%
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 (if (<= x 0.11) (pow (* x 9.0) -0.5) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if (x <= 0.11) {
tmp = pow((x * 9.0), -0.5);
} 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 <= 0.11d0) then
tmp = (x * 9.0d0) ** (-0.5d0)
else
tmp = sqrt(x) * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.11) {
tmp = Math.pow((x * 9.0), -0.5);
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.11: tmp = math.pow((x * 9.0), -0.5) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 0.11) tmp = Float64(x * 9.0) ^ -0.5; else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.11) tmp = (x * 9.0) ^ -0.5; else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.11], N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.11:\\
\;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 0.110000000000000001Initial program 99.2%
*-commutative99.2%
associate-*l*99.2%
associate--l+99.2%
distribute-lft-in99.2%
fma-define99.2%
sub-neg99.2%
+-commutative99.2%
distribute-lft-in99.2%
metadata-eval99.2%
metadata-eval99.2%
*-commutative99.2%
associate-/r*99.1%
associate-*r/99.2%
metadata-eval99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 73.3%
metadata-eval73.3%
sqrt-prod73.4%
div-inv73.5%
pow1/273.5%
Applied egg-rr73.5%
unpow1/273.5%
Simplified73.5%
clear-num73.5%
sqrt-div73.4%
metadata-eval73.4%
div-inv73.5%
metadata-eval73.5%
pow1/273.5%
pow-flip73.7%
metadata-eval73.7%
Applied egg-rr73.7%
if 0.110000000000000001 < x Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 99.3%
Taylor expanded in y around 0 51.8%
*-commutative51.8%
Simplified51.8%
(FPCore (x y) :precision binary64 (if (<= x 0.11) (sqrt (/ 0.1111111111111111 x)) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if (x <= 0.11) {
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 <= 0.11d0) 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 <= 0.11) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.11: tmp = math.sqrt((0.1111111111111111 / x)) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 0.11) 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 <= 0.11) tmp = sqrt((0.1111111111111111 / x)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.11], 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 0.11:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 0.110000000000000001Initial program 99.2%
*-commutative99.2%
associate-*l*99.2%
associate--l+99.2%
distribute-lft-in99.2%
fma-define99.2%
sub-neg99.2%
+-commutative99.2%
distribute-lft-in99.2%
metadata-eval99.2%
metadata-eval99.2%
*-commutative99.2%
associate-/r*99.1%
associate-*r/99.2%
metadata-eval99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 73.3%
metadata-eval73.3%
sqrt-prod73.4%
div-inv73.5%
pow1/273.5%
Applied egg-rr73.5%
unpow1/273.5%
Simplified73.5%
if 0.110000000000000001 < x Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 99.3%
Taylor expanded in y around 0 51.8%
*-commutative51.8%
Simplified51.8%
(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.4%
*-commutative99.4%
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 34.8%
metadata-eval34.8%
sqrt-prod34.9%
div-inv34.9%
pow1/234.9%
Applied egg-rr34.9%
unpow1/234.9%
Simplified34.9%
(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.4%
+-commutative99.4%
associate--l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 65.3%
Taylor expanded in y around 0 28.8%
*-commutative28.8%
Simplified28.8%
add-sqr-sqrt0.0%
sqrt-unprod3.0%
swap-sqr3.0%
add-sqr-sqrt3.0%
metadata-eval3.0%
Applied egg-rr3.0%
(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 2024181
(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)))