Average Error: 1.1 → 1.1
Time: 19.2s
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.1
Target0.4
Herbie1.1
\[\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.1

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

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

Alternatives

Alternative 1
Error12.5
Cost2512
\[\begin{array}{l} t_1 := \frac{z - t}{a - t}\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+151}:\\ \;\;\;\;z \cdot \frac{y}{a - t}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{-159}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{elif}\;t_1 \leq 10^{-24}:\\ \;\;\;\;x - \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;t_1 \leq 2:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot \frac{y}{t}\\ \end{array} \]
Alternative 2
Error5.6
Cost2124
\[\begin{array}{l} t_1 := \frac{z - t}{a - t}\\ t_2 := x + y \cdot \frac{z}{a - t}\\ \mathbf{if}\;t_1 \leq 5 \cdot 10^{-159}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 10^{-24}:\\ \;\;\;\;x - \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;t_1 \leq 2:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error2.5
Cost2124
\[\begin{array}{l} t_1 := \frac{z - t}{a - t}\\ t_2 := x + y \cdot \frac{z}{a - t}\\ \mathbf{if}\;t_1 \leq -500000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{-21}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a}\\ \mathbf{elif}\;t_1 \leq 2:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error2.0
Cost2124
\[\begin{array}{l} t_1 := \frac{z - t}{a - t}\\ t_2 := x + y \cdot \frac{z}{a - t}\\ \mathbf{if}\;t_1 \leq -500000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{-21}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a}\\ \mathbf{elif}\;t_1 \leq 2:\\ \;\;\;\;x - \frac{y}{\frac{a - t}{t}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error20.2
Cost844
\[\begin{array}{l} \mathbf{if}\;t \leq -1.7 \cdot 10^{-67}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{-259}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 4.7 \cdot 10^{-227}:\\ \;\;\;\;y \cdot \frac{z}{a - t}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{-28}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 6
Error16.1
Cost844
\[\begin{array}{l} \mathbf{if}\;t \leq -2.2 \cdot 10^{-52}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.06 \cdot 10^{-134}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{elif}\;t \leq 3 \cdot 10^{+114}:\\ \;\;\;\;x - y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 7
Error20.1
Cost720
\[\begin{array}{l} \mathbf{if}\;t \leq -2.8 \cdot 10^{-67}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 6 \cdot 10^{-252}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 4.7 \cdot 10^{-227}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-28}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 8
Error20.1
Cost720
\[\begin{array}{l} \mathbf{if}\;t \leq -1.1 \cdot 10^{-66}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 6 \cdot 10^{-252}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-227}:\\ \;\;\;\;\frac{y \cdot z}{a}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-33}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 9
Error15.1
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{-50}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{-30}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 10
Error20.0
Cost456
\[\begin{array}{l} \mathbf{if}\;a \leq -8.2 \cdot 10^{+111}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.38 \cdot 10^{+156}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 11
Error27.9
Cost328
\[\begin{array}{l} \mathbf{if}\;y \leq -5.1 \cdot 10^{+79}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+71}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 12
Error29.3
Cost64
\[x \]

Error

Reproduce

herbie shell --seed 2022325 
(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)))))