Average Error: 16.8 → 9.4
Time: 2.1m
Precision: 64
Internal Precision: 1920
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -3.3197420561768994 \cdot 10^{-165}:\\ \;\;\;\;\left(x + y\right) - \frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{1} \cdot \frac{\sqrt[3]{z - t}}{\frac{a - t}{y}}\\ \mathbf{if}\;a \le 2.1459458012784685 \cdot 10^{-239}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) - \left(z - t\right) \cdot \frac{y}{a - t}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Target

Original16.8
Target8.8
Herbie9.4
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt -1.3664970889390727 \cdot 10^{-07}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\ \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt 1.4754293444577233 \cdot 10^{-239}:\\ \;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if a < -3.3197420561768994e-165

    1. Initial program 15.6

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Using strategy rm
    3. Applied associate-/l*9.8

      \[\leadsto \left(x + y\right) - \color{blue}{\frac{z - t}{\frac{a - t}{y}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity9.8

      \[\leadsto \left(x + y\right) - \frac{z - t}{\color{blue}{1 \cdot \frac{a - t}{y}}}\]
    6. Applied add-cube-cbrt9.9

      \[\leadsto \left(x + y\right) - \frac{\color{blue}{\left(\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}\right) \cdot \sqrt[3]{z - t}}}{1 \cdot \frac{a - t}{y}}\]
    7. Applied times-frac9.9

      \[\leadsto \left(x + y\right) - \color{blue}{\frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{1} \cdot \frac{\sqrt[3]{z - t}}{\frac{a - t}{y}}}\]

    if -3.3197420561768994e-165 < a < 2.1459458012784685e-239

    1. Initial program 23.7

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Taylor expanded around inf 3.8

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

    if 2.1459458012784685e-239 < a

    1. Initial program 15.5

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Taylor expanded around inf 15.5

      \[\leadsto \left(x + y\right) - \frac{\color{blue}{z \cdot y - y \cdot t}}{a - t}\]
    3. Applied simplify10.9

      \[\leadsto \color{blue}{\left(y + x\right) - \left(z - t\right) \cdot \frac{y}{a - t}}\]
  3. Recombined 3 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 2.1m)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit +o reduce:binary-search
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"

  :herbie-target
  (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-07) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y))))

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