Average Error: 9.6 → 0.0
Time: 13.6s
Precision: 64
Internal precision: 128
\[\frac{x + y \cdot \left(z - x\right)}{z}\]
\[\left(y + \frac{x}{z}\right) - \frac{y}{\frac{z}{x}}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original9.6
Comparison0.0
Herbie0.0
\[ \left(y + \frac{x}{z}\right) - \frac{y}{\frac{z}{x}} \]

Derivation

  1. Initial program 9.6

    \[\frac{x + y \cdot \left(z - x\right)}{z}\]
  2. Applied taylor 3.3

    \[\leadsto \left(y + \frac{x}{z}\right) - \frac{y \cdot x}{z}\]
  3. Taylor expanded around 0 3.3

    \[\leadsto \color{blue}{\left(y + \frac{x}{z}\right) - \frac{y \cdot x}{z}}\]
  4. Using strategy rm
  5. Applied associate-/l* 0.0

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

Runtime

Time bar (total: 13.6s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(3346366306 1623667776 2610017998 3926728869 1672933471 2891352488)'
(FPCore (x y z)
  :name "Diagrams.Backend.Rasterific:rasterificRadialGradient from diagrams-rasterific-1.3.1.3"

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

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