
(FPCore (x y) :precision binary64 (sqrt (fabs (- x y))))
double code(double x, double y) {
return sqrt(fabs((x - y)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt(abs((x - y)))
end function
public static double code(double x, double y) {
return Math.sqrt(Math.abs((x - y)));
}
def code(x, y): return math.sqrt(math.fabs((x - y)))
function code(x, y) return sqrt(abs(Float64(x - y))) end
function tmp = code(x, y) tmp = sqrt(abs((x - y))); end
code[x_, y_] := N[Sqrt[N[Abs[N[(x - y), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left|x - y\right|}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (sqrt (fabs (- x y))))
double code(double x, double y) {
return sqrt(fabs((x - y)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt(abs((x - y)))
end function
public static double code(double x, double y) {
return Math.sqrt(Math.abs((x - y)));
}
def code(x, y): return math.sqrt(math.fabs((x - y)))
function code(x, y) return sqrt(abs(Float64(x - y))) end
function tmp = code(x, y) tmp = sqrt(abs((x - y))); end
code[x_, y_] := N[Sqrt[N[Abs[N[(x - y), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left|x - y\right|}
\end{array}
(FPCore (x y) :precision binary64 (sqrt (fabs (- x y))))
double code(double x, double y) {
return sqrt(fabs((x - y)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt(abs((x - y)))
end function
public static double code(double x, double y) {
return Math.sqrt(Math.abs((x - y)));
}
def code(x, y): return math.sqrt(math.fabs((x - y)))
function code(x, y) return sqrt(abs(Float64(x - y))) end
function tmp = code(x, y) tmp = sqrt(abs((x - y))); end
code[x_, y_] := N[Sqrt[N[Abs[N[(x - y), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left|x - y\right|}
\end{array}
Initial program 100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ 1.0 (- x y))))
(if (<= y 1.35e-151)
(sqrt (fabs x))
(if (<= y 2.6e+48) (/ 1.0 (pow (* t_0 t_0) 0.25)) (sqrt y)))))
double code(double x, double y) {
double t_0 = 1.0 / (x - y);
double tmp;
if (y <= 1.35e-151) {
tmp = sqrt(fabs(x));
} else if (y <= 2.6e+48) {
tmp = 1.0 / pow((t_0 * t_0), 0.25);
} else {
tmp = sqrt(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 / (x - y)
if (y <= 1.35d-151) then
tmp = sqrt(abs(x))
else if (y <= 2.6d+48) then
tmp = 1.0d0 / ((t_0 * t_0) ** 0.25d0)
else
tmp = sqrt(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 / (x - y);
double tmp;
if (y <= 1.35e-151) {
tmp = Math.sqrt(Math.abs(x));
} else if (y <= 2.6e+48) {
tmp = 1.0 / Math.pow((t_0 * t_0), 0.25);
} else {
tmp = Math.sqrt(y);
}
return tmp;
}
def code(x, y): t_0 = 1.0 / (x - y) tmp = 0 if y <= 1.35e-151: tmp = math.sqrt(math.fabs(x)) elif y <= 2.6e+48: tmp = 1.0 / math.pow((t_0 * t_0), 0.25) else: tmp = math.sqrt(y) return tmp
function code(x, y) t_0 = Float64(1.0 / Float64(x - y)) tmp = 0.0 if (y <= 1.35e-151) tmp = sqrt(abs(x)); elseif (y <= 2.6e+48) tmp = Float64(1.0 / (Float64(t_0 * t_0) ^ 0.25)); else tmp = sqrt(y); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 / (x - y); tmp = 0.0; if (y <= 1.35e-151) tmp = sqrt(abs(x)); elseif (y <= 2.6e+48) tmp = 1.0 / ((t_0 * t_0) ^ 0.25); else tmp = sqrt(y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(x - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.35e-151], N[Sqrt[N[Abs[x], $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 2.6e+48], N[(1.0 / N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], 0.25], $MachinePrecision]), $MachinePrecision], N[Sqrt[y], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{x - y}\\
\mathbf{if}\;y \leq 1.35 \cdot 10^{-151}:\\
\;\;\;\;\sqrt{\left|x\right|}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+48}:\\
\;\;\;\;\frac{1}{{\left(t\_0 \cdot t\_0\right)}^{0.25}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y}\\
\end{array}
\end{array}
if y < 1.35000000000000004e-151Initial program 100.0%
Taylor expanded in x around inf
Simplified59.8%
if 1.35000000000000004e-151 < y < 2.59999999999999995e48Initial program 100.0%
flip--N/A
fabs-divN/A
clear-numN/A
sqrt-divN/A
div-fabsN/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
fabs-lowering-fabs.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f6499.6%
Applied egg-rr99.6%
pow1/2N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr81.1%
if 2.59999999999999995e48 < y Initial program 100.0%
pow1/2N/A
sqr-powN/A
pow-prod-downN/A
sqr-absN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
metadata-eval25.4%
Applied egg-rr25.4%
Taylor expanded in x around 0
unpow2N/A
*-lowering-*.f6424.1%
Simplified24.1%
pow2N/A
pow-powN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f6476.3%
Applied egg-rr76.3%
(FPCore (x y) :precision binary64 (let* ((t_0 (/ 1.0 (- x y)))) (if (<= y 2.6e+48) (/ 1.0 (pow (* t_0 t_0) 0.25)) (sqrt y))))
double code(double x, double y) {
double t_0 = 1.0 / (x - y);
double tmp;
if (y <= 2.6e+48) {
tmp = 1.0 / pow((t_0 * t_0), 0.25);
} else {
tmp = sqrt(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 / (x - y)
if (y <= 2.6d+48) then
tmp = 1.0d0 / ((t_0 * t_0) ** 0.25d0)
else
tmp = sqrt(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 / (x - y);
double tmp;
if (y <= 2.6e+48) {
tmp = 1.0 / Math.pow((t_0 * t_0), 0.25);
} else {
tmp = Math.sqrt(y);
}
return tmp;
}
def code(x, y): t_0 = 1.0 / (x - y) tmp = 0 if y <= 2.6e+48: tmp = 1.0 / math.pow((t_0 * t_0), 0.25) else: tmp = math.sqrt(y) return tmp
function code(x, y) t_0 = Float64(1.0 / Float64(x - y)) tmp = 0.0 if (y <= 2.6e+48) tmp = Float64(1.0 / (Float64(t_0 * t_0) ^ 0.25)); else tmp = sqrt(y); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 / (x - y); tmp = 0.0; if (y <= 2.6e+48) tmp = 1.0 / ((t_0 * t_0) ^ 0.25); else tmp = sqrt(y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(x - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.6e+48], N[(1.0 / N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], 0.25], $MachinePrecision]), $MachinePrecision], N[Sqrt[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{x - y}\\
\mathbf{if}\;y \leq 2.6 \cdot 10^{+48}:\\
\;\;\;\;\frac{1}{{\left(t\_0 \cdot t\_0\right)}^{0.25}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y}\\
\end{array}
\end{array}
if y < 2.59999999999999995e48Initial program 100.0%
flip--N/A
fabs-divN/A
clear-numN/A
sqrt-divN/A
div-fabsN/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
fabs-lowering-fabs.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f6499.5%
Applied egg-rr99.5%
pow1/2N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
inv-powN/A
sqr-powN/A
fabs-sqrN/A
sqr-powN/A
inv-powN/A
pow-lowering-pow.f64N/A
Applied egg-rr60.5%
if 2.59999999999999995e48 < y Initial program 100.0%
pow1/2N/A
sqr-powN/A
pow-prod-downN/A
sqr-absN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
metadata-eval25.4%
Applied egg-rr25.4%
Taylor expanded in x around 0
unpow2N/A
*-lowering-*.f6424.1%
Simplified24.1%
pow2N/A
pow-powN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f6476.3%
Applied egg-rr76.3%
(FPCore (x y) :precision binary64 (if (<= y 2.6e+48) (pow (* (- x y) (- x y)) 0.25) (sqrt y)))
double code(double x, double y) {
double tmp;
if (y <= 2.6e+48) {
tmp = pow(((x - y) * (x - y)), 0.25);
} else {
tmp = sqrt(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.6d+48) then
tmp = ((x - y) * (x - y)) ** 0.25d0
else
tmp = sqrt(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.6e+48) {
tmp = Math.pow(((x - y) * (x - y)), 0.25);
} else {
tmp = Math.sqrt(y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.6e+48: tmp = math.pow(((x - y) * (x - y)), 0.25) else: tmp = math.sqrt(y) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.6e+48) tmp = Float64(Float64(x - y) * Float64(x - y)) ^ 0.25; else tmp = sqrt(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.6e+48) tmp = ((x - y) * (x - y)) ^ 0.25; else tmp = sqrt(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.6e+48], N[Power[N[(N[(x - y), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision], N[Sqrt[y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.6 \cdot 10^{+48}:\\
\;\;\;\;{\left(\left(x - y\right) \cdot \left(x - y\right)\right)}^{0.25}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y}\\
\end{array}
\end{array}
if y < 2.59999999999999995e48Initial program 100.0%
pow1/2N/A
sqr-powN/A
pow-prod-downN/A
sqr-absN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
metadata-eval60.4%
Applied egg-rr60.4%
if 2.59999999999999995e48 < y Initial program 100.0%
pow1/2N/A
sqr-powN/A
pow-prod-downN/A
sqr-absN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
metadata-eval25.4%
Applied egg-rr25.4%
Taylor expanded in x around 0
unpow2N/A
*-lowering-*.f6424.1%
Simplified24.1%
pow2N/A
pow-powN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f6476.3%
Applied egg-rr76.3%
(FPCore (x y) :precision binary64 (if (<= y 3.3e-174) (pow (* x (+ x (* y -2.0))) 0.25) (sqrt y)))
double code(double x, double y) {
double tmp;
if (y <= 3.3e-174) {
tmp = pow((x * (x + (y * -2.0))), 0.25);
} else {
tmp = sqrt(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.3d-174) then
tmp = (x * (x + (y * (-2.0d0)))) ** 0.25d0
else
tmp = sqrt(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 3.3e-174) {
tmp = Math.pow((x * (x + (y * -2.0))), 0.25);
} else {
tmp = Math.sqrt(y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3.3e-174: tmp = math.pow((x * (x + (y * -2.0))), 0.25) else: tmp = math.sqrt(y) return tmp
function code(x, y) tmp = 0.0 if (y <= 3.3e-174) tmp = Float64(x * Float64(x + Float64(y * -2.0))) ^ 0.25; else tmp = sqrt(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3.3e-174) tmp = (x * (x + (y * -2.0))) ^ 0.25; else tmp = sqrt(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3.3e-174], N[Power[N[(x * N[(x + N[(y * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision], N[Sqrt[y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{-174}:\\
\;\;\;\;{\left(x \cdot \left(x + y \cdot -2\right)\right)}^{0.25}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y}\\
\end{array}
\end{array}
if y < 3.3000000000000001e-174Initial program 100.0%
pow1/2N/A
sqr-powN/A
pow-prod-downN/A
sqr-absN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
metadata-eval55.0%
Applied egg-rr55.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
distribute-lft-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6432.4%
Simplified32.4%
if 3.3000000000000001e-174 < y Initial program 100.0%
pow1/2N/A
sqr-powN/A
pow-prod-downN/A
sqr-absN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
metadata-eval48.5%
Applied egg-rr48.5%
Taylor expanded in x around 0
unpow2N/A
*-lowering-*.f6430.5%
Simplified30.5%
pow2N/A
pow-powN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f6459.1%
Applied egg-rr59.1%
(FPCore (x y) :precision binary64 (if (<= y 3.3e-174) (pow (* x (- x y)) 0.25) (sqrt y)))
double code(double x, double y) {
double tmp;
if (y <= 3.3e-174) {
tmp = pow((x * (x - y)), 0.25);
} else {
tmp = sqrt(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.3d-174) then
tmp = (x * (x - y)) ** 0.25d0
else
tmp = sqrt(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 3.3e-174) {
tmp = Math.pow((x * (x - y)), 0.25);
} else {
tmp = Math.sqrt(y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3.3e-174: tmp = math.pow((x * (x - y)), 0.25) else: tmp = math.sqrt(y) return tmp
function code(x, y) tmp = 0.0 if (y <= 3.3e-174) tmp = Float64(x * Float64(x - y)) ^ 0.25; else tmp = sqrt(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3.3e-174) tmp = (x * (x - y)) ^ 0.25; else tmp = sqrt(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3.3e-174], N[Power[N[(x * N[(x - y), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision], N[Sqrt[y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{-174}:\\
\;\;\;\;{\left(x \cdot \left(x - y\right)\right)}^{0.25}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y}\\
\end{array}
\end{array}
if y < 3.3000000000000001e-174Initial program 100.0%
pow1/2N/A
sqr-powN/A
pow-prod-downN/A
sqr-absN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
metadata-eval55.0%
Applied egg-rr55.0%
Taylor expanded in x around inf
Simplified32.1%
if 3.3000000000000001e-174 < y Initial program 100.0%
pow1/2N/A
sqr-powN/A
pow-prod-downN/A
sqr-absN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
metadata-eval48.5%
Applied egg-rr48.5%
Taylor expanded in x around 0
unpow2N/A
*-lowering-*.f6430.5%
Simplified30.5%
pow2N/A
pow-powN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f6459.1%
Applied egg-rr59.1%
Final simplification43.5%
(FPCore (x y) :precision binary64 (if (<= y 3.3e-174) (pow (* x x) 0.25) (sqrt y)))
double code(double x, double y) {
double tmp;
if (y <= 3.3e-174) {
tmp = pow((x * x), 0.25);
} else {
tmp = sqrt(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.3d-174) then
tmp = (x * x) ** 0.25d0
else
tmp = sqrt(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 3.3e-174) {
tmp = Math.pow((x * x), 0.25);
} else {
tmp = Math.sqrt(y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3.3e-174: tmp = math.pow((x * x), 0.25) else: tmp = math.sqrt(y) return tmp
function code(x, y) tmp = 0.0 if (y <= 3.3e-174) tmp = Float64(x * x) ^ 0.25; else tmp = sqrt(y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3.3e-174) tmp = (x * x) ^ 0.25; else tmp = sqrt(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3.3e-174], N[Power[N[(x * x), $MachinePrecision], 0.25], $MachinePrecision], N[Sqrt[y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{-174}:\\
\;\;\;\;{\left(x \cdot x\right)}^{0.25}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y}\\
\end{array}
\end{array}
if y < 3.3000000000000001e-174Initial program 100.0%
pow1/2N/A
sqr-powN/A
pow-prod-downN/A
sqr-absN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
metadata-eval55.0%
Applied egg-rr55.0%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6432.7%
Simplified32.7%
if 3.3000000000000001e-174 < y Initial program 100.0%
pow1/2N/A
sqr-powN/A
pow-prod-downN/A
sqr-absN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
metadata-eval48.5%
Applied egg-rr48.5%
Taylor expanded in x around 0
unpow2N/A
*-lowering-*.f6430.5%
Simplified30.5%
pow2N/A
pow-powN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f6459.1%
Applied egg-rr59.1%
(FPCore (x y) :precision binary64 (sqrt y))
double code(double x, double y) {
return sqrt(y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt(y)
end function
public static double code(double x, double y) {
return Math.sqrt(y);
}
def code(x, y): return math.sqrt(y)
function code(x, y) return sqrt(y) end
function tmp = code(x, y) tmp = sqrt(y); end
code[x_, y_] := N[Sqrt[y], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{y}
\end{array}
Initial program 100.0%
pow1/2N/A
sqr-powN/A
pow-prod-downN/A
sqr-absN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
metadata-eval52.3%
Applied egg-rr52.3%
Taylor expanded in x around 0
unpow2N/A
*-lowering-*.f6428.0%
Simplified28.0%
pow2N/A
pow-powN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f6425.6%
Applied egg-rr25.6%
(FPCore (x y) :precision binary64 (sqrt x))
double code(double x, double y) {
return sqrt(x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt(x)
end function
public static double code(double x, double y) {
return Math.sqrt(x);
}
def code(x, y): return math.sqrt(x)
function code(x, y) return sqrt(x) end
function tmp = code(x, y) tmp = sqrt(x); end
code[x_, y_] := N[Sqrt[x], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x}
\end{array}
Initial program 100.0%
pow1/2N/A
sqr-powN/A
pow-prod-downN/A
sqr-absN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
metadata-eval52.3%
Applied egg-rr52.3%
Taylor expanded in x around inf
sqrt-lowering-sqrt.f6425.3%
Simplified25.3%
herbie shell --seed 2024138
(FPCore (x y)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, C"
:precision binary64
(sqrt (fabs (- x y))))