| Alternative 1 | |
|---|---|
| Accuracy | 83.9% |
| Cost | 8402 |
(FPCore (x y z) :precision binary64 (fabs.f64 (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z))))
(FPCore (x y z)
:precision binary64
(if (<=.f64
(+.f64 x 4)
-500000000000000028883304949057948351218633563548032068549020931617356167008462307328)
(fabs.f64 (*.f64 (/.f64 x y) (+.f64 -1 z)))
(if (<=.f64 (+.f64 x 4) 5)
(fabs.f64 (+.f64 (/.f64 (*.f64 x (+.f64 -1 z)) y) (*.f64 4 (/.f64 -1 y))))
(fabs.f64 (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z))))))\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right)\right)\right)
\begin{array}{l}
\mathbf{if}\;\mathsf{<=.f64}\left(\mathsf{+.f64}\left(x, 4\right), -500000000000000028883304949057948351218633563548032068549020931617356167008462307328\right):\\
\;\;\;\;\mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), \mathsf{+.f64}\left(-1, z\right)\right)\right)\\
\mathbf{elif}\;\mathsf{<=.f64}\left(\mathsf{+.f64}\left(x, 4\right), 5\right):\\
\;\;\;\;\mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, z\right)\right), y\right), \mathsf{*.f64}\left(4, \mathsf{/.f64}\left(-1, y\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right)\right)\right)\\
\end{array}
if (+.f64 x 4) < -5.00000000000000029e83Initial program 99.8%
Simplified99.8%
[Start]99.8 | \[ \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right)\right)\right)
\] |
|---|---|
fabs-sub [=>]99.8 | \[ \color{blue}{\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right)\right)\right)}
\] |
associate-*l/ [=>]81.4 | \[ \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, z\right), y\right)}, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right)\right)\right)
\] |
*-commutative [=>]81.4 | \[ \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\color{blue}{\mathsf{*.f64}\left(z, x\right)}, y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right)\right)\right)
\] |
associate-*l/ [<=]99.8 | \[ \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), x\right)}, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right)\right)\right)
\] |
*-commutative [=>]99.8 | \[ \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, y\right)\right)}, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right)\right)\right)
\] |
fma-neg [=>]99.8 | \[ \mathsf{fabs.f64}\left(\color{blue}{\mathsf{fma.f64}\left(x, \mathsf{/.f64}\left(z, y\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right)\right)\right)}\right)
\] |
distribute-neg-frac [=>]99.8 | \[ \mathsf{fabs.f64}\left(\mathsf{fma.f64}\left(x, \mathsf{/.f64}\left(z, y\right), \color{blue}{\mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{+.f64}\left(x, 4\right)\right), y\right)}\right)\right)
\] |
+-commutative [=>]99.8 | \[ \mathsf{fabs.f64}\left(\mathsf{fma.f64}\left(x, \mathsf{/.f64}\left(z, y\right), \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\mathsf{+.f64}\left(4, x\right)}\right), y\right)\right)\right)
\] |
distribute-neg-in [=>]99.8 | \[ \mathsf{fabs.f64}\left(\mathsf{fma.f64}\left(x, \mathsf{/.f64}\left(z, y\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{neg.f64}\left(4\right), \mathsf{neg.f64}\left(x\right)\right)}, y\right)\right)\right)
\] |
unsub-neg [=>]99.8 | \[ \mathsf{fabs.f64}\left(\mathsf{fma.f64}\left(x, \mathsf{/.f64}\left(z, y\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(4\right), x\right)}, y\right)\right)\right)
\] |
metadata-eval [=>]99.8 | \[ \mathsf{fabs.f64}\left(\mathsf{fma.f64}\left(x, \mathsf{/.f64}\left(z, y\right), \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{-4}, x\right), y\right)\right)\right)
\] |
Taylor expanded in x around inf 99.6%
Simplified99.8%
[Start]99.6 | \[ \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(z, y\right), \mathsf{/.f64}\left(1, y\right)\right), x\right)\right)
\] |
|---|---|
*-commutative [=>]99.6 | \[ \mathsf{fabs.f64}\left(\color{blue}{\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(z, y\right), \mathsf{/.f64}\left(1, y\right)\right)\right)}\right)
\] |
sub-neg [=>]99.6 | \[ \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(x, \color{blue}{\mathsf{+.f64}\left(\mathsf{/.f64}\left(z, y\right), \mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, y\right)\right)\right)}\right)\right)
\] |
+-commutative [=>]99.6 | \[ \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(x, \color{blue}{\mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, y\right)\right), \mathsf{/.f64}\left(z, y\right)\right)}\right)\right)
\] |
distribute-rgt-out [<=]99.6 | \[ \mathsf{fabs.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(1, y\right)\right), x\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), x\right)\right)}\right)
\] |
distribute-neg-frac [=>]99.6 | \[ \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{/.f64}\left(\mathsf{neg.f64}\left(1\right), y\right)}, x\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), x\right)\right)\right)
\] |
metadata-eval [=>]99.6 | \[ \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{-1}, y\right), x\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), x\right)\right)\right)
\] |
associate-*l/ [=>]99.8 | \[ \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{/.f64}\left(\mathsf{*.f64}\left(-1, x\right), y\right)}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), x\right)\right)\right)
\] |
associate-*r/ [<=]99.8 | \[ \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(x, y\right)\right)}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), x\right)\right)\right)
\] |
*-commutative [=>]99.8 | \[ \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), -1\right)}, \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, y\right), x\right)\right)\right)
\] |
*-commutative [<=]99.8 | \[ \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), -1\right), \color{blue}{\mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, y\right)\right)}\right)\right)
\] |
associate-*r/ [=>]81.4 | \[ \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), -1\right), \color{blue}{\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, z\right), y\right)}\right)\right)
\] |
associate-/l* [=>]99.8 | \[ \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), -1\right), \color{blue}{\mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, z\right)\right)}\right)\right)
\] |
associate-/r/ [=>]99.8 | \[ \mathsf{fabs.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), -1\right), \color{blue}{\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right)}\right)\right)
\] |
distribute-lft-out [=>]99.8 | \[ \mathsf{fabs.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), \mathsf{+.f64}\left(-1, z\right)\right)}\right)
\] |
if -5.00000000000000029e83 < (+.f64 x 4) < 5Initial program 96.6%
Simplified99.4%
[Start]96.6 | \[ \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right)\right)\right)
\] |
|---|---|
*-rgt-identity [<=]96.6 | \[ \color{blue}{\mathsf{*.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right)\right)\right), 1\right)}
\] |
fabs-sub [=>]96.6 | \[ \mathsf{*.f64}\left(\color{blue}{\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right)\right)\right)}, 1\right)
\] |
metadata-eval [<=]96.6 | \[ \mathsf{*.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right)\right)\right), \color{blue}{\mathsf{fabs.f64}\left(1\right)}\right)
\] |
metadata-eval [<=]96.6 | \[ \mathsf{*.f64}\left(\mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right)\right)\right), \mathsf{fabs.f64}\left(\color{blue}{\mathsf{neg.f64}\left(-1\right)}\right)\right)
\] |
fabs-mul [<=]96.6 | \[ \color{blue}{\mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right)\right), \mathsf{neg.f64}\left(-1\right)\right)\right)}
\] |
metadata-eval [=>]96.6 | \[ \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right)\right), \color{blue}{1}\right)\right)
\] |
*-rgt-identity [=>]96.6 | \[ \mathsf{fabs.f64}\left(\color{blue}{\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(x, y\right), z\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right)\right)}\right)
\] |
associate-*l/ [=>]99.4 | \[ \mathsf{fabs.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, z\right), y\right)}, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 4\right), y\right)\right)\right)
\] |
div-sub [<=]99.4 | \[ \mathsf{fabs.f64}\left(\color{blue}{\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, z\right), \mathsf{+.f64}\left(x, 4\right)\right), y\right)}\right)
\] |
sub-neg [=>]99.4 | \[ \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, z\right), \mathsf{neg.f64}\left(\mathsf{+.f64}\left(x, 4\right)\right)\right)}, y\right)\right)
\] |
+-commutative [<=]99.4 | \[ \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\color{blue}{\mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{+.f64}\left(x, 4\right)\right), \mathsf{*.f64}\left(x, z\right)\right)}, y\right)\right)
\] |
remove-double-neg [<=]99.4 | \[ \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{+.f64}\left(x, 4\right)\right), \color{blue}{\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, z\right)\right)\right)}\right), y\right)\right)
\] |
distribute-neg-in [<=]99.4 | \[ \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\color{blue}{\mathsf{neg.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(x, 4\right), \mathsf{neg.f64}\left(\mathsf{*.f64}\left(x, z\right)\right)\right)\right)}, y\right)\right)
\] |
sub-neg [<=]99.4 | \[ \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, 4\right), \mathsf{*.f64}\left(x, z\right)\right)}\right), y\right)\right)
\] |
neg-mul-1 [=>]99.4 | \[ \mathsf{fabs.f64}\left(\mathsf{/.f64}\left(\color{blue}{\mathsf{*.f64}\left(-1, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, 4\right), \mathsf{*.f64}\left(x, z\right)\right)\right)}, y\right)\right)
\] |
associate-*l/ [<=]99.4 | \[ \mathsf{fabs.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, y\right), \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, 4\right), \mathsf{*.f64}\left(x, z\right)\right)\right)}\right)
\] |
remove-double-neg [<=]99.4 | \[ \mathsf{fabs.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(-1, y\right)\right)\right)}, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, 4\right), \mathsf{*.f64}\left(x, z\right)\right)\right)\right)
\] |
distribute-lft-neg-in [<=]99.4 | \[ \mathsf{fabs.f64}\left(\color{blue}{\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(-1, y\right)\right), \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, 4\right), \mathsf{*.f64}\left(x, z\right)\right)\right)\right)}\right)
\] |
distribute-rgt-neg-in [=>]99.4 | \[ \mathsf{fabs.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(-1, y\right)\right), \mathsf{neg.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, 4\right), \mathsf{*.f64}\left(x, z\right)\right)\right)\right)}\right)
\] |
Taylor expanded in x around inf 99.4%
if 5 < (+.f64 x 4) Initial program 99.8%
Final simplification99.5%
| Alternative 1 | |
|---|---|
| Accuracy | 83.9% |
| Cost | 8402 |
| Alternative 2 | |
|---|---|
| Accuracy | 99.4% |
| Cost | 7881 |
| Alternative 3 | |
|---|---|
| Accuracy | 99.5% |
| Cost | 7497 |
| Alternative 4 | |
|---|---|
| Accuracy | 69.2% |
| Cost | 7380 |
| Alternative 5 | |
|---|---|
| Accuracy | 69.2% |
| Cost | 7380 |
| Alternative 6 | |
|---|---|
| Accuracy | 99.7% |
| Cost | 7369 |
| Alternative 7 | |
|---|---|
| Accuracy | 98.5% |
| Cost | 7241 |
| Alternative 8 | |
|---|---|
| Accuracy | 98.5% |
| Cost | 7113 |
| Alternative 9 | |
|---|---|
| Accuracy | 81.8% |
| Cost | 6984 |
| Alternative 10 | |
|---|---|
| Accuracy | 70.8% |
| Cost | 6857 |
| Alternative 11 | |
|---|---|
| Accuracy | 49.4% |
| Cost | 6592 |
herbie shell --seed 2023144
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))