Average Error: 27.1 → 0.2
Time: 25.5s
Precision: 64
Internal precision: 128
\[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2.0}\]
\[\left(0.5 \cdot y + 0.5 \cdot \frac{x}{\frac{y}{x}}\right) - 0.5 \cdot \frac{z}{\frac{y}{z}}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original27.1
Comparison0.2
Herbie0.2
\[ y \cdot 0.5 - \left(\frac{0.5}{y} \cdot \left(z + x\right)\right) \cdot \left(z - x\right) \]

Derivation

  1. Initial program 27.1

    \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2.0}\]
  2. Applied simplify 27.1

    \[\leadsto \color{blue}{\frac{{y}^2 + \left(x - z\right) \cdot \left(x + z\right)}{2.0 \cdot y}}\]
  3. Applied taylor 12.4

    \[\leadsto \left(0.5 \cdot y + 0.5 \cdot \frac{{x}^2}{y}\right) - 0.5 \cdot \frac{{z}^2}{y}\]
  4. Taylor expanded around 0 12.4

    \[\leadsto \color{blue}{\left(0.5 \cdot y + 0.5 \cdot \frac{{x}^2}{y}\right) - 0.5 \cdot \frac{{z}^2}{y}}\]
  5. Using strategy rm
  6. Applied square-mult 12.4

    \[\leadsto \left(0.5 \cdot y + 0.5 \cdot \frac{\color{blue}{x \cdot x}}{y}\right) - 0.5 \cdot \frac{{z}^2}{y}\]
  7. Applied associate-/l* 6.9

    \[\leadsto \left(0.5 \cdot y + 0.5 \cdot \color{blue}{\frac{x}{\frac{y}{x}}}\right) - 0.5 \cdot \frac{{z}^2}{y}\]
  8. Using strategy rm
  9. Applied square-mult 6.9

    \[\leadsto \left(0.5 \cdot y + 0.5 \cdot \frac{x}{\frac{y}{x}}\right) - 0.5 \cdot \frac{\color{blue}{z \cdot z}}{y}\]
  10. Applied associate-/l* 0.2

    \[\leadsto \left(0.5 \cdot y + 0.5 \cdot \frac{x}{\frac{y}{x}}\right) - 0.5 \cdot \color{blue}{\frac{z}{\frac{y}{z}}}\]
  11. Removed slow pow expressions

Runtime

Time bar (total: 25.5s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(2589169155 229863034 3917575505 1217915576 3678552078 3142610906)'
(FPCore (x y z)
  :name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, A"

  :target
  (- (* y 0.5) (* (* (/ 0.5 y) (+ z x)) (- z x)))

  (/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0)))