Rust f32::acosh

Percentage Accurate: 54.8% → 100.0%
Time: 9.4s
Alternatives: 13
Speedup: 2.0×

Specification

?
\[x \geq 1\]
\[\begin{array}{l} \\ \cosh^{-1} x \end{array} \]
(FPCore (x) :precision binary32 (acosh x))
float code(float x) {
	return acoshf(x);
}
function code(x)
	return acosh(x)
end
function tmp = code(x)
	tmp = acosh(x);
end
\begin{array}{l}

\\
\cosh^{-1} x
\end{array}

Sampling outcomes in binary32 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 13 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: 54.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \log \left(x + \sqrt{x \cdot x - 1}\right) \end{array} \]
(FPCore (x) :precision binary32 (log (+ x (sqrt (- (* x x) 1.0)))))
float code(float x) {
	return logf((x + sqrtf(((x * x) - 1.0f))));
}
real(4) function code(x)
    real(4), intent (in) :: x
    code = log((x + sqrt(((x * x) - 1.0e0))))
end function
function code(x)
	return log(Float32(x + sqrt(Float32(Float32(x * x) - Float32(1.0)))))
end
function tmp = code(x)
	tmp = log((x + sqrt(((x * x) - single(1.0)))));
end
\begin{array}{l}

\\
\log \left(x + \sqrt{x \cdot x - 1}\right)
\end{array}

Alternative 1: 100.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \langle \left( \log \left(x + \sqrt{x \cdot x + -1}\right) \right)_{\text{binary64}} \rangle_{\text{binary32}} \end{array} \]
(FPCore (x)
 :precision binary32
 (cast (! :precision binary64 (log (+ x (sqrt (+ (* x x) -1.0)))))))
float code(float x) {
	double tmp = log((((double) x) + sqrt(((((double) x) * ((double) x)) + -1.0))));
	return (float) tmp;
}
real(4) function code(x)
    real(4), intent (in) :: x
    real(8) :: tmp
    tmp = log((real(x, 8) + sqrt(((real(x, 8) * real(x, 8)) + (-1.0d0)))))
    code = real(tmp, 4)
end function
function code(x)
	tmp = log(Float64(Float64(x) + sqrt(Float64(Float64(Float64(x) * Float64(x)) + -1.0))))
	return Float32(tmp)
end
function tmp_2 = code(x)
	tmp = log((double(x) + sqrt(((double(x) * double(x)) + -1.0))));
	tmp_2 = single(tmp);
end
\begin{array}{l}

\\
\langle \left( \log \left(x + \sqrt{x \cdot x + -1}\right) \right)_{\text{binary64}} \rangle_{\text{binary32}}
\end{array}
Derivation
  1. Initial program 56.8%

    \[\log \left(x + \sqrt{x \cdot x - 1}\right) \]
  2. Step-by-step derivation
    1. rewrite-binary32/binary64100.0%

      \[\leadsto \color{blue}{\langle \color{blue}{\log \left(x + \sqrt{x \cdot x - 1}\right)} \rangle_{\text{binary64}}} \]
  3. Applied rewrite-once100.0%

    \[\leadsto \color{blue}{\langle \color{blue}{\log \left(x + \sqrt{x \cdot x - 1}\right)} \rangle_{\text{binary64}}} \]
  4. Final simplification100.0%

    \[\leadsto \langle \log \left(x + \sqrt{x \cdot x + -1}\right) \rangle_{\text{binary64}} \]

Alternative 2: 98.8% accurate, 1.8× speedup?

\[\begin{array}{l} \\ -\log \left(\frac{0.5}{x} + \frac{\frac{\frac{0.125}{x}}{x}}{x}\right) \end{array} \]
(FPCore (x)
 :precision binary32
 (- (log (+ (/ 0.5 x) (/ (/ (/ 0.125 x) x) x)))))
float code(float x) {
	return -logf(((0.5f / x) + (((0.125f / x) / x) / x)));
}
real(4) function code(x)
    real(4), intent (in) :: x
    code = -log(((0.5e0 / x) + (((0.125e0 / x) / x) / x)))
end function
function code(x)
	return Float32(-log(Float32(Float32(Float32(0.5) / x) + Float32(Float32(Float32(Float32(0.125) / x) / x) / x))))
end
function tmp = code(x)
	tmp = -log(((single(0.5) / x) + (((single(0.125) / x) / x) / x)));
end
\begin{array}{l}

\\
-\log \left(\frac{0.5}{x} + \frac{\frac{\frac{0.125}{x}}{x}}{x}\right)
\end{array}
Derivation
  1. Initial program 56.8%

    \[\log \left(x + \sqrt{x \cdot x - 1}\right) \]
  2. Step-by-step derivation
    1. flip-+7.8%

      \[\leadsto \log \color{blue}{\left(\frac{x \cdot x - \sqrt{x \cdot x - 1} \cdot \sqrt{x \cdot x - 1}}{x - \sqrt{x \cdot x - 1}}\right)} \]
    2. clear-num7.8%

      \[\leadsto \log \color{blue}{\left(\frac{1}{\frac{x - \sqrt{x \cdot x - 1}}{x \cdot x - \sqrt{x \cdot x - 1} \cdot \sqrt{x \cdot x - 1}}}\right)} \]
    3. log-rec7.8%

      \[\leadsto \color{blue}{-\log \left(\frac{x - \sqrt{x \cdot x - 1}}{x \cdot x - \sqrt{x \cdot x - 1} \cdot \sqrt{x \cdot x - 1}}\right)} \]
    4. clear-num7.8%

      \[\leadsto -\log \color{blue}{\left(\frac{1}{\frac{x \cdot x - \sqrt{x \cdot x - 1} \cdot \sqrt{x \cdot x - 1}}{x - \sqrt{x \cdot x - 1}}}\right)} \]
    5. flip-+56.8%

      \[\leadsto -\log \left(\frac{1}{\color{blue}{x + \sqrt{x \cdot x - 1}}}\right) \]
    6. fma-neg56.8%

      \[\leadsto -\log \left(\frac{1}{x + \sqrt{\color{blue}{\mathsf{fma}\left(x, x, -1\right)}}}\right) \]
    7. metadata-eval56.8%

      \[\leadsto -\log \left(\frac{1}{x + \sqrt{\mathsf{fma}\left(x, x, \color{blue}{-1}\right)}}\right) \]
  3. Applied egg-rr56.8%

    \[\leadsto \color{blue}{-\log \left(\frac{1}{x + \sqrt{\mathsf{fma}\left(x, x, -1\right)}}\right)} \]
  4. Taylor expanded in x around inf 99.1%

    \[\leadsto -\log \color{blue}{\left(0.5 \cdot \frac{1}{x} + 0.125 \cdot \frac{1}{{x}^{3}}\right)} \]
  5. Step-by-step derivation
    1. associate-*r/99.1%

      \[\leadsto -\log \left(\color{blue}{\frac{0.5 \cdot 1}{x}} + 0.125 \cdot \frac{1}{{x}^{3}}\right) \]
    2. metadata-eval99.1%

      \[\leadsto -\log \left(\frac{\color{blue}{0.5}}{x} + 0.125 \cdot \frac{1}{{x}^{3}}\right) \]
    3. associate-*r/99.1%

      \[\leadsto -\log \left(\frac{0.5}{x} + \color{blue}{\frac{0.125 \cdot 1}{{x}^{3}}}\right) \]
    4. metadata-eval99.1%

      \[\leadsto -\log \left(\frac{0.5}{x} + \frac{\color{blue}{0.125}}{{x}^{3}}\right) \]
  6. Simplified99.1%

    \[\leadsto -\log \color{blue}{\left(\frac{0.5}{x} + \frac{0.125}{{x}^{3}}\right)} \]
  7. Step-by-step derivation
    1. metadata-eval99.1%

      \[\leadsto -\log \left(\frac{0.5}{x} + \frac{\color{blue}{{0.5}^{3}}}{{x}^{3}}\right) \]
    2. cube-div99.1%

      \[\leadsto -\log \left(\frac{0.5}{x} + \color{blue}{{\left(\frac{0.5}{x}\right)}^{3}}\right) \]
    3. unpow399.1%

      \[\leadsto -\log \left(\frac{0.5}{x} + \color{blue}{\left(\frac{0.5}{x} \cdot \frac{0.5}{x}\right) \cdot \frac{0.5}{x}}\right) \]
    4. associate-*l/99.1%

      \[\leadsto -\log \left(\frac{0.5}{x} + \color{blue}{\frac{0.5 \cdot \frac{0.5}{x}}{x}} \cdot \frac{0.5}{x}\right) \]
    5. associate-*r/99.1%

      \[\leadsto -\log \left(\frac{0.5}{x} + \frac{\color{blue}{\frac{0.5 \cdot 0.5}{x}}}{x} \cdot \frac{0.5}{x}\right) \]
    6. metadata-eval99.1%

      \[\leadsto -\log \left(\frac{0.5}{x} + \frac{\frac{\color{blue}{0.25}}{x}}{x} \cdot \frac{0.5}{x}\right) \]
  8. Applied egg-rr99.1%

    \[\leadsto -\log \left(\frac{0.5}{x} + \color{blue}{\frac{\frac{0.25}{x}}{x} \cdot \frac{0.5}{x}}\right) \]
  9. Step-by-step derivation
    1. associate-*l/99.1%

      \[\leadsto -\log \left(\frac{0.5}{x} + \color{blue}{\frac{\frac{0.25}{x} \cdot \frac{0.5}{x}}{x}}\right) \]
    2. associate-*r/99.1%

      \[\leadsto -\log \left(\frac{0.5}{x} + \frac{\color{blue}{\frac{\frac{0.25}{x} \cdot 0.5}{x}}}{x}\right) \]
    3. associate-*l/99.1%

      \[\leadsto -\log \left(\frac{0.5}{x} + \frac{\frac{\color{blue}{\frac{0.25 \cdot 0.5}{x}}}{x}}{x}\right) \]
    4. metadata-eval99.1%

      \[\leadsto -\log \left(\frac{0.5}{x} + \frac{\frac{\frac{\color{blue}{0.125}}{x}}{x}}{x}\right) \]
  10. Applied egg-rr99.1%

    \[\leadsto -\log \left(\frac{0.5}{x} + \color{blue}{\frac{\frac{\frac{0.125}{x}}{x}}{x}}\right) \]
  11. Final simplification99.1%

    \[\leadsto -\log \left(\frac{0.5}{x} + \frac{\frac{\frac{0.125}{x}}{x}}{x}\right) \]

Alternative 3: 98.3% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \log \left(x \cdot 2 - \frac{0.5}{x}\right) \end{array} \]
(FPCore (x) :precision binary32 (log (- (* x 2.0) (/ 0.5 x))))
float code(float x) {
	return logf(((x * 2.0f) - (0.5f / x)));
}
real(4) function code(x)
    real(4), intent (in) :: x
    code = log(((x * 2.0e0) - (0.5e0 / x)))
end function
function code(x)
	return log(Float32(Float32(x * Float32(2.0)) - Float32(Float32(0.5) / x)))
end
function tmp = code(x)
	tmp = log(((x * single(2.0)) - (single(0.5) / x)));
end
\begin{array}{l}

\\
\log \left(x \cdot 2 - \frac{0.5}{x}\right)
\end{array}
Derivation
  1. Initial program 56.8%

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

    \[\leadsto \log \color{blue}{\left(2 \cdot x - 0.5 \cdot \frac{1}{x}\right)} \]
  3. Step-by-step derivation
    1. *-commutative98.8%

      \[\leadsto \log \left(\color{blue}{x \cdot 2} - 0.5 \cdot \frac{1}{x}\right) \]
    2. associate-*r/98.8%

      \[\leadsto \log \left(x \cdot 2 - \color{blue}{\frac{0.5 \cdot 1}{x}}\right) \]
    3. metadata-eval98.8%

      \[\leadsto \log \left(x \cdot 2 - \frac{\color{blue}{0.5}}{x}\right) \]
  4. Simplified98.8%

    \[\leadsto \log \color{blue}{\left(x \cdot 2 - \frac{0.5}{x}\right)} \]
  5. Final simplification98.8%

    \[\leadsto \log \left(x \cdot 2 - \frac{0.5}{x}\right) \]

Alternative 4: 97.5% accurate, 2.0× speedup?

\[\begin{array}{l} \\ -\log \left(\frac{0.5}{x}\right) \end{array} \]
(FPCore (x) :precision binary32 (- (log (/ 0.5 x))))
float code(float x) {
	return -logf((0.5f / x));
}
real(4) function code(x)
    real(4), intent (in) :: x
    code = -log((0.5e0 / x))
end function
function code(x)
	return Float32(-log(Float32(Float32(0.5) / x)))
end
function tmp = code(x)
	tmp = -log((single(0.5) / x));
end
\begin{array}{l}

\\
-\log \left(\frac{0.5}{x}\right)
\end{array}
Derivation
  1. Initial program 56.8%

    \[\log \left(x + \sqrt{x \cdot x - 1}\right) \]
  2. Step-by-step derivation
    1. flip-+7.8%

      \[\leadsto \log \color{blue}{\left(\frac{x \cdot x - \sqrt{x \cdot x - 1} \cdot \sqrt{x \cdot x - 1}}{x - \sqrt{x \cdot x - 1}}\right)} \]
    2. clear-num7.8%

      \[\leadsto \log \color{blue}{\left(\frac{1}{\frac{x - \sqrt{x \cdot x - 1}}{x \cdot x - \sqrt{x \cdot x - 1} \cdot \sqrt{x \cdot x - 1}}}\right)} \]
    3. log-rec7.8%

      \[\leadsto \color{blue}{-\log \left(\frac{x - \sqrt{x \cdot x - 1}}{x \cdot x - \sqrt{x \cdot x - 1} \cdot \sqrt{x \cdot x - 1}}\right)} \]
    4. clear-num7.8%

      \[\leadsto -\log \color{blue}{\left(\frac{1}{\frac{x \cdot x - \sqrt{x \cdot x - 1} \cdot \sqrt{x \cdot x - 1}}{x - \sqrt{x \cdot x - 1}}}\right)} \]
    5. flip-+56.8%

      \[\leadsto -\log \left(\frac{1}{\color{blue}{x + \sqrt{x \cdot x - 1}}}\right) \]
    6. fma-neg56.8%

      \[\leadsto -\log \left(\frac{1}{x + \sqrt{\color{blue}{\mathsf{fma}\left(x, x, -1\right)}}}\right) \]
    7. metadata-eval56.8%

      \[\leadsto -\log \left(\frac{1}{x + \sqrt{\mathsf{fma}\left(x, x, \color{blue}{-1}\right)}}\right) \]
  3. Applied egg-rr56.8%

    \[\leadsto \color{blue}{-\log \left(\frac{1}{x + \sqrt{\mathsf{fma}\left(x, x, -1\right)}}\right)} \]
  4. Taylor expanded in x around inf 97.4%

    \[\leadsto -\log \color{blue}{\left(\frac{0.5}{x}\right)} \]
  5. Final simplification97.4%

    \[\leadsto -\log \left(\frac{0.5}{x}\right) \]

Alternative 5: 97.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \log \left(x + x\right) \end{array} \]
(FPCore (x) :precision binary32 (log (+ x x)))
float code(float x) {
	return logf((x + x));
}
real(4) function code(x)
    real(4), intent (in) :: x
    code = log((x + x))
end function
function code(x)
	return log(Float32(x + x))
end
function tmp = code(x)
	tmp = log((x + x));
end
\begin{array}{l}

\\
\log \left(x + x\right)
\end{array}
Derivation
  1. Initial program 56.8%

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

    \[\leadsto \log \left(x + \color{blue}{x}\right) \]
  3. Final simplification97.0%

    \[\leadsto \log \left(x + x\right) \]

Alternative 6: 20.6% accurate, 207.0× speedup?

\[\begin{array}{l} \\ 0.75 \end{array} \]
(FPCore (x) :precision binary32 0.75)
float code(float x) {
	return 0.75f;
}
real(4) function code(x)
    real(4), intent (in) :: x
    code = 0.75e0
end function
function code(x)
	return Float32(0.75)
end
function tmp = code(x)
	tmp = single(0.75);
end
\begin{array}{l}

\\
0.75
\end{array}
Derivation
  1. Initial program 56.8%

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

    \[\leadsto \log \left(x + \color{blue}{x}\right) \]
  3. Applied egg-rr20.7%

    \[\leadsto \color{blue}{0.75} \]
  4. Final simplification20.7%

    \[\leadsto 0.75 \]

Alternative 7: 21.7% accurate, 207.0× speedup?

\[\begin{array}{l} \\ 1.5 \end{array} \]
(FPCore (x) :precision binary32 1.5)
float code(float x) {
	return 1.5f;
}
real(4) function code(x)
    real(4), intent (in) :: x
    code = 1.5e0
end function
function code(x)
	return Float32(1.5)
end
function tmp = code(x)
	tmp = single(1.5);
end
\begin{array}{l}

\\
1.5
\end{array}
Derivation
  1. Initial program 56.8%

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

    \[\leadsto \log \left(x + \color{blue}{x}\right) \]
  3. Applied egg-rr21.7%

    \[\leadsto \color{blue}{1.5} \]
  4. Final simplification21.7%

    \[\leadsto 1.5 \]

Alternative 8: 22.3% accurate, 207.0× speedup?

\[\begin{array}{l} \\ 2 \end{array} \]
(FPCore (x) :precision binary32 2.0)
float code(float x) {
	return 2.0f;
}
real(4) function code(x)
    real(4), intent (in) :: x
    code = 2.0e0
end function
function code(x)
	return Float32(2.0)
end
function tmp = code(x)
	tmp = single(2.0);
end
\begin{array}{l}

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

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

    \[\leadsto \log \left(x + \color{blue}{x}\right) \]
  3. Applied egg-rr22.3%

    \[\leadsto \color{blue}{2} \]
  4. Final simplification22.3%

    \[\leadsto 2 \]

Alternative 9: 22.9% accurate, 207.0× speedup?

\[\begin{array}{l} \\ 3 \end{array} \]
(FPCore (x) :precision binary32 3.0)
float code(float x) {
	return 3.0f;
}
real(4) function code(x)
    real(4), intent (in) :: x
    code = 3.0e0
end function
function code(x)
	return Float32(3.0)
end
function tmp = code(x)
	tmp = single(3.0);
end
\begin{array}{l}

\\
3
\end{array}
Derivation
  1. Initial program 56.8%

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

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

    \[\leadsto \color{blue}{3} \]
  4. Final simplification23.1%

    \[\leadsto 3 \]

Alternative 10: 23.7% accurate, 207.0× speedup?

\[\begin{array}{l} \\ 4 \end{array} \]
(FPCore (x) :precision binary32 4.0)
float code(float x) {
	return 4.0f;
}
real(4) function code(x)
    real(4), intent (in) :: x
    code = 4.0e0
end function
function code(x)
	return Float32(4.0)
end
function tmp = code(x)
	tmp = single(4.0);
end
\begin{array}{l}

\\
4
\end{array}
Derivation
  1. Initial program 56.8%

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

    \[\leadsto \log \left(x + \color{blue}{x}\right) \]
  3. Applied egg-rr24.0%

    \[\leadsto \color{blue}{4} \]
  4. Final simplification24.0%

    \[\leadsto 4 \]

Alternative 11: 24.5% accurate, 207.0× speedup?

\[\begin{array}{l} \\ 6 \end{array} \]
(FPCore (x) :precision binary32 6.0)
float code(float x) {
	return 6.0f;
}
real(4) function code(x)
    real(4), intent (in) :: x
    code = 6.0e0
end function
function code(x)
	return Float32(6.0)
end
function tmp = code(x)
	tmp = single(6.0);
end
\begin{array}{l}

\\
6
\end{array}
Derivation
  1. Initial program 56.8%

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

    \[\leadsto \log \left(x + \color{blue}{x}\right) \]
  3. Applied egg-rr24.8%

    \[\leadsto \color{blue}{6} \]
  4. Final simplification24.8%

    \[\leadsto 6 \]

Alternative 12: 25.4% accurate, 207.0× speedup?

\[\begin{array}{l} \\ 8 \end{array} \]
(FPCore (x) :precision binary32 8.0)
float code(float x) {
	return 8.0f;
}
real(4) function code(x)
    real(4), intent (in) :: x
    code = 8.0e0
end function
function code(x)
	return Float32(8.0)
end
function tmp = code(x)
	tmp = single(8.0);
end
\begin{array}{l}

\\
8
\end{array}
Derivation
  1. Initial program 56.8%

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

    \[\leadsto \log \left(x + \color{blue}{x}\right) \]
  3. Applied egg-rr25.6%

    \[\leadsto \color{blue}{8} \]
  4. Final simplification25.6%

    \[\leadsto 8 \]

Alternative 13: 27.5% accurate, 207.0× speedup?

\[\begin{array}{l} \\ 16 \end{array} \]
(FPCore (x) :precision binary32 16.0)
float code(float x) {
	return 16.0f;
}
real(4) function code(x)
    real(4), intent (in) :: x
    code = 16.0e0
end function
function code(x)
	return Float32(16.0)
end
function tmp = code(x)
	tmp = single(16.0);
end
\begin{array}{l}

\\
16
\end{array}
Derivation
  1. Initial program 56.8%

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

    \[\leadsto \log \left(x + \color{blue}{x}\right) \]
  3. Applied egg-rr27.6%

    \[\leadsto \color{blue}{16} \]
  4. Final simplification27.6%

    \[\leadsto 16 \]

Developer target: 99.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \log \left(x + \sqrt{x - 1} \cdot \sqrt{x + 1}\right) \end{array} \]
(FPCore (x)
 :precision binary32
 (log (+ x (* (sqrt (- x 1.0)) (sqrt (+ x 1.0))))))
float code(float x) {
	return logf((x + (sqrtf((x - 1.0f)) * sqrtf((x + 1.0f)))));
}
real(4) function code(x)
    real(4), intent (in) :: x
    code = log((x + (sqrt((x - 1.0e0)) * sqrt((x + 1.0e0)))))
end function
function code(x)
	return log(Float32(x + Float32(sqrt(Float32(x - Float32(1.0))) * sqrt(Float32(x + Float32(1.0))))))
end
function tmp = code(x)
	tmp = log((x + (sqrt((x - single(1.0))) * sqrt((x + single(1.0))))));
end
\begin{array}{l}

\\
\log \left(x + \sqrt{x - 1} \cdot \sqrt{x + 1}\right)
\end{array}

Reproduce

?
herbie shell --seed 2023297 
(FPCore (x)
  :name "Rust f32::acosh"
  :precision binary32
  :pre (>= x 1.0)

  :herbie-target
  (log (+ x (* (sqrt (- x 1.0)) (sqrt (+ x 1.0)))))

  (log (+ x (sqrt (- (* x x) 1.0)))))