sqrt E (should all be same)

Percentage Accurate: 53.7% → 99.3%
Time: 1.6s
Alternatives: 3
Speedup: 13.5×

Specification

?
\[\begin{array}{l} \\ \sqrt{{x}^{2} + {x}^{2}} \end{array} \]
(FPCore (x) :precision binary64 (sqrt (+ (pow x 2.0) (pow x 2.0))))
double code(double x) {
	return sqrt((pow(x, 2.0) + pow(x, 2.0)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x)
use fmin_fmax_functions
    real(8), intent (in) :: x
    code = sqrt(((x ** 2.0d0) + (x ** 2.0d0)))
end function
public static double code(double x) {
	return Math.sqrt((Math.pow(x, 2.0) + Math.pow(x, 2.0)));
}
def code(x):
	return math.sqrt((math.pow(x, 2.0) + math.pow(x, 2.0)))
function code(x)
	return sqrt(Float64((x ^ 2.0) + (x ^ 2.0)))
end
function tmp = code(x)
	tmp = sqrt(((x ^ 2.0) + (x ^ 2.0)));
end
code[x_] := N[Sqrt[N[(N[Power[x, 2.0], $MachinePrecision] + N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{{x}^{2} + {x}^{2}}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 3 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 53.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \sqrt{{x}^{2} + {x}^{2}} \end{array} \]
(FPCore (x) :precision binary64 (sqrt (+ (pow x 2.0) (pow x 2.0))))
double code(double x) {
	return sqrt((pow(x, 2.0) + pow(x, 2.0)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x)
use fmin_fmax_functions
    real(8), intent (in) :: x
    code = sqrt(((x ** 2.0d0) + (x ** 2.0d0)))
end function
public static double code(double x) {
	return Math.sqrt((Math.pow(x, 2.0) + Math.pow(x, 2.0)));
}
def code(x):
	return math.sqrt((math.pow(x, 2.0) + math.pow(x, 2.0)))
function code(x)
	return sqrt(Float64((x ^ 2.0) + (x ^ 2.0)))
end
function tmp = code(x)
	tmp = sqrt(((x ^ 2.0) + (x ^ 2.0)));
end
code[x_] := N[Sqrt[N[(N[Power[x, 2.0], $MachinePrecision] + N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{{x}^{2} + {x}^{2}}
\end{array}

Alternative 1: 99.3% accurate, 8.6× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ \frac{x\_m + x\_m}{\sqrt{2}} \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m) :precision binary64 (/ (+ x_m x_m) (sqrt 2.0)))
x_m = fabs(x);
double code(double x_m) {
	return (x_m + x_m) / sqrt(2.0);
}
x_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x_m)
use fmin_fmax_functions
    real(8), intent (in) :: x_m
    code = (x_m + x_m) / sqrt(2.0d0)
end function
x_m = Math.abs(x);
public static double code(double x_m) {
	return (x_m + x_m) / Math.sqrt(2.0);
}
x_m = math.fabs(x)
def code(x_m):
	return (x_m + x_m) / math.sqrt(2.0)
x_m = abs(x)
function code(x_m)
	return Float64(Float64(x_m + x_m) / sqrt(2.0))
end
x_m = abs(x);
function tmp = code(x_m)
	tmp = (x_m + x_m) / sqrt(2.0);
end
x_m = N[Abs[x], $MachinePrecision]
code[x$95$m_] := N[(N[(x$95$m + x$95$m), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|

\\
\frac{x\_m + x\_m}{\sqrt{2}}
\end{array}
Derivation
  1. Initial program 50.0%

    \[\sqrt{{x}^{2} + {x}^{2}} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0

    \[\leadsto \color{blue}{x \cdot \sqrt{2}} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \sqrt{2} \cdot \color{blue}{x} \]
    2. lower-*.f64N/A

      \[\leadsto \sqrt{2} \cdot \color{blue}{x} \]
    3. lower-sqrt.f6452.4

      \[\leadsto \sqrt{2} \cdot x \]
  5. Applied rewrites52.4%

    \[\leadsto \color{blue}{\sqrt{2} \cdot x} \]
  6. Step-by-step derivation
    1. lift-sqrt.f64N/A

      \[\leadsto \sqrt{2} \cdot x \]
    2. metadata-evalN/A

      \[\leadsto \sqrt{\frac{4}{2}} \cdot x \]
    3. sqrt-divN/A

      \[\leadsto \frac{\sqrt{4}}{\sqrt{2}} \cdot x \]
    4. metadata-evalN/A

      \[\leadsto \frac{2}{\sqrt{2}} \cdot x \]
    5. lower-/.f64N/A

      \[\leadsto \frac{2}{\sqrt{2}} \cdot x \]
    6. lift-sqrt.f6452.3

      \[\leadsto \frac{2}{\sqrt{2}} \cdot x \]
  7. Applied rewrites52.3%

    \[\leadsto \frac{2}{\sqrt{2}} \cdot x \]
  8. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{2}{\sqrt{2}} \cdot \color{blue}{x} \]
    2. lift-/.f64N/A

      \[\leadsto \frac{2}{\sqrt{2}} \cdot x \]
    3. lift-sqrt.f64N/A

      \[\leadsto \frac{2}{\sqrt{2}} \cdot x \]
    4. associate-*l/N/A

      \[\leadsto \frac{2 \cdot x}{\color{blue}{\sqrt{2}}} \]
    5. count-2-revN/A

      \[\leadsto \frac{x + x}{\sqrt{\color{blue}{2}}} \]
    6. lower-/.f64N/A

      \[\leadsto \frac{x + x}{\color{blue}{\sqrt{2}}} \]
    7. count-2-revN/A

      \[\leadsto \frac{2 \cdot x}{\sqrt{\color{blue}{2}}} \]
    8. lower-*.f64N/A

      \[\leadsto \frac{2 \cdot x}{\sqrt{\color{blue}{2}}} \]
    9. lift-sqrt.f6452.4

      \[\leadsto \frac{2 \cdot x}{\sqrt{2}} \]
  9. Applied rewrites52.4%

    \[\leadsto \frac{2 \cdot x}{\color{blue}{\sqrt{2}}} \]
  10. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{2 \cdot x}{\sqrt{\color{blue}{2}}} \]
    2. count-2-revN/A

      \[\leadsto \frac{x + x}{\sqrt{\color{blue}{2}}} \]
    3. lower-+.f6452.4

      \[\leadsto \frac{x + x}{\sqrt{\color{blue}{2}}} \]
  11. Applied rewrites52.4%

    \[\leadsto \frac{x + x}{\sqrt{\color{blue}{2}}} \]
  12. Add Preprocessing

Alternative 2: 99.3% accurate, 13.5× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ \sqrt{2} \cdot x\_m \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m) :precision binary64 (* (sqrt 2.0) x_m))
x_m = fabs(x);
double code(double x_m) {
	return sqrt(2.0) * x_m;
}
x_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x_m)
use fmin_fmax_functions
    real(8), intent (in) :: x_m
    code = sqrt(2.0d0) * x_m
end function
x_m = Math.abs(x);
public static double code(double x_m) {
	return Math.sqrt(2.0) * x_m;
}
x_m = math.fabs(x)
def code(x_m):
	return math.sqrt(2.0) * x_m
x_m = abs(x)
function code(x_m)
	return Float64(sqrt(2.0) * x_m)
end
x_m = abs(x);
function tmp = code(x_m)
	tmp = sqrt(2.0) * x_m;
end
x_m = N[Abs[x], $MachinePrecision]
code[x$95$m_] := N[(N[Sqrt[2.0], $MachinePrecision] * x$95$m), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|

\\
\sqrt{2} \cdot x\_m
\end{array}
Derivation
  1. Initial program 50.0%

    \[\sqrt{{x}^{2} + {x}^{2}} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0

    \[\leadsto \color{blue}{x \cdot \sqrt{2}} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \sqrt{2} \cdot \color{blue}{x} \]
    2. lower-*.f64N/A

      \[\leadsto \sqrt{2} \cdot \color{blue}{x} \]
    3. lower-sqrt.f6452.4

      \[\leadsto \sqrt{2} \cdot x \]
  5. Applied rewrites52.4%

    \[\leadsto \color{blue}{\sqrt{2} \cdot x} \]
  6. Add Preprocessing

Alternative 3: 5.4% accurate, 19.6× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ \sqrt{2} \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m) :precision binary64 (sqrt 2.0))
x_m = fabs(x);
double code(double x_m) {
	return sqrt(2.0);
}
x_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x_m)
use fmin_fmax_functions
    real(8), intent (in) :: x_m
    code = sqrt(2.0d0)
end function
x_m = Math.abs(x);
public static double code(double x_m) {
	return Math.sqrt(2.0);
}
x_m = math.fabs(x)
def code(x_m):
	return math.sqrt(2.0)
x_m = abs(x)
function code(x_m)
	return sqrt(2.0)
end
x_m = abs(x);
function tmp = code(x_m)
	tmp = sqrt(2.0);
end
x_m = N[Abs[x], $MachinePrecision]
code[x$95$m_] := N[Sqrt[2.0], $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|

\\
\sqrt{2}
\end{array}
Derivation
  1. Initial program 50.0%

    \[\sqrt{{x}^{2} + {x}^{2}} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0

    \[\leadsto \sqrt{\color{blue}{2 \cdot {x}^{2}}} \]
  4. Step-by-step derivation
    1. count-2-revN/A

      \[\leadsto \sqrt{{x}^{2} + \color{blue}{{x}^{2}}} \]
    2. flip-+N/A

      \[\leadsto \sqrt{\frac{{x}^{2} \cdot {x}^{2} - {x}^{2} \cdot {x}^{2}}{\color{blue}{{x}^{2} - {x}^{2}}}} \]
    3. +-inversesN/A

      \[\leadsto \sqrt{\frac{0}{\color{blue}{{x}^{2}} - {x}^{2}}} \]
    4. metadata-evalN/A

      \[\leadsto \sqrt{\frac{1 - 1}{\color{blue}{{x}^{2}} - {x}^{2}}} \]
    5. metadata-evalN/A

      \[\leadsto \sqrt{\frac{1 \cdot 1 - 1}{{\color{blue}{x}}^{2} - {x}^{2}}} \]
    6. metadata-evalN/A

      \[\leadsto \sqrt{\frac{\frac{2}{2} \cdot 1 - 1}{{x}^{2} - {x}^{2}}} \]
    7. metadata-evalN/A

      \[\leadsto \sqrt{\frac{\frac{2}{2} \cdot \frac{2}{2} - 1}{{x}^{2} - {x}^{2}}} \]
    8. metadata-evalN/A

      \[\leadsto \sqrt{\frac{\frac{2}{2} \cdot \frac{2}{2} - 1 \cdot 1}{{x}^{\color{blue}{2}} - {x}^{2}}} \]
    9. metadata-evalN/A

      \[\leadsto \sqrt{\frac{\frac{2}{2} \cdot \frac{2}{2} - \frac{2}{2} \cdot 1}{{x}^{2} - {x}^{2}}} \]
    10. metadata-evalN/A

      \[\leadsto \sqrt{\frac{\frac{2}{2} \cdot \frac{2}{2} - \frac{2}{2} \cdot \frac{2}{2}}{{x}^{2} - {x}^{2}}} \]
    11. +-inversesN/A

      \[\leadsto \sqrt{\frac{\frac{2}{2} \cdot \frac{2}{2} - \frac{2}{2} \cdot \frac{2}{2}}{0}} \]
    12. metadata-evalN/A

      \[\leadsto \sqrt{\frac{\frac{2}{2} \cdot \frac{2}{2} - \frac{2}{2} \cdot \frac{2}{2}}{1 - \color{blue}{1}}} \]
    13. metadata-evalN/A

      \[\leadsto \sqrt{\frac{\frac{2}{2} \cdot \frac{2}{2} - \frac{2}{2} \cdot \frac{2}{2}}{\frac{2}{2} - 1}} \]
    14. metadata-evalN/A

      \[\leadsto \sqrt{\frac{\frac{2}{2} \cdot \frac{2}{2} - \frac{2}{2} \cdot \frac{2}{2}}{\frac{2}{2} - \frac{2}{\color{blue}{2}}}} \]
    15. flip-+N/A

      \[\leadsto \sqrt{\frac{2}{2} + \color{blue}{\frac{2}{2}}} \]
    16. metadata-evalN/A

      \[\leadsto \sqrt{1 + \frac{\color{blue}{2}}{2}} \]
    17. metadata-evalN/A

      \[\leadsto \sqrt{1 + 1} \]
    18. metadata-eval5.4

      \[\leadsto \sqrt{2} \]
  5. Applied rewrites5.4%

    \[\leadsto \sqrt{\color{blue}{2}} \]
  6. Add Preprocessing

Reproduce

?
herbie shell --seed 2025044 
(FPCore (x)
  :name "sqrt E (should all be same)"
  :precision binary64
  (sqrt (+ (pow x 2.0) (pow x 2.0))))