Average Error: 6.7 → 1.8
Time: 3.8s
Precision: binary64
\[x + \frac{y \cdot \left(z - x\right)}{t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -8.6492572319033275 \cdot 10^{-6} \lor \neg \left(y \le 1.5338507604042645 \cdot 10^{-115}\right):\\ \;\;\;\;x + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z - x}{\sqrt[3]{t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot z + y \cdot \left(-x\right)}{t}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original6.7
Target2.2
Herbie1.8
\[x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)\]

Derivation

  1. Split input into 2 regimes
  2. if y < -8.6492572319033275e-6 or 1.5338507604042645e-115 < y

    1. Initial program 12.3

      \[x + \frac{y \cdot \left(z - x\right)}{t}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt12.9

      \[\leadsto x + \frac{y \cdot \left(z - x\right)}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}\]
    4. Applied times-frac2.5

      \[\leadsto x + \color{blue}{\frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z - x}{\sqrt[3]{t}}}\]

    if -8.6492572319033275e-6 < y < 1.5338507604042645e-115

    1. Initial program 1.2

      \[x + \frac{y \cdot \left(z - x\right)}{t}\]
    2. Using strategy rm
    3. Applied sub-neg1.2

      \[\leadsto x + \frac{y \cdot \color{blue}{\left(z + \left(-x\right)\right)}}{t}\]
    4. Applied distribute-lft-in1.2

      \[\leadsto x + \frac{\color{blue}{y \cdot z + y \cdot \left(-x\right)}}{t}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -8.6492572319033275 \cdot 10^{-6} \lor \neg \left(y \le 1.5338507604042645 \cdot 10^{-115}\right):\\ \;\;\;\;x + \frac{y}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z - x}{\sqrt[3]{t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot z + y \cdot \left(-x\right)}{t}\\ \end{array}\]

Reproduce

herbie shell --seed 2020152 
(FPCore (x y z t)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
  :precision binary64

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

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