Rust f64::acosh

Percentage Accurate: 13.2% → 99.1%
Time: 1.9s
Alternatives: 3
Speedup: 4.3×

Specification

?
\[x \geq 1\]
\[\cosh^{-1} x \]
(FPCore (x)
  :precision binary64
  (acosh x))
double code(double x) {
	return acosh(x);
}
def code(x):
	return math.acosh(x)
function code(x)
	return acosh(x)
end
function tmp = code(x)
	tmp = acosh(x);
end
code[x_] := N[ArcCosh[x], $MachinePrecision]
\cosh^{-1} x

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

\[\log \left(x + \sqrt{x \cdot x - 1}\right) \]
(FPCore (x)
  :precision binary64
  (log (+ x (sqrt (- (* x x) 1.0)))))
double code(double x) {
	return log((x + sqrt(((x * x) - 1.0))));
}
real(8) function code(x)
use fmin_fmax_functions
    real(8), intent (in) :: x
    code = log((x + sqrt(((x * x) - 1.0d0))))
end function
public static double code(double x) {
	return Math.log((x + Math.sqrt(((x * x) - 1.0))));
}
def code(x):
	return math.log((x + math.sqrt(((x * x) - 1.0))))
function code(x)
	return log(Float64(x + sqrt(Float64(Float64(x * x) - 1.0))))
end
function tmp = code(x)
	tmp = log((x + sqrt(((x * x) - 1.0))));
end
code[x_] := N[Log[N[(x + N[Sqrt[N[(N[(x * x), $MachinePrecision] - 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\log \left(x + \sqrt{x \cdot x - 1}\right)

Alternative 1: 99.1% accurate, 1.3× speedup?

\[\begin{array}{l} \mathbf{if}\;x \leq 12000000000000:\\ \;\;\;\;0 \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\log \left(x + x\right)\\ \end{array} \]
(FPCore (x)
  :precision binary64
  (if (<= x 12000000000000.0) (* 0.0 1.0) (log (+ x x))))
double code(double x) {
	double tmp;
	if (x <= 12000000000000.0) {
		tmp = 0.0 * 1.0;
	} else {
		tmp = log((x + x));
	}
	return tmp;
}
real(8) function code(x)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= 12000000000000.0d0) then
        tmp = 0.0d0 * 1.0d0
    else
        tmp = log((x + x))
    end if
    code = tmp
end function
public static double code(double x) {
	double tmp;
	if (x <= 12000000000000.0) {
		tmp = 0.0 * 1.0;
	} else {
		tmp = Math.log((x + x));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if x <= 12000000000000.0:
		tmp = 0.0 * 1.0
	else:
		tmp = math.log((x + x))
	return tmp
function code(x)
	tmp = 0.0
	if (x <= 12000000000000.0)
		tmp = Float64(0.0 * 1.0);
	else
		tmp = log(Float64(x + x));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 12000000000000.0)
		tmp = 0.0 * 1.0;
	else
		tmp = log((x + x));
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[x, 12000000000000.0], N[(0.0 * 1.0), $MachinePrecision], N[Log[N[(x + x), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 12000000000000:\\
\;\;\;\;0 \cdot 1\\

\mathbf{else}:\\
\;\;\;\;\log \left(x + x\right)\\


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

    1. Initial program 13.2%

      \[\log \left(x + \sqrt{x \cdot x - 1}\right) \]
    2. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \log \left(x + \color{blue}{\sqrt{x \cdot x - 1}}\right) \]
      2. lift--.f64N/A

        \[\leadsto \log \left(x + \sqrt{\color{blue}{x \cdot x - 1}}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \log \left(x + \sqrt{\color{blue}{x \cdot x} - 1}\right) \]
      4. difference-of-sqr-1N/A

        \[\leadsto \log \left(x + \sqrt{\color{blue}{\left(x + 1\right) \cdot \left(x - 1\right)}}\right) \]
      5. sqrt-prodN/A

        \[\leadsto \log \left(x + \color{blue}{\sqrt{\left|x + 1\right|} \cdot \sqrt{\left|x - 1\right|}}\right) \]
      6. *-commutativeN/A

        \[\leadsto \log \left(x + \color{blue}{\sqrt{\left|x - 1\right|} \cdot \sqrt{\left|x + 1\right|}}\right) \]
      7. lower-*.f64N/A

        \[\leadsto \log \left(x + \color{blue}{\sqrt{\left|x - 1\right|} \cdot \sqrt{\left|x + 1\right|}}\right) \]
      8. lower-sqrt.f64N/A

        \[\leadsto \log \left(x + \color{blue}{\sqrt{\left|x - 1\right|}} \cdot \sqrt{\left|x + 1\right|}\right) \]
      9. fabs-subN/A

        \[\leadsto \log \left(x + \sqrt{\color{blue}{\left|1 - x\right|}} \cdot \sqrt{\left|x + 1\right|}\right) \]
      10. lower-fabs.f64N/A

        \[\leadsto \log \left(x + \sqrt{\color{blue}{\left|1 - x\right|}} \cdot \sqrt{\left|x + 1\right|}\right) \]
      11. lower--.f64N/A

        \[\leadsto \log \left(x + \sqrt{\left|\color{blue}{1 - x}\right|} \cdot \sqrt{\left|x + 1\right|}\right) \]
      12. lower-sqrt.f64N/A

        \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \color{blue}{\sqrt{\left|x + 1\right|}}\right) \]
      13. add-flipN/A

        \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \sqrt{\left|\color{blue}{x - \left(\mathsf{neg}\left(1\right)\right)}\right|}\right) \]
      14. fabs-subN/A

        \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \sqrt{\color{blue}{\left|\left(\mathsf{neg}\left(1\right)\right) - x\right|}}\right) \]
      15. lower-fabs.f64N/A

        \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \sqrt{\color{blue}{\left|\left(\mathsf{neg}\left(1\right)\right) - x\right|}}\right) \]
      16. lower--.f64N/A

        \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \sqrt{\left|\color{blue}{\left(\mathsf{neg}\left(1\right)\right) - x}\right|}\right) \]
      17. metadata-eval73.1%

        \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \sqrt{\left|\color{blue}{-1} - x\right|}\right) \]
    3. Applied rewrites73.1%

      \[\leadsto \log \left(x + \color{blue}{\sqrt{\left|1 - x\right|} \cdot \sqrt{\left|-1 - x\right|}}\right) \]
    4. Taylor expanded in x around 0

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot x\right)} \]
      2. lower-+.f64N/A

        \[\leadsto x \cdot \left(1 + \color{blue}{-1 \cdot x}\right) \]
      3. lower-*.f643.4%

        \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{x}\right) \]
    6. Applied rewrites3.4%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot x\right)} \]
    7. Taylor expanded in undef-var around zero

      \[\leadsto 0 \cdot \left(\color{blue}{1} + -1 \cdot x\right) \]
    8. Step-by-step derivation
      1. Applied rewrites76.1%

        \[\leadsto 0 \cdot \left(\color{blue}{1} + -1 \cdot x\right) \]
      2. Taylor expanded in undef-var around zero

        \[\leadsto 0 \cdot \left(1 + -1 \cdot 0\right) \]
      3. Step-by-step derivation
        1. Applied rewrites76.1%

          \[\leadsto 0 \cdot \left(1 + -1 \cdot 0\right) \]
        2. Taylor expanded in x around 0

          \[\leadsto 0 \cdot 1 \]
        3. Step-by-step derivation
          1. Applied rewrites76.1%

            \[\leadsto 0 \cdot 1 \]

          if 1.2e13 < x

          1. Initial program 13.2%

            \[\log \left(x + \sqrt{x \cdot x - 1}\right) \]
          2. Taylor expanded in x around -inf

            \[\leadsto \log \left(x + \color{blue}{-1 \cdot x}\right) \]
          3. Step-by-step derivation
            1. lower-*.f641.3%

              \[\leadsto \log \left(x + -1 \cdot \color{blue}{x}\right) \]
          4. Applied rewrites1.3%

            \[\leadsto \log \left(x + \color{blue}{-1 \cdot x}\right) \]
          5. Taylor expanded in x around inf

            \[\leadsto \log \color{blue}{\left(2 \cdot x\right)} \]
          6. Step-by-step derivation
            1. lower-*.f6425.3%

              \[\leadsto \log \left(2 \cdot \color{blue}{x}\right) \]
          7. Applied rewrites25.3%

            \[\leadsto \log \color{blue}{\left(2 \cdot x\right)} \]
          8. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \log \left(2 \cdot \color{blue}{x}\right) \]
            2. count-2-revN/A

              \[\leadsto \log \left(x + \color{blue}{x}\right) \]
            3. lower-+.f6425.3%

              \[\leadsto \log \left(x + \color{blue}{x}\right) \]
          9. Applied rewrites25.3%

            \[\leadsto \log \left(x + \color{blue}{x}\right) \]
        4. Recombined 2 regimes into one program.
        5. Add Preprocessing

        Alternative 2: 99.0% accurate, 1.5× speedup?

        \[\begin{array}{l} \mathbf{if}\;x \leq 12000000000000:\\ \;\;\;\;0 \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\cosh^{-1} x\\ \end{array} \]
        (FPCore (x)
          :precision binary64
          (if (<= x 12000000000000.0) (* 0.0 1.0) (acosh x)))
        double code(double x) {
        	double tmp;
        	if (x <= 12000000000000.0) {
        		tmp = 0.0 * 1.0;
        	} else {
        		tmp = acosh(x);
        	}
        	return tmp;
        }
        
        def code(x):
        	tmp = 0
        	if x <= 12000000000000.0:
        		tmp = 0.0 * 1.0
        	else:
        		tmp = math.acosh(x)
        	return tmp
        
        function code(x)
        	tmp = 0.0
        	if (x <= 12000000000000.0)
        		tmp = Float64(0.0 * 1.0);
        	else
        		tmp = acosh(x);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x)
        	tmp = 0.0;
        	if (x <= 12000000000000.0)
        		tmp = 0.0 * 1.0;
        	else
        		tmp = acosh(x);
        	end
        	tmp_2 = tmp;
        end
        
        code[x_] := If[LessEqual[x, 12000000000000.0], N[(0.0 * 1.0), $MachinePrecision], N[ArcCosh[x], $MachinePrecision]]
        
        \begin{array}{l}
        \mathbf{if}\;x \leq 12000000000000:\\
        \;\;\;\;0 \cdot 1\\
        
        \mathbf{else}:\\
        \;\;\;\;\cosh^{-1} x\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < 1.2e13

          1. Initial program 13.2%

            \[\log \left(x + \sqrt{x \cdot x - 1}\right) \]
          2. Step-by-step derivation
            1. lift-sqrt.f64N/A

              \[\leadsto \log \left(x + \color{blue}{\sqrt{x \cdot x - 1}}\right) \]
            2. lift--.f64N/A

              \[\leadsto \log \left(x + \sqrt{\color{blue}{x \cdot x - 1}}\right) \]
            3. lift-*.f64N/A

              \[\leadsto \log \left(x + \sqrt{\color{blue}{x \cdot x} - 1}\right) \]
            4. difference-of-sqr-1N/A

              \[\leadsto \log \left(x + \sqrt{\color{blue}{\left(x + 1\right) \cdot \left(x - 1\right)}}\right) \]
            5. sqrt-prodN/A

              \[\leadsto \log \left(x + \color{blue}{\sqrt{\left|x + 1\right|} \cdot \sqrt{\left|x - 1\right|}}\right) \]
            6. *-commutativeN/A

              \[\leadsto \log \left(x + \color{blue}{\sqrt{\left|x - 1\right|} \cdot \sqrt{\left|x + 1\right|}}\right) \]
            7. lower-*.f64N/A

              \[\leadsto \log \left(x + \color{blue}{\sqrt{\left|x - 1\right|} \cdot \sqrt{\left|x + 1\right|}}\right) \]
            8. lower-sqrt.f64N/A

              \[\leadsto \log \left(x + \color{blue}{\sqrt{\left|x - 1\right|}} \cdot \sqrt{\left|x + 1\right|}\right) \]
            9. fabs-subN/A

              \[\leadsto \log \left(x + \sqrt{\color{blue}{\left|1 - x\right|}} \cdot \sqrt{\left|x + 1\right|}\right) \]
            10. lower-fabs.f64N/A

              \[\leadsto \log \left(x + \sqrt{\color{blue}{\left|1 - x\right|}} \cdot \sqrt{\left|x + 1\right|}\right) \]
            11. lower--.f64N/A

              \[\leadsto \log \left(x + \sqrt{\left|\color{blue}{1 - x}\right|} \cdot \sqrt{\left|x + 1\right|}\right) \]
            12. lower-sqrt.f64N/A

              \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \color{blue}{\sqrt{\left|x + 1\right|}}\right) \]
            13. add-flipN/A

              \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \sqrt{\left|\color{blue}{x - \left(\mathsf{neg}\left(1\right)\right)}\right|}\right) \]
            14. fabs-subN/A

              \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \sqrt{\color{blue}{\left|\left(\mathsf{neg}\left(1\right)\right) - x\right|}}\right) \]
            15. lower-fabs.f64N/A

              \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \sqrt{\color{blue}{\left|\left(\mathsf{neg}\left(1\right)\right) - x\right|}}\right) \]
            16. lower--.f64N/A

              \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \sqrt{\left|\color{blue}{\left(\mathsf{neg}\left(1\right)\right) - x}\right|}\right) \]
            17. metadata-eval73.1%

              \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \sqrt{\left|\color{blue}{-1} - x\right|}\right) \]
          3. Applied rewrites73.1%

            \[\leadsto \log \left(x + \color{blue}{\sqrt{\left|1 - x\right|} \cdot \sqrt{\left|-1 - x\right|}}\right) \]
          4. Taylor expanded in x around 0

            \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot x\right)} \]
          5. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot x\right)} \]
            2. lower-+.f64N/A

              \[\leadsto x \cdot \left(1 + \color{blue}{-1 \cdot x}\right) \]
            3. lower-*.f643.4%

              \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{x}\right) \]
          6. Applied rewrites3.4%

            \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot x\right)} \]
          7. Taylor expanded in undef-var around zero

            \[\leadsto 0 \cdot \left(\color{blue}{1} + -1 \cdot x\right) \]
          8. Step-by-step derivation
            1. Applied rewrites76.1%

              \[\leadsto 0 \cdot \left(\color{blue}{1} + -1 \cdot x\right) \]
            2. Taylor expanded in undef-var around zero

              \[\leadsto 0 \cdot \left(1 + -1 \cdot 0\right) \]
            3. Step-by-step derivation
              1. Applied rewrites76.1%

                \[\leadsto 0 \cdot \left(1 + -1 \cdot 0\right) \]
              2. Taylor expanded in x around 0

                \[\leadsto 0 \cdot 1 \]
              3. Step-by-step derivation
                1. Applied rewrites76.1%

                  \[\leadsto 0 \cdot 1 \]

                if 1.2e13 < x

                1. Initial program 13.2%

                  \[\log \left(x + \sqrt{x \cdot x - 1}\right) \]
                2. Step-by-step derivation
                  1. lift-log.f64N/A

                    \[\leadsto \color{blue}{\log \left(x + \sqrt{x \cdot x - 1}\right)} \]
                  2. lift-+.f64N/A

                    \[\leadsto \log \color{blue}{\left(x + \sqrt{x \cdot x - 1}\right)} \]
                  3. lift-sqrt.f64N/A

                    \[\leadsto \log \left(x + \color{blue}{\sqrt{x \cdot x - 1}}\right) \]
                  4. lift--.f64N/A

                    \[\leadsto \log \left(x + \sqrt{\color{blue}{x \cdot x - 1}}\right) \]
                  5. lift-*.f64N/A

                    \[\leadsto \log \left(x + \sqrt{\color{blue}{x \cdot x} - 1}\right) \]
                  6. acosh-def-revN/A

                    \[\leadsto \color{blue}{\cosh^{-1} x} \]
                  7. lower-acosh.f6424.6%

                    \[\leadsto \color{blue}{\cosh^{-1} x} \]
                3. Applied rewrites24.6%

                  \[\leadsto \color{blue}{\cosh^{-1} x} \]
              4. Recombined 2 regimes into one program.
              5. Add Preprocessing

              Alternative 3: 76.1% accurate, 4.3× speedup?

              \[0 \cdot 1 \]
              (FPCore (x)
                :precision binary64
                (* 0.0 1.0))
              double code(double x) {
              	return 0.0 * 1.0;
              }
              
              real(8) function code(x)
              use fmin_fmax_functions
                  real(8), intent (in) :: x
                  code = 0.0d0 * 1.0d0
              end function
              
              public static double code(double x) {
              	return 0.0 * 1.0;
              }
              
              def code(x):
              	return 0.0 * 1.0
              
              function code(x)
              	return Float64(0.0 * 1.0)
              end
              
              function tmp = code(x)
              	tmp = 0.0 * 1.0;
              end
              
              code[x_] := N[(0.0 * 1.0), $MachinePrecision]
              
              0 \cdot 1
              
              Derivation
              1. Initial program 13.2%

                \[\log \left(x + \sqrt{x \cdot x - 1}\right) \]
              2. Step-by-step derivation
                1. lift-sqrt.f64N/A

                  \[\leadsto \log \left(x + \color{blue}{\sqrt{x \cdot x - 1}}\right) \]
                2. lift--.f64N/A

                  \[\leadsto \log \left(x + \sqrt{\color{blue}{x \cdot x - 1}}\right) \]
                3. lift-*.f64N/A

                  \[\leadsto \log \left(x + \sqrt{\color{blue}{x \cdot x} - 1}\right) \]
                4. difference-of-sqr-1N/A

                  \[\leadsto \log \left(x + \sqrt{\color{blue}{\left(x + 1\right) \cdot \left(x - 1\right)}}\right) \]
                5. sqrt-prodN/A

                  \[\leadsto \log \left(x + \color{blue}{\sqrt{\left|x + 1\right|} \cdot \sqrt{\left|x - 1\right|}}\right) \]
                6. *-commutativeN/A

                  \[\leadsto \log \left(x + \color{blue}{\sqrt{\left|x - 1\right|} \cdot \sqrt{\left|x + 1\right|}}\right) \]
                7. lower-*.f64N/A

                  \[\leadsto \log \left(x + \color{blue}{\sqrt{\left|x - 1\right|} \cdot \sqrt{\left|x + 1\right|}}\right) \]
                8. lower-sqrt.f64N/A

                  \[\leadsto \log \left(x + \color{blue}{\sqrt{\left|x - 1\right|}} \cdot \sqrt{\left|x + 1\right|}\right) \]
                9. fabs-subN/A

                  \[\leadsto \log \left(x + \sqrt{\color{blue}{\left|1 - x\right|}} \cdot \sqrt{\left|x + 1\right|}\right) \]
                10. lower-fabs.f64N/A

                  \[\leadsto \log \left(x + \sqrt{\color{blue}{\left|1 - x\right|}} \cdot \sqrt{\left|x + 1\right|}\right) \]
                11. lower--.f64N/A

                  \[\leadsto \log \left(x + \sqrt{\left|\color{blue}{1 - x}\right|} \cdot \sqrt{\left|x + 1\right|}\right) \]
                12. lower-sqrt.f64N/A

                  \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \color{blue}{\sqrt{\left|x + 1\right|}}\right) \]
                13. add-flipN/A

                  \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \sqrt{\left|\color{blue}{x - \left(\mathsf{neg}\left(1\right)\right)}\right|}\right) \]
                14. fabs-subN/A

                  \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \sqrt{\color{blue}{\left|\left(\mathsf{neg}\left(1\right)\right) - x\right|}}\right) \]
                15. lower-fabs.f64N/A

                  \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \sqrt{\color{blue}{\left|\left(\mathsf{neg}\left(1\right)\right) - x\right|}}\right) \]
                16. lower--.f64N/A

                  \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \sqrt{\left|\color{blue}{\left(\mathsf{neg}\left(1\right)\right) - x}\right|}\right) \]
                17. metadata-eval73.1%

                  \[\leadsto \log \left(x + \sqrt{\left|1 - x\right|} \cdot \sqrt{\left|\color{blue}{-1} - x\right|}\right) \]
              3. Applied rewrites73.1%

                \[\leadsto \log \left(x + \color{blue}{\sqrt{\left|1 - x\right|} \cdot \sqrt{\left|-1 - x\right|}}\right) \]
              4. Taylor expanded in x around 0

                \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot x\right)} \]
              5. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot x\right)} \]
                2. lower-+.f64N/A

                  \[\leadsto x \cdot \left(1 + \color{blue}{-1 \cdot x}\right) \]
                3. lower-*.f643.4%

                  \[\leadsto x \cdot \left(1 + -1 \cdot \color{blue}{x}\right) \]
              6. Applied rewrites3.4%

                \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot x\right)} \]
              7. Taylor expanded in undef-var around zero

                \[\leadsto 0 \cdot \left(\color{blue}{1} + -1 \cdot x\right) \]
              8. Step-by-step derivation
                1. Applied rewrites76.1%

                  \[\leadsto 0 \cdot \left(\color{blue}{1} + -1 \cdot x\right) \]
                2. Taylor expanded in undef-var around zero

                  \[\leadsto 0 \cdot \left(1 + -1 \cdot 0\right) \]
                3. Step-by-step derivation
                  1. Applied rewrites76.1%

                    \[\leadsto 0 \cdot \left(1 + -1 \cdot 0\right) \]
                  2. Taylor expanded in x around 0

                    \[\leadsto 0 \cdot 1 \]
                  3. Step-by-step derivation
                    1. Applied rewrites76.1%

                      \[\leadsto 0 \cdot 1 \]
                    2. Add Preprocessing

                    Developer Target 1: 24.7% accurate, 0.8× speedup?

                    \[\log \left(x + \sqrt{x - 1} \cdot \sqrt{x + 1}\right) \]
                    (FPCore (x)
                      :precision binary64
                      (log (+ x (* (sqrt (- x 1.0)) (sqrt (+ x 1.0))))))
                    double code(double x) {
                    	return log((x + (sqrt((x - 1.0)) * sqrt((x + 1.0)))));
                    }
                    
                    real(8) function code(x)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        code = log((x + (sqrt((x - 1.0d0)) * sqrt((x + 1.0d0)))))
                    end function
                    
                    public static double code(double x) {
                    	return Math.log((x + (Math.sqrt((x - 1.0)) * Math.sqrt((x + 1.0)))));
                    }
                    
                    def code(x):
                    	return math.log((x + (math.sqrt((x - 1.0)) * math.sqrt((x + 1.0)))))
                    
                    function code(x)
                    	return log(Float64(x + Float64(sqrt(Float64(x - 1.0)) * sqrt(Float64(x + 1.0)))))
                    end
                    
                    function tmp = code(x)
                    	tmp = log((x + (sqrt((x - 1.0)) * sqrt((x + 1.0)))));
                    end
                    
                    code[x_] := N[Log[N[(x + N[(N[Sqrt[N[(x - 1.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
                    
                    \log \left(x + \sqrt{x - 1} \cdot \sqrt{x + 1}\right)
                    

                    Reproduce

                    ?
                    herbie shell --seed 2025313 -o setup:search
                    (FPCore (x)
                      :name "Rust f64::acosh"
                      :precision binary64
                      :pre (>= x 1.0)
                    
                      :alt
                      (! :herbie-platform c (log (+ x (* (sqrt (- x 1)) (sqrt (+ x 1))))))
                    
                      (log (+ x (sqrt (- (* x x) 1.0)))))