Average Error: 16.1 → 4.4
Time: 11.7s
Precision: binary64
Cost: 1088
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[x + y \cdot \left(\left(1 + \frac{t}{a - t}\right) - \frac{z}{a - t}\right)\]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
x + y \cdot \left(\left(1 + \frac{t}{a - t}\right) - \frac{z}{a - t}\right)
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
(FPCore (x y z t a)
 :precision binary64
 (+ x (* y (- (+ 1.0 (/ t (- a t))) (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
	return (x + y) - (((z - t) * y) / (a - t));
}
double code(double x, double y, double z, double t, double a) {
	return x + (y * ((1.0 + (t / (a - t))) - (z / (a - t))));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original16.1
Target8.3
Herbie4.4
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} < -1.3664970889390727 \cdot 10^{-07}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\ \mathbf{elif}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} < 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}\]

Alternatives

Alternative 1
Error7.1
Cost2116
\[\begin{array}{l} \mathbf{if}\;t \leq -3.468984774702244 \cdot 10^{+193}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\ \mathbf{elif}\;t \leq -1.0555721836227872 \cdot 10^{+141}:\\ \;\;\;\;\left(x + y\right) - \left(z - t\right) \cdot \frac{y}{a - t}\\ \mathbf{elif}\;t \leq -1.9875888461327692 \cdot 10^{+49}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\ \mathbf{elif}\;t \leq 7.921218364600235 \cdot 10^{+135}:\\ \;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - a}{t}\\ \end{array}\]
Alternative 2
Error6.9
Cost2116
\[\begin{array}{l} \mathbf{if}\;t \leq -3.837304396320661 \cdot 10^{+173}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\ \mathbf{elif}\;t \leq -5.436989244625463 \cdot 10^{+139}:\\ \;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\ \mathbf{elif}\;t \leq -1.9875888461327692 \cdot 10^{+49}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\ \mathbf{elif}\;t \leq 1.0258657210943311 \cdot 10^{+141}:\\ \;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{a - t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - a}{t}\\ \end{array}\]
Alternative 3
Error8.4
Cost1988
\[\begin{array}{l} \mathbf{if}\;a \leq -1.276293961224281 \cdot 10^{-06}:\\ \;\;\;\;x + y \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{elif}\;a \leq 1.7173201819750254 \cdot 10^{-62}:\\ \;\;\;\;x - y \cdot \frac{z}{a - t}\\ \mathbf{elif}\;a \leq 93033.91069691468:\\ \;\;\;\;x + \left(y - \frac{y \cdot \left(z - t\right)}{a - t}\right)\\ \mathbf{elif}\;a \leq 2.0925975603621751 \cdot 10^{+71}:\\ \;\;\;\;x - y \cdot \frac{z}{a - t}\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) - \frac{z}{\frac{a - t}{y}}\\ \end{array}\]
Alternative 4
Error7.3
Cost1346
\[\begin{array}{l} \mathbf{if}\;t \leq -1.6763395285930586 \cdot 10^{+49}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\ \mathbf{elif}\;t \leq 8.714435894414823 \cdot 10^{+135}:\\ \;\;\;\;\left(x + y\right) - \frac{z}{\frac{a - t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - a}{t}\\ \end{array}\]
Alternative 5
Error8.5
Cost904
\[\begin{array}{l} \mathbf{if}\;a \leq -0.0759632044576224 \lor \neg \left(a \leq 2.4217990137655632 \cdot 10^{+69}\right):\\ \;\;\;\;x + y \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{z}{a - t}\\ \end{array}\]
Alternative 6
Error10.4
Cost904
\[\begin{array}{l} \mathbf{if}\;a \leq -3.394760557120719 \cdot 10^{+63} \lor \neg \left(a \leq 6.825067818436545 \cdot 10^{+92}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{z}{a - t}\\ \end{array}\]
Alternative 7
Error13.2
Cost2053
\[\begin{array}{l} \mathbf{if}\;a \leq -7.500629331326737 \cdot 10^{+236}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq -6.242253695008518 \cdot 10^{-18}:\\ \;\;\;\;\left(x + y\right) - \frac{y \cdot z}{a}\\ \mathbf{elif}\;a \leq 3.388916562014322 \cdot 10^{-61}:\\ \;\;\;\;x + \frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;a \leq 156667.26386403333:\\ \;\;\;\;\left(x + y\right) - \frac{y \cdot z}{a}\\ \mathbf{elif}\;a \leq 775814873614.9922:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array}\]
Alternative 8
Error14.1
Cost776
\[\begin{array}{l} \mathbf{if}\;a \leq -1.4624546912627737 \cdot 10^{-16} \lor \neg \left(a \leq 1.9128254245190953 \cdot 10^{-59}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{\frac{t}{y}}\\ \end{array}\]
Alternative 9
Error14.8
Cost776
\[\begin{array}{l} \mathbf{if}\;a \leq -9.612938949830728 \cdot 10^{-22} \lor \neg \left(a \leq 7.639369142200596 \cdot 10^{-60}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \end{array}\]
Alternative 10
Error19.7
Cost520
\[\begin{array}{l} \mathbf{if}\;a \leq -5.941352493305822 \cdot 10^{-101} \lor \neg \left(a \leq 498.68364292446523\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 11
Error28.8
Cost64
\[x\]
Alternative 12
Error61.8
Cost64
\[1\]

Error

Derivation

  1. Initial program 16.1

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

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

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

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

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

Reproduce

herbie shell --seed 2021044 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
  :precision binary64

  :herbie-target
  (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-07) (- (+ y x) (* (* (- z t) (/ 1.0 (- 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.0 (- a t))) y))))

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