| Alternative 1 | |
|---|---|
| Error | 0.1 |
| Cost | 3488 |
\[0.5 \cdot \mathsf{log1p}\left(x \cdot \frac{-2}{x + -1}\right)
\]
(FPCore (x) :precision binary32 (* 0.5 (log1p (/ (* 2.0 x) (- 1.0 x)))))
(FPCore (x) :precision binary32 (* 0.5 (log1p (/ (* 2.0 (fma x x x)) (- 1.0 (* x x))))))
float code(float x) {
return 0.5f * log1pf(((2.0f * x) / (1.0f - x)));
}
float code(float x) {
return 0.5f * log1pf(((2.0f * fmaf(x, x, x)) / (1.0f - (x * x))));
}
function code(x) return Float32(Float32(0.5) * log1p(Float32(Float32(Float32(2.0) * x) / Float32(Float32(1.0) - x)))) end
function code(x) return Float32(Float32(0.5) * log1p(Float32(Float32(Float32(2.0) * fma(x, x, x)) / Float32(Float32(1.0) - Float32(x * x))))) end
0.5 \cdot \mathsf{log1p}\left(\frac{2 \cdot x}{1 - x}\right)
0.5 \cdot \mathsf{log1p}\left(\frac{2 \cdot \mathsf{fma}\left(x, x, x\right)}{1 - x \cdot x}\right)
Initial program 0.1
Applied egg-rr0.1
Simplified0.0
Final simplification0.0
| Alternative 1 | |
|---|---|
| Error | 0.1 |
| Cost | 3488 |
| Alternative 2 | |
|---|---|
| Error | 0.1 |
| Cost | 3488 |
| Alternative 3 | |
|---|---|
| Error | 1.1 |
| Cost | 160 |
herbie shell --seed 2022328
(FPCore (x)
:name "Rust f32::atanh"
:precision binary32
(* 0.5 (log1p (/ (* 2.0 x) (- 1.0 x)))))