Average Error: 1.4 → 1.4
Time: 12.0s
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.4
Target0.5
Herbie1.4
\[\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.4

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

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

Alternatives

Alternative 1
Error11.6
Cost1104
\[\begin{array}{l} t_1 := x + \frac{y}{\frac{a}{z - t}}\\ \mathbf{if}\;a \leq -9.551388295327201 \cdot 10^{+23}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1.745713712910959 \cdot 10^{-42}:\\ \;\;\;\;x + \frac{y}{1 - \frac{a}{t}}\\ \mathbf{elif}\;a \leq -1.0312589350882324 \cdot 10^{-62}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 1.7303782570506225 \cdot 10^{+48}:\\ \;\;\;\;x - \frac{z - t}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error11.6
Cost1104
\[\begin{array}{l} t_1 := x + \frac{y}{\frac{a}{z - t}}\\ \mathbf{if}\;a \leq -9.551388295327201 \cdot 10^{+23}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1.745713712910959 \cdot 10^{-42}:\\ \;\;\;\;x + \frac{y}{1 - \frac{a}{t}}\\ \mathbf{elif}\;a \leq -1.0312589350882324 \cdot 10^{-62}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 1.7303782570506225 \cdot 10^{+48}:\\ \;\;\;\;x - \left(z - t\right) \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error11.6
Cost1104
\[\begin{array}{l} \mathbf{if}\;a \leq -9.551388295327201 \cdot 10^{+23}:\\ \;\;\;\;x + y \cdot \left(\left(z - t\right) \cdot \frac{1}{a}\right)\\ \mathbf{elif}\;a \leq -1.745713712910959 \cdot 10^{-42}:\\ \;\;\;\;x + \frac{y}{1 - \frac{a}{t}}\\ \mathbf{elif}\;a \leq -1.0312589350882324 \cdot 10^{-62}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 1.7303782570506225 \cdot 10^{+48}:\\ \;\;\;\;x - \left(z - t\right) \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\ \end{array} \]
Alternative 4
Error14.2
Cost840
\[\begin{array}{l} \mathbf{if}\;t \leq -8.410807835359178 \cdot 10^{+48}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 6.91264636646017 \cdot 10^{-71}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 5
Error14.3
Cost840
\[\begin{array}{l} t_1 := x + \frac{y}{\frac{a}{z - t}}\\ \mathbf{if}\;a \leq -9.551388295327201 \cdot 10^{+23}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.7303782570506225 \cdot 10^{+48}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error12.0
Cost840
\[\begin{array}{l} t_1 := x + \frac{y}{\frac{a}{z - t}}\\ \mathbf{if}\;a \leq -1.0312589350882324 \cdot 10^{-62}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.7303782570506225 \cdot 10^{+48}:\\ \;\;\;\;x - \frac{z - t}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error11.1
Cost840
\[\begin{array}{l} t_1 := x + \frac{y}{\frac{a}{z - t}}\\ \mathbf{if}\;a \leq -162448154284899.25:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.7303782570506225 \cdot 10^{+48}:\\ \;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error19.0
Cost712
\[\begin{array}{l} t_1 := x - t \cdot \frac{y}{a}\\ \mathbf{if}\;a \leq -2.1147287367427253 \cdot 10^{+76}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.6945936389533066 \cdot 10^{+98}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error15.2
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -1.3648944009272348 \cdot 10^{+102}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.7073450118233488 \cdot 10^{-63}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 10
Error1.3
Cost704
\[x + \frac{y}{\frac{a - t}{z - t}} \]
Alternative 11
Error20.4
Cost456
\[\begin{array}{l} \mathbf{if}\;a \leq -3.2264991338661957 \cdot 10^{+166}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.2044219772932084 \cdot 10^{+201}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 12
Error28.8
Cost64
\[x \]

Error

Reproduce

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