Average Error: 10.2 → 1.7
Time: 1.5m
Precision: 64
Internal Precision: 640
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;t \le -124511.71005566457:\\ \;\;\;\;x + \frac{y - z}{1} \cdot \frac{t}{a - z}\\ \mathbf{if}\;t \le 1.385403597157382 \cdot 10^{+79}:\\ \;\;\;\;x + \left(\left(y - z\right) \cdot t\right) \cdot \frac{1}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\sqrt[3]{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t}{\sqrt[3]{a - z}}} \cdot \sqrt[3]{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t}{\sqrt[3]{a - z}}}\right) \cdot \sqrt[3]{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t}{\sqrt[3]{a - z}}}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Target

Original10.2
Target0.5
Herbie1.7
\[\begin{array}{l} \mathbf{if}\;t \lt -1.0682974490174067 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{if}\;t \lt 3.9110949887586375 \cdot 10^{-141}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if t < -124511.71005566457

    1. Initial program 21.4

      \[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity21.4

      \[\leadsto x + \frac{\left(y - z\right) \cdot t}{\color{blue}{1 \cdot \left(a - z\right)}}\]
    4. Applied times-frac3.1

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

    if -124511.71005566457 < t < 1.385403597157382e+79

    1. Initial program 1.0

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

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

    if 1.385403597157382e+79 < t

    1. Initial program 28.1

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}} \cdot \frac{t}{\sqrt[3]{a - z}}}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt2.3

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

Runtime

Time bar (total: 1.5m)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, A"

  :herbie-target
  (if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))

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