Average Error: 11.0 → 1.1
Time: 48.2s
Precision: binary64
Cost: 704
\[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
\[x + \frac{y}{\frac{a - t}{z - 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 (/ (- a t) (- z 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 / ((a - t) / (z - 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 / ((a - t) / (z - 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 / ((a - t) / (z - 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 / ((a - t) / (z - t)))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t)))
end
function code(x, y, z, t, a)
	return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - 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 / ((a - t) / (z - t)));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y \cdot \left(z - t\right)}{a - t}
x + \frac{y}{\frac{a - t}{z - t}}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original11.0
Target1.1
Herbie1.1
\[x + \frac{y}{\frac{a - t}{z - t}} \]

Derivation

  1. Initial program 11.0

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

    \[\leadsto \color{blue}{x + \frac{y}{\frac{a - t}{z - t}}} \]
    Proof
    (+.f64 x (/.f64 y (/.f64 (-.f64 a t) (-.f64 z t)))): 0 points increase in error, 0 points decrease in error
    (+.f64 x (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)))): 49 points increase in error, 15 points decrease in error
  3. Final simplification1.1

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

Alternatives

Alternative 1
Error18.7
Cost1368
\[\begin{array}{l} t_1 := y \cdot \frac{z - t}{a - t}\\ \mathbf{if}\;x \leq -4.4 \cdot 10^{-18}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;x \leq -1.56 \cdot 10^{-167}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.05 \cdot 10^{-184}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;x \leq 2.45 \cdot 10^{-214}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.25 \cdot 10^{-72}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{+67}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 2
Error18.7
Cost1368
\[\begin{array}{l} t_1 := y \cdot \frac{z - t}{a - t}\\ \mathbf{if}\;x \leq -2.3 \cdot 10^{-25}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;x \leq -2.6 \cdot 10^{-167}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.05 \cdot 10^{-184}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;x \leq 2.45 \cdot 10^{-214}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{-72}:\\ \;\;\;\;x + \left(y \cdot z\right) \cdot \frac{1}{a}\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{+67}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 3
Error15.8
Cost1368
\[\begin{array}{l} t_1 := y \cdot \frac{z - t}{a - t}\\ \mathbf{if}\;t \leq -2.4 \cdot 10^{+37}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-15}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -8.8 \cdot 10^{-72}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.06 \cdot 10^{-134}:\\ \;\;\;\;x + \frac{z - t}{\frac{a}{y}}\\ \mathbf{elif}\;t \leq 5.1 \cdot 10^{+35}:\\ \;\;\;\;x - y \cdot \frac{z}{t}\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{+60}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 4
Error13.1
Cost1104
\[\begin{array}{l} t_1 := x + \frac{z - t}{\frac{a}{y}}\\ \mathbf{if}\;a \leq -6 \cdot 10^{+83}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 70000000000:\\ \;\;\;\;x + \frac{y}{t} \cdot \left(t - z\right)\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{+53}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{+95}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error12.2
Cost1104
\[\begin{array}{l} t_1 := x + \frac{z - t}{\frac{a}{y}}\\ \mathbf{if}\;a \leq -2.9 \cdot 10^{+84}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 80000000000:\\ \;\;\;\;x + y \cdot \frac{t - z}{t}\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{+53}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{+96}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error20.2
Cost844
\[\begin{array}{l} \mathbf{if}\;t \leq -3.3 \cdot 10^{-71}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{-259}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{-227}:\\ \;\;\;\;y \cdot \frac{z}{a - t}\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{-28}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 7
Error16.1
Cost844
\[\begin{array}{l} \mathbf{if}\;t \leq -1.45 \cdot 10^{-50}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.06 \cdot 10^{-134}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{+113}:\\ \;\;\;\;x - y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 8
Error20.1
Cost720
\[\begin{array}{l} \mathbf{if}\;t \leq -1.65 \cdot 10^{-67}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 6 \cdot 10^{-252}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-227}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq 1.46 \cdot 10^{-30}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 9
Error20.1
Cost720
\[\begin{array}{l} \mathbf{if}\;t \leq -3.7 \cdot 10^{-69}:\\ \;\;\;\;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 7.2 \cdot 10^{-28}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 10
Error14.8
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -1.65 \cdot 10^{-72}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-28}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 11
Error15.1
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{-52}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{-29}:\\ \;\;\;\;x + \frac{y \cdot z}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
Alternative 12
Error3.0
Cost704
\[x + \left(z - t\right) \cdot \frac{y}{a - t} \]
Alternative 13
Error20.0
Cost456
\[\begin{array}{l} \mathbf{if}\;a \leq -5.5 \cdot 10^{+112}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.38 \cdot 10^{+156}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 14
Error27.9
Cost328
\[\begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{+79}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+70}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
Alternative 15
Error29.3
Cost64
\[x \]

Error

Reproduce

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

  :herbie-target
  (+ x (/ y (/ (- a t) (- z t))))

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