?

Average Error: 1.3 → 1.3
Time: 13.9s
Precision: binary64
Cost: 704

?

\[x + y \cdot \frac{z - t}{a - t} \]
\[x + y \cdot \frac{z - t}{a - t} \]
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (a - t)));
}
double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (a - t)));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (y * ((z - t) / (a - t)))
end function
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (a - t)));
}
public static double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a):
	return x + (y * ((z - t) / (a - t)))
def code(x, y, z, t, a):
	return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a)
	return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t))))
end
function code(x, y, z, t, a)
	return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t))))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (y * ((z - t) / (a - t)));
end
function tmp = code(x, y, z, t, a)
	tmp = x + (y * ((z - t) / (a - t)));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + y \cdot \frac{z - t}{a - t}
x + y \cdot \frac{z - t}{a - t}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.3
Target0.4
Herbie1.3
\[\begin{array}{l} \mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array} \]

Derivation?

  1. Initial program 1.3

    \[x + y \cdot \frac{z - t}{a - t} \]
  2. Final simplification1.3

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

Alternatives

Alternative 1
Error18.4
Cost2028
\[\begin{array}{l} t_1 := \frac{y}{a - t}\\ t_2 := x - t \cdot t_1\\ t_3 := y \cdot \frac{z - t}{a - t}\\ \mathbf{if}\;y \leq -1.2 \cdot 10^{+145}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -1 \cdot 10^{+98}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{+76}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{-24}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-108}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-98}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{-60}:\\ \;\;\;\;\left(z - t\right) \cdot t_1\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-28}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{-23}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+48}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+219}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 2
Error17.1
Cost1764
\[\begin{array}{l} t_1 := \frac{y}{a - t}\\ t_2 := y \cdot \frac{z - t}{a - t}\\ t_3 := x - t \cdot t_1\\ t_4 := x - \frac{y \cdot t}{a - t}\\ \mathbf{if}\;y \leq -2.1 \cdot 10^{+144}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{+97}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{+80}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-28}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-98}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-58}:\\ \;\;\;\;\left(z - t\right) \cdot t_1\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{-54}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{+47}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{+218}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error17.0
Cost1764
\[\begin{array}{l} t_1 := y \cdot \frac{z - t}{a - t}\\ t_2 := x - t \cdot \frac{y}{a - t}\\ t_3 := x - \frac{y \cdot t}{a - t}\\ \mathbf{if}\;y \leq -6.4 \cdot 10^{+143}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{+98}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -4 \cdot 10^{+81}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-24}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-100}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-58}:\\ \;\;\;\;\frac{z - t}{\frac{a - t}{y}}\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-54}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{+47}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+218}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error11.2
Cost1608
\[\begin{array}{l} t_1 := \frac{z - t}{a - t}\\ \mathbf{if}\;t_1 \leq 0.1:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t_1 \leq 10^{+147}:\\ \;\;\;\;x + y \cdot \frac{t - z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \end{array} \]
Alternative 5
Error11.9
Cost1480
\[\begin{array}{l} t_1 := \frac{z - t}{a - t}\\ \mathbf{if}\;t_1 \leq 0.1:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t_1 \leq 10000000:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \end{array} \]
Alternative 6
Error22.4
Cost977
\[\begin{array}{l} \mathbf{if}\;x \leq -1.6 \cdot 10^{-240}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;x \leq -1.25 \cdot 10^{-307} \lor \neg \left(x \leq 1.65 \cdot 10^{-253}\right) \land x \leq 3.8 \cdot 10^{-219}:\\ \;\;\;\;z \cdot \frac{y}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 7
Error15.3
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -1.9 \cdot 10^{-82}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 2.25 \cdot 10^{-122}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 8
Error15.2
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -1.65 \cdot 10^{-82}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{-122}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 9
Error26.9
Cost592
\[\begin{array}{l} \mathbf{if}\;y \leq -1.22 \cdot 10^{+145}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+62}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+80}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+216}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 10
Error22.7
Cost584
\[\begin{array}{l} \mathbf{if}\;t \leq -7.5 \cdot 10^{-227}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -6.4 \cdot 10^{-288}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 11
Error22.6
Cost584
\[\begin{array}{l} \mathbf{if}\;t \leq -1.05 \cdot 10^{-226}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -5.6 \cdot 10^{-288}:\\ \;\;\;\;\frac{y \cdot z}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 12
Error20.8
Cost324
\[\begin{array}{l} \mathbf{if}\;a \leq -1.25 \cdot 10^{+169}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 13
Error28.4
Cost64
\[x \]

Error

Reproduce?

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

  :herbie-target
  (if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

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