
(FPCore (x y) :precision binary64 (+ x (/ (fabs (- y x)) 2.0)))
double code(double x, double y) {
return x + (fabs((y - x)) / 2.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + (abs((y - x)) / 2.0d0)
end function
public static double code(double x, double y) {
return x + (Math.abs((y - x)) / 2.0);
}
def code(x, y): return x + (math.fabs((y - x)) / 2.0)
function code(x, y) return Float64(x + Float64(abs(Float64(y - x)) / 2.0)) end
function tmp = code(x, y) tmp = x + (abs((y - x)) / 2.0); end
code[x_, y_] := N[(x + N[(N[Abs[N[(y - x), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left|y - x\right|}{2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (+ x (/ (fabs (- y x)) 2.0)))
double code(double x, double y) {
return x + (fabs((y - x)) / 2.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + (abs((y - x)) / 2.0d0)
end function
public static double code(double x, double y) {
return x + (Math.abs((y - x)) / 2.0);
}
def code(x, y): return x + (math.fabs((y - x)) / 2.0)
function code(x, y) return Float64(x + Float64(abs(Float64(y - x)) / 2.0)) end
function tmp = code(x, y) tmp = x + (abs((y - x)) / 2.0); end
code[x_, y_] := N[(x + N[(N[Abs[N[(y - x), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left|y - x\right|}{2}
\end{array}
(FPCore (x y) :precision binary64 (+ x (/ (fabs (- y x)) 2.0)))
double code(double x, double y) {
return x + (fabs((y - x)) / 2.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + (abs((y - x)) / 2.0d0)
end function
public static double code(double x, double y) {
return x + (Math.abs((y - x)) / 2.0);
}
def code(x, y): return x + (math.fabs((y - x)) / 2.0)
function code(x, y) return Float64(x + Float64(abs(Float64(y - x)) / 2.0)) end
function tmp = code(x, y) tmp = x + (abs((y - x)) / 2.0); end
code[x_, y_] := N[(x + N[(N[Abs[N[(y - x), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left|y - x\right|}{2}
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (- y x) 0.5)))
(if (<= x -1e-32)
(* 0.5 (+ x y))
(if (or (<= x 9.5e-90) (not (<= x 5.9e+147)))
(* (fabs (- y x)) 0.5)
(/ (- (* t_0 t_0) (* x x)) (+ (* y -0.5) (* x -0.5)))))))
double code(double x, double y) {
double t_0 = (y - x) * 0.5;
double tmp;
if (x <= -1e-32) {
tmp = 0.5 * (x + y);
} else if ((x <= 9.5e-90) || !(x <= 5.9e+147)) {
tmp = fabs((y - x)) * 0.5;
} else {
tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5));
}
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 = (y - x) * 0.5d0
if (x <= (-1d-32)) then
tmp = 0.5d0 * (x + y)
else if ((x <= 9.5d-90) .or. (.not. (x <= 5.9d+147))) then
tmp = abs((y - x)) * 0.5d0
else
tmp = ((t_0 * t_0) - (x * x)) / ((y * (-0.5d0)) + (x * (-0.5d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y - x) * 0.5;
double tmp;
if (x <= -1e-32) {
tmp = 0.5 * (x + y);
} else if ((x <= 9.5e-90) || !(x <= 5.9e+147)) {
tmp = Math.abs((y - x)) * 0.5;
} else {
tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5));
}
return tmp;
}
def code(x, y): t_0 = (y - x) * 0.5 tmp = 0 if x <= -1e-32: tmp = 0.5 * (x + y) elif (x <= 9.5e-90) or not (x <= 5.9e+147): tmp = math.fabs((y - x)) * 0.5 else: tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5)) return tmp
function code(x, y) t_0 = Float64(Float64(y - x) * 0.5) tmp = 0.0 if (x <= -1e-32) tmp = Float64(0.5 * Float64(x + y)); elseif ((x <= 9.5e-90) || !(x <= 5.9e+147)) tmp = Float64(abs(Float64(y - x)) * 0.5); else tmp = Float64(Float64(Float64(t_0 * t_0) - Float64(x * x)) / Float64(Float64(y * -0.5) + Float64(x * -0.5))); end return tmp end
function tmp_2 = code(x, y) t_0 = (y - x) * 0.5; tmp = 0.0; if (x <= -1e-32) tmp = 0.5 * (x + y); elseif ((x <= 9.5e-90) || ~((x <= 5.9e+147))) tmp = abs((y - x)) * 0.5; else tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y - x), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[x, -1e-32], N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 9.5e-90], N[Not[LessEqual[x, 5.9e+147]], $MachinePrecision]], N[(N[Abs[N[(y - x), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(N[(y * -0.5), $MachinePrecision] + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - x\right) \cdot 0.5\\
\mathbf{if}\;x \leq -1 \cdot 10^{-32}:\\
\;\;\;\;0.5 \cdot \left(x + y\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-90} \lor \neg \left(x \leq 5.9 \cdot 10^{+147}\right):\\
\;\;\;\;\left|y - x\right| \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0 \cdot t_0 - x \cdot x}{y \cdot -0.5 + x \cdot -0.5}\\
\end{array}
\end{array}
if x < -1.00000000000000006e-32Initial program 100.0%
+-commutative100.0%
div-inv100.0%
fma-def100.0%
add-sqr-sqrt88.4%
fabs-sqr88.4%
add-sqr-sqrt89.1%
metadata-eval89.1%
Applied egg-rr89.1%
Taylor expanded in y around 0 89.1%
+-commutative89.1%
associate-+r+89.1%
distribute-lft1-in89.1%
metadata-eval89.1%
distribute-lft-out89.1%
Simplified89.1%
if -1.00000000000000006e-32 < x < 9.5000000000000003e-90 or 5.9000000000000001e147 < x Initial program 99.9%
Taylor expanded in x around 0 66.8%
if 9.5000000000000003e-90 < x < 5.9000000000000001e147Initial program 99.9%
+-commutative99.9%
div-inv99.9%
fma-def99.9%
add-sqr-sqrt15.1%
fabs-sqr15.1%
add-sqr-sqrt26.9%
metadata-eval26.9%
Applied egg-rr26.9%
fma-udef26.9%
flip-+17.6%
Applied egg-rr17.6%
add-sqr-sqrt6.0%
sqrt-prod76.6%
associate-*r*76.6%
sqrt-prod76.2%
fma-neg76.2%
*-commutative76.2%
associate-*l*76.2%
pow276.2%
Applied egg-rr76.2%
Taylor expanded in y around -inf 71.2%
sub-neg71.2%
+-commutative71.2%
associate-+l+71.2%
*-commutative71.2%
*-commutative71.2%
unpow271.2%
rem-square-sqrt71.4%
associate-*l*71.4%
metadata-eval71.4%
unpow271.4%
rem-square-sqrt72.3%
neg-mul-172.3%
distribute-rgt-out72.3%
metadata-eval72.3%
Simplified72.3%
Final simplification74.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (- y x) 0.5)))
(if (<= y -3.3e+127)
(* (/ y 0.5) -0.25)
(if (<= y -1e-124)
(/ (- (* t_0 t_0) (* x x)) (+ (* y -0.5) (* x -0.5)))
(* 0.5 (+ x y))))))
double code(double x, double y) {
double t_0 = (y - x) * 0.5;
double tmp;
if (y <= -3.3e+127) {
tmp = (y / 0.5) * -0.25;
} else if (y <= -1e-124) {
tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5));
} else {
tmp = 0.5 * (x + 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 = (y - x) * 0.5d0
if (y <= (-3.3d+127)) then
tmp = (y / 0.5d0) * (-0.25d0)
else if (y <= (-1d-124)) then
tmp = ((t_0 * t_0) - (x * x)) / ((y * (-0.5d0)) + (x * (-0.5d0)))
else
tmp = 0.5d0 * (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y - x) * 0.5;
double tmp;
if (y <= -3.3e+127) {
tmp = (y / 0.5) * -0.25;
} else if (y <= -1e-124) {
tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5));
} else {
tmp = 0.5 * (x + y);
}
return tmp;
}
def code(x, y): t_0 = (y - x) * 0.5 tmp = 0 if y <= -3.3e+127: tmp = (y / 0.5) * -0.25 elif y <= -1e-124: tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5)) else: tmp = 0.5 * (x + y) return tmp
function code(x, y) t_0 = Float64(Float64(y - x) * 0.5) tmp = 0.0 if (y <= -3.3e+127) tmp = Float64(Float64(y / 0.5) * -0.25); elseif (y <= -1e-124) tmp = Float64(Float64(Float64(t_0 * t_0) - Float64(x * x)) / Float64(Float64(y * -0.5) + Float64(x * -0.5))); else tmp = Float64(0.5 * Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) t_0 = (y - x) * 0.5; tmp = 0.0; if (y <= -3.3e+127) tmp = (y / 0.5) * -0.25; elseif (y <= -1e-124) tmp = ((t_0 * t_0) - (x * x)) / ((y * -0.5) + (x * -0.5)); else tmp = 0.5 * (x + y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y - x), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[y, -3.3e+127], N[(N[(y / 0.5), $MachinePrecision] * -0.25), $MachinePrecision], If[LessEqual[y, -1e-124], N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(N[(y * -0.5), $MachinePrecision] + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - x\right) \cdot 0.5\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{+127}:\\
\;\;\;\;\frac{y}{0.5} \cdot -0.25\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-124}:\\
\;\;\;\;\frac{t_0 \cdot t_0 - x \cdot x}{y \cdot -0.5 + x \cdot -0.5}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x + y\right)\\
\end{array}
\end{array}
if y < -3.29999999999999977e127Initial program 100.0%
+-commutative100.0%
div-inv100.0%
fma-def100.0%
add-sqr-sqrt5.2%
fabs-sqr5.2%
add-sqr-sqrt7.0%
metadata-eval7.0%
Applied egg-rr7.0%
fma-udef7.0%
flip-+0.2%
Applied egg-rr0.2%
add-sqr-sqrt0.0%
sqrt-prod10.5%
associate-*r*10.5%
sqrt-prod10.4%
fma-neg10.4%
*-commutative10.4%
associate-*l*10.4%
pow210.4%
Applied egg-rr10.4%
Taylor expanded in y around -inf 85.0%
*-commutative85.0%
unpow285.0%
rem-square-sqrt86.7%
Simplified86.7%
if -3.29999999999999977e127 < y < -9.99999999999999933e-125Initial program 99.9%
+-commutative99.9%
div-inv99.9%
fma-def99.9%
add-sqr-sqrt20.2%
fabs-sqr20.2%
add-sqr-sqrt26.1%
metadata-eval26.1%
Applied egg-rr26.1%
fma-udef26.1%
flip-+11.9%
Applied egg-rr11.9%
add-sqr-sqrt9.2%
sqrt-prod72.0%
associate-*r*72.0%
sqrt-prod71.7%
fma-neg71.7%
*-commutative71.7%
associate-*l*71.7%
pow271.7%
Applied egg-rr71.7%
Taylor expanded in y around -inf 63.5%
sub-neg63.5%
+-commutative63.5%
associate-+l+63.5%
*-commutative63.5%
*-commutative63.5%
unpow263.5%
rem-square-sqrt64.3%
associate-*l*64.3%
metadata-eval64.3%
unpow264.3%
rem-square-sqrt64.5%
neg-mul-164.5%
distribute-rgt-out64.5%
metadata-eval64.5%
Simplified64.5%
if -9.99999999999999933e-125 < y Initial program 99.9%
+-commutative99.9%
div-inv99.9%
fma-def99.9%
add-sqr-sqrt63.5%
fabs-sqr63.5%
add-sqr-sqrt70.1%
metadata-eval70.1%
Applied egg-rr70.1%
Taylor expanded in y around 0 70.0%
+-commutative70.0%
associate-+r+70.1%
distribute-lft1-in70.1%
metadata-eval70.1%
distribute-lft-out70.1%
Simplified70.1%
Final simplification71.4%
(FPCore (x y) :precision binary64 (if (<= y -1.4e-109) (* (/ y 0.5) -0.25) (* 0.5 (+ x y))))
double code(double x, double y) {
double tmp;
if (y <= -1.4e-109) {
tmp = (y / 0.5) * -0.25;
} else {
tmp = 0.5 * (x + 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.4d-109)) then
tmp = (y / 0.5d0) * (-0.25d0)
else
tmp = 0.5d0 * (x + y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.4e-109) {
tmp = (y / 0.5) * -0.25;
} else {
tmp = 0.5 * (x + y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.4e-109: tmp = (y / 0.5) * -0.25 else: tmp = 0.5 * (x + y) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.4e-109) tmp = Float64(Float64(y / 0.5) * -0.25); else tmp = Float64(0.5 * Float64(x + y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.4e-109) tmp = (y / 0.5) * -0.25; else tmp = 0.5 * (x + y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.4e-109], N[(N[(y / 0.5), $MachinePrecision] * -0.25), $MachinePrecision], N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-109}:\\
\;\;\;\;\frac{y}{0.5} \cdot -0.25\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x + y\right)\\
\end{array}
\end{array}
if y < -1.39999999999999989e-109Initial program 99.9%
+-commutative99.9%
div-inv99.9%
fma-def99.9%
add-sqr-sqrt14.2%
fabs-sqr14.2%
add-sqr-sqrt18.2%
metadata-eval18.2%
Applied egg-rr18.2%
fma-udef18.2%
flip-+7.0%
Applied egg-rr7.0%
add-sqr-sqrt5.4%
sqrt-prod46.0%
associate-*r*46.0%
sqrt-prod45.8%
fma-neg45.8%
*-commutative45.8%
associate-*l*45.8%
pow245.8%
Applied egg-rr45.8%
Taylor expanded in y around -inf 66.6%
*-commutative66.6%
unpow266.6%
rem-square-sqrt67.8%
Simplified67.8%
if -1.39999999999999989e-109 < y Initial program 99.9%
+-commutative99.9%
div-inv99.9%
fma-def99.9%
add-sqr-sqrt63.1%
fabs-sqr63.1%
add-sqr-sqrt69.8%
metadata-eval69.8%
Applied egg-rr69.8%
Taylor expanded in y around 0 69.7%
+-commutative69.7%
associate-+r+69.8%
distribute-lft1-in69.8%
metadata-eval69.8%
distribute-lft-out69.8%
Simplified69.8%
Final simplification69.1%
(FPCore (x y) :precision binary64 (if (<= y 2e-166) x (* y 0.5)))
double code(double x, double y) {
double tmp;
if (y <= 2e-166) {
tmp = x;
} else {
tmp = y * 0.5;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2d-166) then
tmp = x
else
tmp = y * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2e-166) {
tmp = x;
} else {
tmp = y * 0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2e-166: tmp = x else: tmp = y * 0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= 2e-166) tmp = x; else tmp = Float64(y * 0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2e-166) tmp = x; else tmp = y * 0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2e-166], x, N[(y * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2 \cdot 10^{-166}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\
\end{array}
\end{array}
if y < 2.00000000000000008e-166Initial program 99.9%
Taylor expanded in x around inf 12.8%
if 2.00000000000000008e-166 < y Initial program 100.0%
+-commutative100.0%
div-inv100.0%
fma-def100.0%
add-sqr-sqrt76.6%
fabs-sqr76.6%
add-sqr-sqrt81.3%
metadata-eval81.3%
Applied egg-rr81.3%
Taylor expanded in y around inf 58.4%
Final simplification30.1%
(FPCore (x y) :precision binary64 (if (<= y 1.45e-71) (* x 0.5) (* y 0.5)))
double code(double x, double y) {
double tmp;
if (y <= 1.45e-71) {
tmp = x * 0.5;
} else {
tmp = y * 0.5;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 1.45d-71) then
tmp = x * 0.5d0
else
tmp = y * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.45e-71) {
tmp = x * 0.5;
} else {
tmp = y * 0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.45e-71: tmp = x * 0.5 else: tmp = y * 0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= 1.45e-71) tmp = Float64(x * 0.5); else tmp = Float64(y * 0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.45e-71) tmp = x * 0.5; else tmp = y * 0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.45e-71], N[(x * 0.5), $MachinePrecision], N[(y * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.45 \cdot 10^{-71}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\
\end{array}
\end{array}
if y < 1.4499999999999999e-71Initial program 99.9%
+-commutative99.9%
div-inv99.9%
fma-def99.9%
add-sqr-sqrt29.1%
fabs-sqr29.1%
add-sqr-sqrt35.8%
metadata-eval35.8%
Applied egg-rr35.8%
Taylor expanded in y around 0 34.0%
distribute-lft1-in34.0%
metadata-eval34.0%
*-commutative34.0%
Simplified34.0%
if 1.4499999999999999e-71 < y Initial program 100.0%
+-commutative100.0%
div-inv100.0%
fma-def100.0%
add-sqr-sqrt82.8%
fabs-sqr82.8%
add-sqr-sqrt86.5%
metadata-eval86.5%
Applied egg-rr86.5%
Taylor expanded in y around inf 66.1%
Final simplification43.9%
(FPCore (x y) :precision binary64 (* 0.5 (+ x y)))
double code(double x, double y) {
return 0.5 * (x + y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 0.5d0 * (x + y)
end function
public static double code(double x, double y) {
return 0.5 * (x + y);
}
def code(x, y): return 0.5 * (x + y)
function code(x, y) return Float64(0.5 * Float64(x + y)) end
function tmp = code(x, y) tmp = 0.5 * (x + y); end
code[x_, y_] := N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \left(x + y\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
div-inv99.9%
fma-def99.9%
add-sqr-sqrt45.7%
fabs-sqr45.7%
add-sqr-sqrt51.4%
metadata-eval51.4%
Applied egg-rr51.4%
Taylor expanded in y around 0 51.4%
+-commutative51.4%
associate-+r+51.4%
distribute-lft1-in51.4%
metadata-eval51.4%
distribute-lft-out51.4%
Simplified51.4%
Final simplification51.4%
(FPCore (x y) :precision binary64 x)
double code(double x, double y) {
return x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x
end function
public static double code(double x, double y) {
return x;
}
def code(x, y): return x
function code(x, y) return x end
function tmp = code(x, y) tmp = x; end
code[x_, y_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
Taylor expanded in x around inf 11.7%
Final simplification11.7%
herbie shell --seed 2023230
(FPCore (x y)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
:precision binary64
(+ x (/ (fabs (- y x)) 2.0)))