Given's Rotation SVD example, simplified

Percentage Accurate: 75.4% → 99.9%
Time: 4.1s
Alternatives: 9
Speedup: 2.1×

Specification

?
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
(FPCore (x)
  :precision binary64
  :pre TRUE
  (- 1.0 (sqrt (* 0.5 (+ 1.0 (/ 1.0 (hypot 1.0 x)))))))
double code(double x) {
	return 1.0 - sqrt((0.5 * (1.0 + (1.0 / hypot(1.0, x)))));
}
public static double code(double x) {
	return 1.0 - Math.sqrt((0.5 * (1.0 + (1.0 / Math.hypot(1.0, x)))));
}
def code(x):
	return 1.0 - math.sqrt((0.5 * (1.0 + (1.0 / math.hypot(1.0, x)))))
function code(x)
	return Float64(1.0 - sqrt(Float64(0.5 * Float64(1.0 + Float64(1.0 / hypot(1.0, x))))))
end
function tmp = code(x)
	tmp = 1.0 - sqrt((0.5 * (1.0 + (1.0 / hypot(1.0, x)))));
end
code[x_] := N[(1.0 - N[Sqrt[N[(0.5 * N[(1.0 + N[(1.0 / N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
f(x):
	x in [-inf, +inf]
code: THEORY
BEGIN
f(x: real): real =
	(1) - (sqrt(((5e-1) * ((1) + ((1) / (sqrt((((1) ^ (2)) + (x ^ (2))))))))))
END code
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}

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 9 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: 75.4% accurate, 1.0× speedup?

\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
(FPCore (x)
  :precision binary64
  :pre TRUE
  (- 1.0 (sqrt (* 0.5 (+ 1.0 (/ 1.0 (hypot 1.0 x)))))))
double code(double x) {
	return 1.0 - sqrt((0.5 * (1.0 + (1.0 / hypot(1.0, x)))));
}
public static double code(double x) {
	return 1.0 - Math.sqrt((0.5 * (1.0 + (1.0 / Math.hypot(1.0, x)))));
}
def code(x):
	return 1.0 - math.sqrt((0.5 * (1.0 + (1.0 / math.hypot(1.0, x)))))
function code(x)
	return Float64(1.0 - sqrt(Float64(0.5 * Float64(1.0 + Float64(1.0 / hypot(1.0, x))))))
end
function tmp = code(x)
	tmp = 1.0 - sqrt((0.5 * (1.0 + (1.0 / hypot(1.0, x)))));
end
code[x_] := N[(1.0 - N[Sqrt[N[(0.5 * N[(1.0 + N[(1.0 / N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
f(x):
	x in [-inf, +inf]
code: THEORY
BEGIN
f(x: real): real =
	(1) - (sqrt(((5e-1) * ((1) + ((1) / (sqrt((((1) ^ (2)) + (x ^ (2))))))))))
END code
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}

Alternative 1: 99.9% accurate, 0.6× speedup?

\[\begin{array}{l} t_0 := \frac{0.5}{\sqrt{\mathsf{fma}\left(\left|x\right|, \left|x\right|, 1\right)}}\\ t_1 := {\left(\left|x\right|\right)}^{2}\\ \mathbf{if}\;\left|x\right| \leq 0.0018:\\ \;\;\;\;t\_1 \cdot \left(0.125 + -0.0859375 \cdot t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sqrt{t\_0 - -0.5} - -1} \cdot \left(t\_0 - 0.5\right)\\ \end{array} \]
(FPCore (x)
  :precision binary64
  :pre TRUE
  (let* ((t_0 (/ 0.5 (sqrt (fma (fabs x) (fabs x) 1.0))))
       (t_1 (pow (fabs x) 2.0)))
  (if (<= (fabs x) 0.0018)
    (* t_1 (+ 0.125 (* -0.0859375 t_1)))
    (* (/ -1.0 (- (sqrt (- t_0 -0.5)) -1.0)) (- t_0 0.5)))))
double code(double x) {
	double t_0 = 0.5 / sqrt(fma(fabs(x), fabs(x), 1.0));
	double t_1 = pow(fabs(x), 2.0);
	double tmp;
	if (fabs(x) <= 0.0018) {
		tmp = t_1 * (0.125 + (-0.0859375 * t_1));
	} else {
		tmp = (-1.0 / (sqrt((t_0 - -0.5)) - -1.0)) * (t_0 - 0.5);
	}
	return tmp;
}
function code(x)
	t_0 = Float64(0.5 / sqrt(fma(abs(x), abs(x), 1.0)))
	t_1 = abs(x) ^ 2.0
	tmp = 0.0
	if (abs(x) <= 0.0018)
		tmp = Float64(t_1 * Float64(0.125 + Float64(-0.0859375 * t_1)));
	else
		tmp = Float64(Float64(-1.0 / Float64(sqrt(Float64(t_0 - -0.5)) - -1.0)) * Float64(t_0 - 0.5));
	end
	return tmp
end
code[x_] := Block[{t$95$0 = N[(0.5 / N[Sqrt[N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Abs[x], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 0.0018], N[(t$95$1 * N[(0.125 + N[(-0.0859375 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(N[Sqrt[N[(t$95$0 - -0.5), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 - 0.5), $MachinePrecision]), $MachinePrecision]]]]
f(x):
	x in [-inf, +inf]
code: THEORY
BEGIN
f(x: real): real =
	LET t_0 = ((5e-1) / (sqrt((((abs(x)) * (abs(x))) + (1))))) IN
		LET t_1 = ((abs(x)) ^ (2)) IN
			LET tmp = IF ((abs(x)) <= (17999999999999999507338532822586785187013447284698486328125e-61)) THEN (t_1 * ((125e-3) + ((-859375e-7) * t_1))) ELSE (((-1) / ((sqrt((t_0 - (-5e-1)))) - (-1))) * (t_0 - (5e-1))) ENDIF IN
	tmp
END code
\begin{array}{l}
t_0 := \frac{0.5}{\sqrt{\mathsf{fma}\left(\left|x\right|, \left|x\right|, 1\right)}}\\
t_1 := {\left(\left|x\right|\right)}^{2}\\
\mathbf{if}\;\left|x\right| \leq 0.0018:\\
\;\;\;\;t\_1 \cdot \left(0.125 + -0.0859375 \cdot t\_1\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sqrt{t\_0 - -0.5} - -1} \cdot \left(t\_0 - 0.5\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 0.0018

    1. Initial program 75.4%

      \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
    2. Taylor expanded in x around 0

      \[\leadsto {x}^{2} \cdot \left(\frac{1}{8} + \frac{-11}{128} \cdot {x}^{2}\right) \]
    3. Step-by-step derivation
      1. Applied rewrites49.9%

        \[\leadsto {x}^{2} \cdot \left(0.125 + -0.0859375 \cdot {x}^{2}\right) \]

      if 0.0018 < x

      1. Initial program 75.4%

        \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
      2. Step-by-step derivation
        1. Applied rewrites76.2%

          \[\leadsto \frac{1 - \left(\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5\right)}{1 + \sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5}} \]
        2. Step-by-step derivation
          1. Applied rewrites76.2%

            \[\leadsto \frac{-1}{\sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5} - -1} \cdot \left(\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - 0.5\right) \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 2: 99.4% accurate, 0.6× speedup?

        \[\begin{array}{l} t_0 := \frac{0.5}{\sqrt{\mathsf{fma}\left(\left|x\right|, \left|x\right|, 1\right)}}\\ \mathbf{if}\;\left|x\right| \leq 1.2:\\ \;\;\;\;\left(\left|x\right| \cdot \left|x\right|\right) \cdot 0.125\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sqrt{t\_0 - -0.5} - -1} \cdot \left(t\_0 - 0.5\right)\\ \end{array} \]
        (FPCore (x)
          :precision binary64
          :pre TRUE
          (let* ((t_0 (/ 0.5 (sqrt (fma (fabs x) (fabs x) 1.0)))))
          (if (<= (fabs x) 1.2)
            (* (* (fabs x) (fabs x)) 0.125)
            (* (/ -1.0 (- (sqrt (- t_0 -0.5)) -1.0)) (- t_0 0.5)))))
        double code(double x) {
        	double t_0 = 0.5 / sqrt(fma(fabs(x), fabs(x), 1.0));
        	double tmp;
        	if (fabs(x) <= 1.2) {
        		tmp = (fabs(x) * fabs(x)) * 0.125;
        	} else {
        		tmp = (-1.0 / (sqrt((t_0 - -0.5)) - -1.0)) * (t_0 - 0.5);
        	}
        	return tmp;
        }
        
        function code(x)
        	t_0 = Float64(0.5 / sqrt(fma(abs(x), abs(x), 1.0)))
        	tmp = 0.0
        	if (abs(x) <= 1.2)
        		tmp = Float64(Float64(abs(x) * abs(x)) * 0.125);
        	else
        		tmp = Float64(Float64(-1.0 / Float64(sqrt(Float64(t_0 - -0.5)) - -1.0)) * Float64(t_0 - 0.5));
        	end
        	return tmp
        end
        
        code[x_] := Block[{t$95$0 = N[(0.5 / N[Sqrt[N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 1.2], N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision], N[(N[(-1.0 / N[(N[Sqrt[N[(t$95$0 - -0.5), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 - 0.5), $MachinePrecision]), $MachinePrecision]]]
        
        f(x):
        	x in [-inf, +inf]
        code: THEORY
        BEGIN
        f(x: real): real =
        	LET t_0 = ((5e-1) / (sqrt((((abs(x)) * (abs(x))) + (1))))) IN
        		LET tmp = IF ((abs(x)) <= (11999999999999999555910790149937383830547332763671875e-52)) THEN (((abs(x)) * (abs(x))) * (125e-3)) ELSE (((-1) / ((sqrt((t_0 - (-5e-1)))) - (-1))) * (t_0 - (5e-1))) ENDIF IN
        	tmp
        END code
        \begin{array}{l}
        t_0 := \frac{0.5}{\sqrt{\mathsf{fma}\left(\left|x\right|, \left|x\right|, 1\right)}}\\
        \mathbf{if}\;\left|x\right| \leq 1.2:\\
        \;\;\;\;\left(\left|x\right| \cdot \left|x\right|\right) \cdot 0.125\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{-1}{\sqrt{t\_0 - -0.5} - -1} \cdot \left(t\_0 - 0.5\right)\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < 1.2

          1. Initial program 75.4%

            \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
          2. Step-by-step derivation
            1. Applied rewrites76.2%

              \[\leadsto \frac{1 - \left(\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5\right)}{1 + \sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5}} \]
            2. Taylor expanded in x around 0

              \[\leadsto \frac{1}{8} \cdot {x}^{2} \]
            3. Step-by-step derivation
              1. Applied rewrites51.4%

                \[\leadsto 0.125 \cdot {x}^{2} \]
              2. Step-by-step derivation
                1. Applied rewrites51.4%

                  \[\leadsto \left(x \cdot x\right) \cdot 0.125 \]

                if 1.2 < x

                1. Initial program 75.4%

                  \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
                2. Step-by-step derivation
                  1. Applied rewrites76.2%

                    \[\leadsto \frac{1 - \left(\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5\right)}{1 + \sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5}} \]
                  2. Step-by-step derivation
                    1. Applied rewrites76.2%

                      \[\leadsto \frac{-1}{\sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5} - -1} \cdot \left(\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - 0.5\right) \]
                  3. Recombined 2 regimes into one program.
                  4. Add Preprocessing

                  Alternative 3: 99.4% accurate, 0.6× speedup?

                  \[\begin{array}{l} t_0 := \frac{0.5}{\sqrt{\mathsf{fma}\left(\left|x\right|, \left|x\right|, 1\right)}} - -0.5\\ \mathbf{if}\;\left|x\right| \leq 1.2:\\ \;\;\;\;\left(\left|x\right| \cdot \left|x\right|\right) \cdot 0.125\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t\_0}{1 + \sqrt{t\_0}}\\ \end{array} \]
                  (FPCore (x)
                    :precision binary64
                    :pre TRUE
                    (let* ((t_0 (- (/ 0.5 (sqrt (fma (fabs x) (fabs x) 1.0))) -0.5)))
                    (if (<= (fabs x) 1.2)
                      (* (* (fabs x) (fabs x)) 0.125)
                      (/ (- 1.0 t_0) (+ 1.0 (sqrt t_0))))))
                  double code(double x) {
                  	double t_0 = (0.5 / sqrt(fma(fabs(x), fabs(x), 1.0))) - -0.5;
                  	double tmp;
                  	if (fabs(x) <= 1.2) {
                  		tmp = (fabs(x) * fabs(x)) * 0.125;
                  	} else {
                  		tmp = (1.0 - t_0) / (1.0 + sqrt(t_0));
                  	}
                  	return tmp;
                  }
                  
                  function code(x)
                  	t_0 = Float64(Float64(0.5 / sqrt(fma(abs(x), abs(x), 1.0))) - -0.5)
                  	tmp = 0.0
                  	if (abs(x) <= 1.2)
                  		tmp = Float64(Float64(abs(x) * abs(x)) * 0.125);
                  	else
                  		tmp = Float64(Float64(1.0 - t_0) / Float64(1.0 + sqrt(t_0)));
                  	end
                  	return tmp
                  end
                  
                  code[x_] := Block[{t$95$0 = N[(N[(0.5 / N[Sqrt[N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - -0.5), $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 1.2], N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[(1.0 + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                  
                  f(x):
                  	x in [-inf, +inf]
                  code: THEORY
                  BEGIN
                  f(x: real): real =
                  	LET t_0 = (((5e-1) / (sqrt((((abs(x)) * (abs(x))) + (1))))) - (-5e-1)) IN
                  		LET tmp = IF ((abs(x)) <= (11999999999999999555910790149937383830547332763671875e-52)) THEN (((abs(x)) * (abs(x))) * (125e-3)) ELSE (((1) - t_0) / ((1) + (sqrt(t_0)))) ENDIF IN
                  	tmp
                  END code
                  \begin{array}{l}
                  t_0 := \frac{0.5}{\sqrt{\mathsf{fma}\left(\left|x\right|, \left|x\right|, 1\right)}} - -0.5\\
                  \mathbf{if}\;\left|x\right| \leq 1.2:\\
                  \;\;\;\;\left(\left|x\right| \cdot \left|x\right|\right) \cdot 0.125\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{1 - t\_0}{1 + \sqrt{t\_0}}\\
                  
                  
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if x < 1.2

                    1. Initial program 75.4%

                      \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
                    2. Step-by-step derivation
                      1. Applied rewrites76.2%

                        \[\leadsto \frac{1 - \left(\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5\right)}{1 + \sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5}} \]
                      2. Taylor expanded in x around 0

                        \[\leadsto \frac{1}{8} \cdot {x}^{2} \]
                      3. Step-by-step derivation
                        1. Applied rewrites51.4%

                          \[\leadsto 0.125 \cdot {x}^{2} \]
                        2. Step-by-step derivation
                          1. Applied rewrites51.4%

                            \[\leadsto \left(x \cdot x\right) \cdot 0.125 \]

                          if 1.2 < x

                          1. Initial program 75.4%

                            \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
                          2. Step-by-step derivation
                            1. Applied rewrites76.2%

                              \[\leadsto \frac{1 - \left(\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5\right)}{1 + \sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5}} \]
                          3. Recombined 2 regimes into one program.
                          4. Add Preprocessing

                          Alternative 4: 99.1% accurate, 0.9× speedup?

                          \[\begin{array}{l} t_0 := \frac{0.5}{\left|x\right|} - -0.5\\ \mathbf{if}\;\left|x\right| \leq 2.2:\\ \;\;\;\;\left(\left|x\right| \cdot \left|x\right|\right) \cdot 0.125\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t\_0}{1 + \sqrt{t\_0}}\\ \end{array} \]
                          (FPCore (x)
                            :precision binary64
                            :pre TRUE
                            (let* ((t_0 (- (/ 0.5 (fabs x)) -0.5)))
                            (if (<= (fabs x) 2.2)
                              (* (* (fabs x) (fabs x)) 0.125)
                              (/ (- 1.0 t_0) (+ 1.0 (sqrt t_0))))))
                          double code(double x) {
                          	double t_0 = (0.5 / fabs(x)) - -0.5;
                          	double tmp;
                          	if (fabs(x) <= 2.2) {
                          		tmp = (fabs(x) * fabs(x)) * 0.125;
                          	} else {
                          		tmp = (1.0 - t_0) / (1.0 + sqrt(t_0));
                          	}
                          	return tmp;
                          }
                          
                          real(8) function code(x)
                          use fmin_fmax_functions
                              real(8), intent (in) :: x
                              real(8) :: t_0
                              real(8) :: tmp
                              t_0 = (0.5d0 / abs(x)) - (-0.5d0)
                              if (abs(x) <= 2.2d0) then
                                  tmp = (abs(x) * abs(x)) * 0.125d0
                              else
                                  tmp = (1.0d0 - t_0) / (1.0d0 + sqrt(t_0))
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x) {
                          	double t_0 = (0.5 / Math.abs(x)) - -0.5;
                          	double tmp;
                          	if (Math.abs(x) <= 2.2) {
                          		tmp = (Math.abs(x) * Math.abs(x)) * 0.125;
                          	} else {
                          		tmp = (1.0 - t_0) / (1.0 + Math.sqrt(t_0));
                          	}
                          	return tmp;
                          }
                          
                          def code(x):
                          	t_0 = (0.5 / math.fabs(x)) - -0.5
                          	tmp = 0
                          	if math.fabs(x) <= 2.2:
                          		tmp = (math.fabs(x) * math.fabs(x)) * 0.125
                          	else:
                          		tmp = (1.0 - t_0) / (1.0 + math.sqrt(t_0))
                          	return tmp
                          
                          function code(x)
                          	t_0 = Float64(Float64(0.5 / abs(x)) - -0.5)
                          	tmp = 0.0
                          	if (abs(x) <= 2.2)
                          		tmp = Float64(Float64(abs(x) * abs(x)) * 0.125);
                          	else
                          		tmp = Float64(Float64(1.0 - t_0) / Float64(1.0 + sqrt(t_0)));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x)
                          	t_0 = (0.5 / abs(x)) - -0.5;
                          	tmp = 0.0;
                          	if (abs(x) <= 2.2)
                          		tmp = (abs(x) * abs(x)) * 0.125;
                          	else
                          		tmp = (1.0 - t_0) / (1.0 + sqrt(t_0));
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_] := Block[{t$95$0 = N[(N[(0.5 / N[Abs[x], $MachinePrecision]), $MachinePrecision] - -0.5), $MachinePrecision]}, If[LessEqual[N[Abs[x], $MachinePrecision], 2.2], N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[(1.0 + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                          
                          f(x):
                          	x in [-inf, +inf]
                          code: THEORY
                          BEGIN
                          f(x: real): real =
                          	LET t_0 = (((5e-1) / (abs(x))) - (-5e-1)) IN
                          		LET tmp = IF ((abs(x)) <= (220000000000000017763568394002504646778106689453125e-50)) THEN (((abs(x)) * (abs(x))) * (125e-3)) ELSE (((1) - t_0) / ((1) + (sqrt(t_0)))) ENDIF IN
                          	tmp
                          END code
                          \begin{array}{l}
                          t_0 := \frac{0.5}{\left|x\right|} - -0.5\\
                          \mathbf{if}\;\left|x\right| \leq 2.2:\\
                          \;\;\;\;\left(\left|x\right| \cdot \left|x\right|\right) \cdot 0.125\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{1 - t\_0}{1 + \sqrt{t\_0}}\\
                          
                          
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if x < 2.2000000000000002

                            1. Initial program 75.4%

                              \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
                            2. Step-by-step derivation
                              1. Applied rewrites76.2%

                                \[\leadsto \frac{1 - \left(\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5\right)}{1 + \sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5}} \]
                              2. Taylor expanded in x around 0

                                \[\leadsto \frac{1}{8} \cdot {x}^{2} \]
                              3. Step-by-step derivation
                                1. Applied rewrites51.4%

                                  \[\leadsto 0.125 \cdot {x}^{2} \]
                                2. Step-by-step derivation
                                  1. Applied rewrites51.4%

                                    \[\leadsto \left(x \cdot x\right) \cdot 0.125 \]

                                  if 2.2000000000000002 < x

                                  1. Initial program 75.4%

                                    \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
                                  2. Step-by-step derivation
                                    1. Applied rewrites76.2%

                                      \[\leadsto \frac{1 - \left(\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5\right)}{1 + \sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5}} \]
                                    2. Taylor expanded in x around inf

                                      \[\leadsto \frac{1 - \left(\frac{\frac{1}{2}}{x} - -0.5\right)}{1 + \sqrt{\frac{\frac{1}{2}}{x} - -0.5}} \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites50.0%

                                        \[\leadsto \frac{1 - \left(\frac{0.5}{x} - -0.5\right)}{1 + \sqrt{\frac{0.5}{x} - -0.5}} \]
                                    4. Recombined 2 regimes into one program.
                                    5. Add Preprocessing

                                    Alternative 5: 98.7% accurate, 1.1× speedup?

                                    \[\begin{array}{l} \mathbf{if}\;\left|x\right| \leq 1.2:\\ \;\;\;\;\left(\left|x\right| \cdot \left|x\right|\right) \cdot 0.125\\ \mathbf{else}:\\ \;\;\;\;1 - \sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(\left|x\right|, \left|x\right|, 1\right)}} - -0.5}\\ \end{array} \]
                                    (FPCore (x)
                                      :precision binary64
                                      :pre TRUE
                                      (if (<= (fabs x) 1.2)
                                      (* (* (fabs x) (fabs x)) 0.125)
                                      (- 1.0 (sqrt (- (/ 0.5 (sqrt (fma (fabs x) (fabs x) 1.0))) -0.5)))))
                                    double code(double x) {
                                    	double tmp;
                                    	if (fabs(x) <= 1.2) {
                                    		tmp = (fabs(x) * fabs(x)) * 0.125;
                                    	} else {
                                    		tmp = 1.0 - sqrt(((0.5 / sqrt(fma(fabs(x), fabs(x), 1.0))) - -0.5));
                                    	}
                                    	return tmp;
                                    }
                                    
                                    function code(x)
                                    	tmp = 0.0
                                    	if (abs(x) <= 1.2)
                                    		tmp = Float64(Float64(abs(x) * abs(x)) * 0.125);
                                    	else
                                    		tmp = Float64(1.0 - sqrt(Float64(Float64(0.5 / sqrt(fma(abs(x), abs(x), 1.0))) - -0.5)));
                                    	end
                                    	return tmp
                                    end
                                    
                                    code[x_] := If[LessEqual[N[Abs[x], $MachinePrecision], 1.2], N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision], N[(1.0 - N[Sqrt[N[(N[(0.5 / N[Sqrt[N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                    
                                    f(x):
                                    	x in [-inf, +inf]
                                    code: THEORY
                                    BEGIN
                                    f(x: real): real =
                                    	LET tmp = IF ((abs(x)) <= (11999999999999999555910790149937383830547332763671875e-52)) THEN (((abs(x)) * (abs(x))) * (125e-3)) ELSE ((1) - (sqrt((((5e-1) / (sqrt((((abs(x)) * (abs(x))) + (1))))) - (-5e-1))))) ENDIF IN
                                    	tmp
                                    END code
                                    \begin{array}{l}
                                    \mathbf{if}\;\left|x\right| \leq 1.2:\\
                                    \;\;\;\;\left(\left|x\right| \cdot \left|x\right|\right) \cdot 0.125\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;1 - \sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(\left|x\right|, \left|x\right|, 1\right)}} - -0.5}\\
                                    
                                    
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if x < 1.2

                                      1. Initial program 75.4%

                                        \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
                                      2. Step-by-step derivation
                                        1. Applied rewrites76.2%

                                          \[\leadsto \frac{1 - \left(\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5\right)}{1 + \sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5}} \]
                                        2. Taylor expanded in x around 0

                                          \[\leadsto \frac{1}{8} \cdot {x}^{2} \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites51.4%

                                            \[\leadsto 0.125 \cdot {x}^{2} \]
                                          2. Step-by-step derivation
                                            1. Applied rewrites51.4%

                                              \[\leadsto \left(x \cdot x\right) \cdot 0.125 \]

                                            if 1.2 < x

                                            1. Initial program 75.4%

                                              \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
                                            2. Step-by-step derivation
                                              1. Applied rewrites75.5%

                                                \[\leadsto 1 - \sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5} \]
                                            3. Recombined 2 regimes into one program.
                                            4. Add Preprocessing

                                            Alternative 6: 98.4% accurate, 2.1× speedup?

                                            \[\begin{array}{l} \mathbf{if}\;\left|x\right| \leq 1.25:\\ \;\;\;\;\left(\left|x\right| \cdot \left|x\right|\right) \cdot 0.125\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{1 + \sqrt{0.5}}\\ \end{array} \]
                                            (FPCore (x)
                                              :precision binary64
                                              :pre TRUE
                                              (if (<= (fabs x) 1.25)
                                              (* (* (fabs x) (fabs x)) 0.125)
                                              (/ 0.5 (+ 1.0 (sqrt 0.5)))))
                                            double code(double x) {
                                            	double tmp;
                                            	if (fabs(x) <= 1.25) {
                                            		tmp = (fabs(x) * fabs(x)) * 0.125;
                                            	} else {
                                            		tmp = 0.5 / (1.0 + sqrt(0.5));
                                            	}
                                            	return tmp;
                                            }
                                            
                                            real(8) function code(x)
                                            use fmin_fmax_functions
                                                real(8), intent (in) :: x
                                                real(8) :: tmp
                                                if (abs(x) <= 1.25d0) then
                                                    tmp = (abs(x) * abs(x)) * 0.125d0
                                                else
                                                    tmp = 0.5d0 / (1.0d0 + sqrt(0.5d0))
                                                end if
                                                code = tmp
                                            end function
                                            
                                            public static double code(double x) {
                                            	double tmp;
                                            	if (Math.abs(x) <= 1.25) {
                                            		tmp = (Math.abs(x) * Math.abs(x)) * 0.125;
                                            	} else {
                                            		tmp = 0.5 / (1.0 + Math.sqrt(0.5));
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(x):
                                            	tmp = 0
                                            	if math.fabs(x) <= 1.25:
                                            		tmp = (math.fabs(x) * math.fabs(x)) * 0.125
                                            	else:
                                            		tmp = 0.5 / (1.0 + math.sqrt(0.5))
                                            	return tmp
                                            
                                            function code(x)
                                            	tmp = 0.0
                                            	if (abs(x) <= 1.25)
                                            		tmp = Float64(Float64(abs(x) * abs(x)) * 0.125);
                                            	else
                                            		tmp = Float64(0.5 / Float64(1.0 + sqrt(0.5)));
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(x)
                                            	tmp = 0.0;
                                            	if (abs(x) <= 1.25)
                                            		tmp = (abs(x) * abs(x)) * 0.125;
                                            	else
                                            		tmp = 0.5 / (1.0 + sqrt(0.5));
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[x_] := If[LessEqual[N[Abs[x], $MachinePrecision], 1.25], N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision], N[(0.5 / N[(1.0 + N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                            
                                            f(x):
                                            	x in [-inf, +inf]
                                            code: THEORY
                                            BEGIN
                                            f(x: real): real =
                                            	LET tmp = IF ((abs(x)) <= (125e-2)) THEN (((abs(x)) * (abs(x))) * (125e-3)) ELSE ((5e-1) / ((1) + (sqrt((5e-1))))) ENDIF IN
                                            	tmp
                                            END code
                                            \begin{array}{l}
                                            \mathbf{if}\;\left|x\right| \leq 1.25:\\
                                            \;\;\;\;\left(\left|x\right| \cdot \left|x\right|\right) \cdot 0.125\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\frac{0.5}{1 + \sqrt{0.5}}\\
                                            
                                            
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if x < 1.25

                                              1. Initial program 75.4%

                                                \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
                                              2. Step-by-step derivation
                                                1. Applied rewrites76.2%

                                                  \[\leadsto \frac{1 - \left(\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5\right)}{1 + \sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5}} \]
                                                2. Taylor expanded in x around 0

                                                  \[\leadsto \frac{1}{8} \cdot {x}^{2} \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites51.4%

                                                    \[\leadsto 0.125 \cdot {x}^{2} \]
                                                  2. Step-by-step derivation
                                                    1. Applied rewrites51.4%

                                                      \[\leadsto \left(x \cdot x\right) \cdot 0.125 \]

                                                    if 1.25 < x

                                                    1. Initial program 75.4%

                                                      \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
                                                    2. Step-by-step derivation
                                                      1. Applied rewrites76.2%

                                                        \[\leadsto \frac{1 - \left(\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5\right)}{1 + \sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5}} \]
                                                      2. Taylor expanded in x around inf

                                                        \[\leadsto \frac{\frac{1}{2}}{1 + \sqrt{\frac{1}{2}}} \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites51.3%

                                                          \[\leadsto \frac{0.5}{1 + \sqrt{0.5}} \]
                                                      4. Recombined 2 regimes into one program.
                                                      5. Add Preprocessing

                                                      Alternative 7: 97.7% accurate, 2.1× speedup?

                                                      \[\begin{array}{l} \mathbf{if}\;\left|x\right| \leq 1.25:\\ \;\;\;\;\left(\left|x\right| \cdot \left|x\right|\right) \cdot 0.125\\ \mathbf{else}:\\ \;\;\;\;0.2928932188134524\\ \end{array} \]
                                                      (FPCore (x)
                                                        :precision binary64
                                                        :pre TRUE
                                                        (if (<= (fabs x) 1.25)
                                                        (* (* (fabs x) (fabs x)) 0.125)
                                                        0.2928932188134524))
                                                      double code(double x) {
                                                      	double tmp;
                                                      	if (fabs(x) <= 1.25) {
                                                      		tmp = (fabs(x) * fabs(x)) * 0.125;
                                                      	} else {
                                                      		tmp = 0.2928932188134524;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      real(8) function code(x)
                                                      use fmin_fmax_functions
                                                          real(8), intent (in) :: x
                                                          real(8) :: tmp
                                                          if (abs(x) <= 1.25d0) then
                                                              tmp = (abs(x) * abs(x)) * 0.125d0
                                                          else
                                                              tmp = 0.2928932188134524d0
                                                          end if
                                                          code = tmp
                                                      end function
                                                      
                                                      public static double code(double x) {
                                                      	double tmp;
                                                      	if (Math.abs(x) <= 1.25) {
                                                      		tmp = (Math.abs(x) * Math.abs(x)) * 0.125;
                                                      	} else {
                                                      		tmp = 0.2928932188134524;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      def code(x):
                                                      	tmp = 0
                                                      	if math.fabs(x) <= 1.25:
                                                      		tmp = (math.fabs(x) * math.fabs(x)) * 0.125
                                                      	else:
                                                      		tmp = 0.2928932188134524
                                                      	return tmp
                                                      
                                                      function code(x)
                                                      	tmp = 0.0
                                                      	if (abs(x) <= 1.25)
                                                      		tmp = Float64(Float64(abs(x) * abs(x)) * 0.125);
                                                      	else
                                                      		tmp = 0.2928932188134524;
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      function tmp_2 = code(x)
                                                      	tmp = 0.0;
                                                      	if (abs(x) <= 1.25)
                                                      		tmp = (abs(x) * abs(x)) * 0.125;
                                                      	else
                                                      		tmp = 0.2928932188134524;
                                                      	end
                                                      	tmp_2 = tmp;
                                                      end
                                                      
                                                      code[x_] := If[LessEqual[N[Abs[x], $MachinePrecision], 1.25], N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * 0.125), $MachinePrecision], 0.2928932188134524]
                                                      
                                                      f(x):
                                                      	x in [-inf, +inf]
                                                      code: THEORY
                                                      BEGIN
                                                      f(x: real): real =
                                                      	LET tmp = IF ((abs(x)) <= (125e-2)) THEN (((abs(x)) * (abs(x))) * (125e-3)) ELSE (29289321881345242726268907063058577477931976318359375e-53) ENDIF IN
                                                      	tmp
                                                      END code
                                                      \begin{array}{l}
                                                      \mathbf{if}\;\left|x\right| \leq 1.25:\\
                                                      \;\;\;\;\left(\left|x\right| \cdot \left|x\right|\right) \cdot 0.125\\
                                                      
                                                      \mathbf{else}:\\
                                                      \;\;\;\;0.2928932188134524\\
                                                      
                                                      
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Split input into 2 regimes
                                                      2. if x < 1.25

                                                        1. Initial program 75.4%

                                                          \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
                                                        2. Step-by-step derivation
                                                          1. Applied rewrites76.2%

                                                            \[\leadsto \frac{1 - \left(\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5\right)}{1 + \sqrt{\frac{0.5}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -0.5}} \]
                                                          2. Taylor expanded in x around 0

                                                            \[\leadsto \frac{1}{8} \cdot {x}^{2} \]
                                                          3. Step-by-step derivation
                                                            1. Applied rewrites51.4%

                                                              \[\leadsto 0.125 \cdot {x}^{2} \]
                                                            2. Step-by-step derivation
                                                              1. Applied rewrites51.4%

                                                                \[\leadsto \left(x \cdot x\right) \cdot 0.125 \]

                                                              if 1.25 < x

                                                              1. Initial program 75.4%

                                                                \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
                                                              2. Step-by-step derivation
                                                                1. Applied rewrites51.5%

                                                                  \[\leadsto 1 - \sqrt{\frac{1}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -1} \cdot \sqrt{0.5} \]
                                                                2. Evaluated real constant51.5%

                                                                  \[\leadsto 1 - \sqrt{\frac{1}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -1} \cdot 0.7071067811865476 \]
                                                                3. Taylor expanded in x around inf

                                                                  \[\leadsto \frac{2638147582215219}{9007199254740992} \]
                                                                4. Step-by-step derivation
                                                                  1. Applied rewrites50.5%

                                                                    \[\leadsto 0.2928932188134524 \]
                                                                5. Recombined 2 regimes into one program.
                                                                6. Add Preprocessing

                                                                Alternative 8: 74.1% accurate, 2.8× speedup?

                                                                \[\begin{array}{l} \mathbf{if}\;\left|x\right| \leq 5.5 \cdot 10^{-79}:\\ \;\;\;\;1 - \sqrt{1}\\ \mathbf{else}:\\ \;\;\;\;0.2928932188134524\\ \end{array} \]
                                                                (FPCore (x)
                                                                  :precision binary64
                                                                  :pre TRUE
                                                                  (if (<= (fabs x) 5.5e-79) (- 1.0 (sqrt 1.0)) 0.2928932188134524))
                                                                double code(double x) {
                                                                	double tmp;
                                                                	if (fabs(x) <= 5.5e-79) {
                                                                		tmp = 1.0 - sqrt(1.0);
                                                                	} else {
                                                                		tmp = 0.2928932188134524;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                real(8) function code(x)
                                                                use fmin_fmax_functions
                                                                    real(8), intent (in) :: x
                                                                    real(8) :: tmp
                                                                    if (abs(x) <= 5.5d-79) then
                                                                        tmp = 1.0d0 - sqrt(1.0d0)
                                                                    else
                                                                        tmp = 0.2928932188134524d0
                                                                    end if
                                                                    code = tmp
                                                                end function
                                                                
                                                                public static double code(double x) {
                                                                	double tmp;
                                                                	if (Math.abs(x) <= 5.5e-79) {
                                                                		tmp = 1.0 - Math.sqrt(1.0);
                                                                	} else {
                                                                		tmp = 0.2928932188134524;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                def code(x):
                                                                	tmp = 0
                                                                	if math.fabs(x) <= 5.5e-79:
                                                                		tmp = 1.0 - math.sqrt(1.0)
                                                                	else:
                                                                		tmp = 0.2928932188134524
                                                                	return tmp
                                                                
                                                                function code(x)
                                                                	tmp = 0.0
                                                                	if (abs(x) <= 5.5e-79)
                                                                		tmp = Float64(1.0 - sqrt(1.0));
                                                                	else
                                                                		tmp = 0.2928932188134524;
                                                                	end
                                                                	return tmp
                                                                end
                                                                
                                                                function tmp_2 = code(x)
                                                                	tmp = 0.0;
                                                                	if (abs(x) <= 5.5e-79)
                                                                		tmp = 1.0 - sqrt(1.0);
                                                                	else
                                                                		tmp = 0.2928932188134524;
                                                                	end
                                                                	tmp_2 = tmp;
                                                                end
                                                                
                                                                code[x_] := If[LessEqual[N[Abs[x], $MachinePrecision], 5.5e-79], N[(1.0 - N[Sqrt[1.0], $MachinePrecision]), $MachinePrecision], 0.2928932188134524]
                                                                
                                                                f(x):
                                                                	x in [-inf, +inf]
                                                                code: THEORY
                                                                BEGIN
                                                                f(x: real): real =
                                                                	LET tmp = IF ((abs(x)) <= (54999999999999996942057192297876001245053568316894463337206637269566867377234666277132519617507187437460990248639054916944318873802304893281316808212413385913220564905970669705645035915602216770869947737310212687589228153228759765625e-311)) THEN ((1) - (sqrt((1)))) ELSE (29289321881345242726268907063058577477931976318359375e-53) ENDIF IN
                                                                	tmp
                                                                END code
                                                                \begin{array}{l}
                                                                \mathbf{if}\;\left|x\right| \leq 5.5 \cdot 10^{-79}:\\
                                                                \;\;\;\;1 - \sqrt{1}\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;0.2928932188134524\\
                                                                
                                                                
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 2 regimes
                                                                2. if x < 5.4999999999999997e-79

                                                                  1. Initial program 75.4%

                                                                    \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
                                                                  2. Taylor expanded in x around inf

                                                                    \[\leadsto 1 - \sqrt{\frac{1}{2}} \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites50.5%

                                                                      \[\leadsto 1 - \sqrt{0.5} \]
                                                                    2. Taylor expanded in x around 0

                                                                      \[\leadsto 1 - \sqrt{1} \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites26.9%

                                                                        \[\leadsto 1 - \sqrt{1} \]

                                                                      if 5.4999999999999997e-79 < x

                                                                      1. Initial program 75.4%

                                                                        \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
                                                                      2. Step-by-step derivation
                                                                        1. Applied rewrites51.5%

                                                                          \[\leadsto 1 - \sqrt{\frac{1}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -1} \cdot \sqrt{0.5} \]
                                                                        2. Evaluated real constant51.5%

                                                                          \[\leadsto 1 - \sqrt{\frac{1}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -1} \cdot 0.7071067811865476 \]
                                                                        3. Taylor expanded in x around inf

                                                                          \[\leadsto \frac{2638147582215219}{9007199254740992} \]
                                                                        4. Step-by-step derivation
                                                                          1. Applied rewrites50.5%

                                                                            \[\leadsto 0.2928932188134524 \]
                                                                        5. Recombined 2 regimes into one program.
                                                                        6. Add Preprocessing

                                                                        Alternative 9: 50.5% accurate, 29.6× speedup?

                                                                        \[0.2928932188134524 \]
                                                                        (FPCore (x)
                                                                          :precision binary64
                                                                          :pre TRUE
                                                                          0.2928932188134524)
                                                                        double code(double x) {
                                                                        	return 0.2928932188134524;
                                                                        }
                                                                        
                                                                        real(8) function code(x)
                                                                        use fmin_fmax_functions
                                                                            real(8), intent (in) :: x
                                                                            code = 0.2928932188134524d0
                                                                        end function
                                                                        
                                                                        public static double code(double x) {
                                                                        	return 0.2928932188134524;
                                                                        }
                                                                        
                                                                        def code(x):
                                                                        	return 0.2928932188134524
                                                                        
                                                                        function code(x)
                                                                        	return 0.2928932188134524
                                                                        end
                                                                        
                                                                        function tmp = code(x)
                                                                        	tmp = 0.2928932188134524;
                                                                        end
                                                                        
                                                                        code[x_] := 0.2928932188134524
                                                                        
                                                                        f(x):
                                                                        	x in [-inf, +inf]
                                                                        code: THEORY
                                                                        BEGIN
                                                                        f(x: real): real =
                                                                        	29289321881345242726268907063058577477931976318359375e-53
                                                                        END code
                                                                        0.2928932188134524
                                                                        
                                                                        Derivation
                                                                        1. Initial program 75.4%

                                                                          \[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)} \]
                                                                        2. Step-by-step derivation
                                                                          1. Applied rewrites51.5%

                                                                            \[\leadsto 1 - \sqrt{\frac{1}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -1} \cdot \sqrt{0.5} \]
                                                                          2. Evaluated real constant51.5%

                                                                            \[\leadsto 1 - \sqrt{\frac{1}{\sqrt{\mathsf{fma}\left(x, x, 1\right)}} - -1} \cdot 0.7071067811865476 \]
                                                                          3. Taylor expanded in x around inf

                                                                            \[\leadsto \frac{2638147582215219}{9007199254740992} \]
                                                                          4. Step-by-step derivation
                                                                            1. Applied rewrites50.5%

                                                                              \[\leadsto 0.2928932188134524 \]
                                                                            2. Add Preprocessing

                                                                            Reproduce

                                                                            ?
                                                                            herbie shell --seed 2025355 
                                                                            (FPCore (x)
                                                                              :name "Given's Rotation SVD example, simplified"
                                                                              :precision binary64
                                                                              (- 1.0 (sqrt (* 0.5 (+ 1.0 (/ 1.0 (hypot 1.0 x)))))))