Average Error: 0.0 → 0.0
Time: 2.4s
Precision: binary64
\[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t \]
\[\mathsf{fma}\left(0.125, x, \mathsf{fma}\left(y, z \cdot -0.5, t\right)\right) \]
\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t
\mathsf{fma}\left(0.125, x, \mathsf{fma}\left(y, z \cdot -0.5, t\right)\right)
(FPCore (x y z t)
 :precision binary64
 (+ (- (* (/ 1.0 8.0) x) (/ (* y z) 2.0)) t))
(FPCore (x y z t) :precision binary64 (fma 0.125 x (fma y (* z -0.5) t)))
double code(double x, double y, double z, double t) {
	return (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t;
}
double code(double x, double y, double z, double t) {
	return fma(0.125, x, fma(y, (z * -0.5), t));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original0.0
Target0.0
Herbie0.0
\[\left(\frac{x}{8} + t\right) - \frac{z}{2} \cdot y \]

Derivation

  1. Initial program 0.0

    \[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t \]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z, -0.5, \mathsf{fma}\left(0.125, x, t\right)\right)} \]
  3. Applied add-cbrt-cube_binary6445.6

    \[\leadsto \color{blue}{\sqrt[3]{\left(\mathsf{fma}\left(y \cdot z, -0.5, \mathsf{fma}\left(0.125, x, t\right)\right) \cdot \mathsf{fma}\left(y \cdot z, -0.5, \mathsf{fma}\left(0.125, x, t\right)\right)\right) \cdot \mathsf{fma}\left(y \cdot z, -0.5, \mathsf{fma}\left(0.125, x, t\right)\right)}} \]
  4. Simplified45.6

    \[\leadsto \sqrt[3]{\color{blue}{{\left(\mathsf{fma}\left(0.125, x, \mathsf{fma}\left(y \cdot z, -0.5, t\right)\right)\right)}^{3}}} \]
  5. Applied *-un-lft-identity_binary6445.6

    \[\leadsto \sqrt[3]{{\color{blue}{\left(1 \cdot \mathsf{fma}\left(0.125, x, \mathsf{fma}\left(y \cdot z, -0.5, t\right)\right)\right)}}^{3}} \]
  6. Applied unpow-prod-down_binary6445.6

    \[\leadsto \sqrt[3]{\color{blue}{{1}^{3} \cdot {\left(\mathsf{fma}\left(0.125, x, \mathsf{fma}\left(y \cdot z, -0.5, t\right)\right)\right)}^{3}}} \]
  7. Applied cbrt-prod_binary6445.6

    \[\leadsto \color{blue}{\sqrt[3]{{1}^{3}} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(0.125, x, \mathsf{fma}\left(y \cdot z, -0.5, t\right)\right)\right)}^{3}}} \]
  8. Simplified45.6

    \[\leadsto \color{blue}{1} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(0.125, x, \mathsf{fma}\left(y \cdot z, -0.5, t\right)\right)\right)}^{3}} \]
  9. Simplified0.0

    \[\leadsto 1 \cdot \color{blue}{\mathsf{fma}\left(0.125, x, \mathsf{fma}\left(y, z \cdot -0.5, t\right)\right)} \]
  10. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(0.125, x, \mathsf{fma}\left(y, z \cdot -0.5, t\right)\right) \]

Reproduce

herbie shell --seed 2021307 
(FPCore (x y z t)
  :name "Diagrams.Solve.Polynomial:quartForm  from diagrams-solve-0.1, B"
  :precision binary64

  :herbie-target
  (- (+ (/ x 8.0) t) (* (/ z 2.0) y))

  (+ (- (* (/ 1.0 8.0) x) (/ (* y z) 2.0)) t))