
(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 (if (<= x -1.12e+154) (sqrt (fabs x)) (if (<= x -5e-142) (pow (* (- x y) (- x y)) 0.25) (sqrt y))))
double code(double x, double y) {
double tmp;
if (x <= -1.12e+154) {
tmp = sqrt(fabs(x));
} else if (x <= -5e-142) {
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 (x <= (-1.12d+154)) then
tmp = sqrt(abs(x))
else if (x <= (-5d-142)) 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 (x <= -1.12e+154) {
tmp = Math.sqrt(Math.abs(x));
} else if (x <= -5e-142) {
tmp = Math.pow(((x - y) * (x - y)), 0.25);
} else {
tmp = Math.sqrt(y);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.12e+154: tmp = math.sqrt(math.fabs(x)) elif x <= -5e-142: tmp = math.pow(((x - y) * (x - y)), 0.25) else: tmp = math.sqrt(y) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.12e+154) tmp = sqrt(abs(x)); elseif (x <= -5e-142) 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 (x <= -1.12e+154) tmp = sqrt(abs(x)); elseif (x <= -5e-142) tmp = ((x - y) * (x - y)) ^ 0.25; else tmp = sqrt(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.12e+154], N[Sqrt[N[Abs[x], $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -5e-142], 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}\;x \leq -1.12 \cdot 10^{+154}:\\
\;\;\;\;\sqrt{\left|x\right|}\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-142}:\\
\;\;\;\;{\left(\left(x - y\right) \cdot \left(x - y\right)\right)}^{0.25}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y}\\
\end{array}
\end{array}
if x < -1.11999999999999994e154Initial program 100.0%
Taylor expanded in x around inf
Simplified86.9%
if -1.11999999999999994e154 < x < -5.0000000000000002e-142Initial 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-eval79.5%
Applied egg-rr79.5%
if -5.0000000000000002e-142 < x 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.1%
Applied egg-rr48.1%
Taylor expanded in x around 0
unpow2N/A
*-lowering-*.f6430.2%
Simplified30.2%
pow2N/A
pow-powN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f6429.3%
Applied egg-rr29.3%
(FPCore (x y) :precision binary64 (if (<= (- x y) -2e+160) (sqrt y) (if (<= (- x y) -1e-172) (pow (/ (/ 1.0 (- x y)) (- x y)) -0.25) (sqrt y))))
double code(double x, double y) {
double tmp;
if ((x - y) <= -2e+160) {
tmp = sqrt(y);
} else if ((x - y) <= -1e-172) {
tmp = pow(((1.0 / (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 ((x - y) <= (-2d+160)) then
tmp = sqrt(y)
else if ((x - y) <= (-1d-172)) then
tmp = ((1.0d0 / (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 ((x - y) <= -2e+160) {
tmp = Math.sqrt(y);
} else if ((x - y) <= -1e-172) {
tmp = Math.pow(((1.0 / (x - y)) / (x - y)), -0.25);
} else {
tmp = Math.sqrt(y);
}
return tmp;
}
def code(x, y): tmp = 0 if (x - y) <= -2e+160: tmp = math.sqrt(y) elif (x - y) <= -1e-172: tmp = math.pow(((1.0 / (x - y)) / (x - y)), -0.25) else: tmp = math.sqrt(y) return tmp
function code(x, y) tmp = 0.0 if (Float64(x - y) <= -2e+160) tmp = sqrt(y); elseif (Float64(x - y) <= -1e-172) tmp = Float64(Float64(1.0 / 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 ((x - y) <= -2e+160) tmp = sqrt(y); elseif ((x - y) <= -1e-172) tmp = ((1.0 / (x - y)) / (x - y)) ^ -0.25; else tmp = sqrt(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(x - y), $MachinePrecision], -2e+160], N[Sqrt[y], $MachinePrecision], If[LessEqual[N[(x - y), $MachinePrecision], -1e-172], N[Power[N[(N[(1.0 / N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision], -0.25], $MachinePrecision], N[Sqrt[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x - y \leq -2 \cdot 10^{+160}:\\
\;\;\;\;\sqrt{y}\\
\mathbf{elif}\;x - y \leq -1 \cdot 10^{-172}:\\
\;\;\;\;{\left(\frac{\frac{1}{x - y}}{x - y}\right)}^{-0.25}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y}\\
\end{array}
\end{array}
if (-.f64 x y) < -2.00000000000000001e160 or -1e-172 < (-.f64 x 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-eval31.7%
Applied egg-rr31.7%
Taylor expanded in x around 0
unpow2N/A
*-lowering-*.f6417.1%
Simplified17.1%
pow2N/A
pow-powN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f6415.4%
Applied egg-rr15.4%
if -2.00000000000000001e160 < (-.f64 x y) < -1e-172Initial 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-eval97.1%
Applied egg-rr97.1%
flip--N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
clear-numN/A
flip--N/A
/-lowering-/.f64N/A
--lowering--.f6497.1%
Applied egg-rr97.1%
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
metadata-eval97.0%
Applied egg-rr97.0%
(FPCore (x y) :precision binary64 (if (<= (- x y) -2e+155) (sqrt y) (if (<= (- x y) -1e-172) (pow (* (- x y) (- x y)) 0.25) (sqrt y))))
double code(double x, double y) {
double tmp;
if ((x - y) <= -2e+155) {
tmp = sqrt(y);
} else if ((x - y) <= -1e-172) {
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 ((x - y) <= (-2d+155)) then
tmp = sqrt(y)
else if ((x - y) <= (-1d-172)) 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 ((x - y) <= -2e+155) {
tmp = Math.sqrt(y);
} else if ((x - y) <= -1e-172) {
tmp = Math.pow(((x - y) * (x - y)), 0.25);
} else {
tmp = Math.sqrt(y);
}
return tmp;
}
def code(x, y): tmp = 0 if (x - y) <= -2e+155: tmp = math.sqrt(y) elif (x - y) <= -1e-172: tmp = math.pow(((x - y) * (x - y)), 0.25) else: tmp = math.sqrt(y) return tmp
function code(x, y) tmp = 0.0 if (Float64(x - y) <= -2e+155) tmp = sqrt(y); elseif (Float64(x - y) <= -1e-172) 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 ((x - y) <= -2e+155) tmp = sqrt(y); elseif ((x - y) <= -1e-172) tmp = ((x - y) * (x - y)) ^ 0.25; else tmp = sqrt(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(x - y), $MachinePrecision], -2e+155], N[Sqrt[y], $MachinePrecision], If[LessEqual[N[(x - y), $MachinePrecision], -1e-172], 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}\;x - y \leq -2 \cdot 10^{+155}:\\
\;\;\;\;\sqrt{y}\\
\mathbf{elif}\;x - y \leq -1 \cdot 10^{-172}:\\
\;\;\;\;{\left(\left(x - y\right) \cdot \left(x - y\right)\right)}^{0.25}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y}\\
\end{array}
\end{array}
if (-.f64 x y) < -2.00000000000000001e155 or -1e-172 < (-.f64 x 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-eval31.7%
Applied egg-rr31.7%
Taylor expanded in x around 0
unpow2N/A
*-lowering-*.f6417.1%
Simplified17.1%
pow2N/A
pow-powN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f6415.4%
Applied egg-rr15.4%
if -2.00000000000000001e155 < (-.f64 x y) < -1e-172Initial 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-eval97.1%
Applied egg-rr97.1%
(FPCore (x y) :precision binary64 (if (<= y 1.9e-233) (pow (* x (+ x (* y -2.0))) 0.25) (sqrt y)))
double code(double x, double y) {
double tmp;
if (y <= 1.9e-233) {
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 <= 1.9d-233) 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 <= 1.9e-233) {
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 <= 1.9e-233: 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 <= 1.9e-233) 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 <= 1.9e-233) tmp = (x * (x + (y * -2.0))) ^ 0.25; else tmp = sqrt(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.9e-233], 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 1.9 \cdot 10^{-233}:\\
\;\;\;\;{\left(x \cdot \left(x + y \cdot -2\right)\right)}^{0.25}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y}\\
\end{array}
\end{array}
if y < 1.9e-233Initial 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-eval46.2%
Applied egg-rr46.2%
Taylor expanded in x around inf
unpow2N/A
associate-*l*N/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-*r/N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-rgt-identityN/A
times-fracN/A
*-rgt-identityN/A
times-fracN/A
*-inversesN/A
/-rgt-identityN/A
*-lft-identityN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
mul-1-negN/A
+-lowering-+.f64N/A
Simplified29.6%
if 1.9e-233 < 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-eval53.0%
Applied egg-rr53.0%
Taylor expanded in x around 0
unpow2N/A
*-lowering-*.f6432.9%
Simplified32.9%
pow2N/A
pow-powN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f6456.1%
Applied egg-rr56.1%
(FPCore (x y) :precision binary64 (if (<= y 1.08e-234) (pow (* x (- x y)) 0.25) (sqrt y)))
double code(double x, double y) {
double tmp;
if (y <= 1.08e-234) {
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 <= 1.08d-234) 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 <= 1.08e-234) {
tmp = Math.pow((x * (x - y)), 0.25);
} else {
tmp = Math.sqrt(y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.08e-234: tmp = math.pow((x * (x - y)), 0.25) else: tmp = math.sqrt(y) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.08e-234) 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 <= 1.08e-234) tmp = (x * (x - y)) ^ 0.25; else tmp = sqrt(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.08e-234], 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 1.08 \cdot 10^{-234}:\\
\;\;\;\;{\left(x \cdot \left(x - y\right)\right)}^{0.25}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y}\\
\end{array}
\end{array}
if y < 1.0800000000000001e-234Initial 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-eval45.8%
Applied egg-rr45.8%
Taylor expanded in x around inf
Simplified29.2%
if 1.0800000000000001e-234 < 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-eval53.4%
Applied egg-rr53.4%
Taylor expanded in x around 0
unpow2N/A
*-lowering-*.f6432.7%
Simplified32.7%
pow2N/A
pow-powN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f6455.6%
Applied egg-rr55.6%
Final simplification40.6%
(FPCore (x y) :precision binary64 (if (<= y 1.9e-233) (pow (* x x) 0.25) (sqrt y)))
double code(double x, double y) {
double tmp;
if (y <= 1.9e-233) {
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 <= 1.9d-233) 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 <= 1.9e-233) {
tmp = Math.pow((x * x), 0.25);
} else {
tmp = Math.sqrt(y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.9e-233: tmp = math.pow((x * x), 0.25) else: tmp = math.sqrt(y) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.9e-233) 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 <= 1.9e-233) tmp = (x * x) ^ 0.25; else tmp = sqrt(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.9e-233], N[Power[N[(x * x), $MachinePrecision], 0.25], $MachinePrecision], N[Sqrt[y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.9 \cdot 10^{-233}:\\
\;\;\;\;{\left(x \cdot x\right)}^{0.25}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y}\\
\end{array}
\end{array}
if y < 1.9e-233Initial 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-eval46.2%
Applied egg-rr46.2%
Taylor expanded in x around inf
unpow2N/A
*-lowering-*.f6430.1%
Simplified30.1%
if 1.9e-233 < 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-eval53.0%
Applied egg-rr53.0%
Taylor expanded in x around 0
unpow2N/A
*-lowering-*.f6432.9%
Simplified32.9%
pow2N/A
pow-powN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f6456.1%
Applied egg-rr56.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-eval49.1%
Applied egg-rr49.1%
Taylor expanded in x around 0
unpow2N/A
*-lowering-*.f6426.0%
Simplified26.0%
pow2N/A
pow-powN/A
metadata-evalN/A
unpow1/2N/A
sqrt-lowering-sqrt.f6424.4%
Applied egg-rr24.4%
(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-eval49.1%
Applied egg-rr49.1%
Taylor expanded in x around inf
sqrt-lowering-sqrt.f6424.7%
Simplified24.7%
herbie shell --seed 2024152
(FPCore (x y)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, C"
:precision binary64
(sqrt (fabs (- x y))))