(FPCore (x) :precision binary64 (sqrt.f64 (*.f64 2 (*.f64 x x))))
(FPCore (x) :precision binary64 (hypot.f64 x x))
\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(x, x\right)\right)\right)
\mathsf{hypot.f64}\left(x, x\right)
Initial program 52.4%
Taylor expanded in x around 0 51.1%
Simplified100.0%
[Start]51.1 | \[ \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), x\right)
\] |
|---|---|
*-commutative [=>]51.1 | \[ \color{blue}{\mathsf{*.f64}\left(x, \mathsf{sqrt.f64}\left(2\right)\right)}
\] |
rem-square-sqrt [<=]49.8 | \[ \color{blue}{\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(x, \mathsf{sqrt.f64}\left(2\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(x, \mathsf{sqrt.f64}\left(2\right)\right)\right)\right)}
\] |
fabs-sqr [<=]49.8 | \[ \color{blue}{\mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(x, \mathsf{sqrt.f64}\left(2\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(x, \mathsf{sqrt.f64}\left(2\right)\right)\right)\right)\right)}
\] |
rem-square-sqrt [=>]99.3 | \[ \mathsf{fabs.f64}\left(\color{blue}{\mathsf{*.f64}\left(x, \mathsf{sqrt.f64}\left(2\right)\right)}\right)
\] |
rem-sqrt-square [<=]52.2 | \[ \color{blue}{\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{sqrt.f64}\left(2\right)\right), \mathsf{*.f64}\left(x, \mathsf{sqrt.f64}\left(2\right)\right)\right)\right)}
\] |
swap-sqr [=>]52.0 | \[ \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{sqrt.f64}\left(2\right)\right)\right)}\right)
\] |
rem-square-sqrt [=>]52.4 | \[ \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \color{blue}{2}\right)\right)
\] |
*-commutative [<=]52.4 | \[ \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(x, x\right)\right)}\right)
\] |
count-2 [<=]52.4 | \[ \mathsf{sqrt.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(x, x\right)\right)}\right)
\] |
hypot-def [=>]100.0 | \[ \color{blue}{\mathsf{hypot.f64}\left(x, x\right)}
\] |
Final simplification100.0%
herbie shell --seed 2023144
(FPCore (x)
:name "sqrt C (should all be same)"
:precision binary64
(sqrt (* 2.0 (* x x))))