?

Average Error: 1.2 → 1.2
Time: 14.1s
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.2
Target0.4
Herbie1.2
\[\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.2

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

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

Alternatives

Alternative 1
Error16.3
Cost1500
\[\begin{array}{l} t_1 := x + \frac{z - t}{\frac{a}{y}}\\ t_2 := x - \frac{y \cdot z}{t}\\ \mathbf{if}\;a \leq -1.45 \cdot 10^{+15}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\ \mathbf{elif}\;a \leq -4.3 \cdot 10^{-85}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq -2.3 \cdot 10^{-110}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1.26 \cdot 10^{-222}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -1.5 \cdot 10^{-271}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{-198}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{+41}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error20.9
Cost1176
\[\begin{array}{l} t_1 := \frac{y}{\frac{a}{z}}\\ \mathbf{if}\;t \leq -3.3 \cdot 10^{-35}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{-284}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-246}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3.9 \cdot 10^{-194}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{-145}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{-125}:\\ \;\;\;\;\frac{y \cdot \left(-z\right)}{t}\\ \mathbf{elif}\;t \leq 4.3 \cdot 10^{-22}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 3
Error9.8
Cost1105
\[\begin{array}{l} t_1 := x + y \cdot \frac{t - z}{t}\\ \mathbf{if}\;t \leq -1700000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{-107}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{+82} \lor \neg \left(t \leq 10^{+231}\right):\\ \;\;\;\;x - y \cdot \frac{t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error9.3
Cost841
\[\begin{array}{l} \mathbf{if}\;t \leq -0.00031 \lor \neg \left(t \leq 1.26 \cdot 10^{-105}\right):\\ \;\;\;\;x - y \cdot \frac{t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\ \end{array} \]
Alternative 5
Error12.6
Cost840
\[\begin{array}{l} \mathbf{if}\;t \leq -1350000000000:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{+32}:\\ \;\;\;\;x + \frac{z - t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 6
Error19.5
Cost720
\[\begin{array}{l} \mathbf{if}\;t \leq -2.9 \cdot 10^{-32}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 2.35 \cdot 10^{-284}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{-246}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq 9 \cdot 10^{-19}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 7
Error19.5
Cost720
\[\begin{array}{l} \mathbf{if}\;t \leq -2.7 \cdot 10^{-32}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.32 \cdot 10^{-285}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-246}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 3.15 \cdot 10^{-21}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 8
Error13.6
Cost713
\[\begin{array}{l} \mathbf{if}\;t \leq -2.4 \cdot 10^{+32} \lor \neg \left(t \leq 2.35 \cdot 10^{-21}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \end{array} \]
Alternative 9
Error19.0
Cost456
\[\begin{array}{l} \mathbf{if}\;t \leq -1.1 \cdot 10^{-33}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 2 \cdot 10^{-21}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 10
Error26.4
Cost328
\[\begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{+122}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 2.35 \cdot 10^{+128}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 11
Error28.3
Cost64
\[x \]

Error

Reproduce?

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