Average Error: 11.4 → 0.5
Time: 12.2s
Precision: binary64
Cost: 1097
\[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
\[\begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{-93} \lor \neg \left(y \leq 2 \cdot 10^{-54}\right):\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{y}{\frac{1}{z - t}}}{a - t}\\ \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= y -4e-93) (not (<= y 2e-54)))
   (+ x (/ y (/ (- a t) (- z t))))
   (+ x (/ (/ y (/ 1.0 (- 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) {
	double tmp;
	if ((y <= -4e-93) || !(y <= 2e-54)) {
		tmp = x + (y / ((a - t) / (z - t)));
	} else {
		tmp = x + ((y / (1.0 / (z - t))) / (a - t));
	}
	return tmp;
}
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
    real(8) :: tmp
    if ((y <= (-4d-93)) .or. (.not. (y <= 2d-54))) then
        tmp = x + (y / ((a - t) / (z - t)))
    else
        tmp = x + ((y / (1.0d0 / (z - t))) / (a - t))
    end if
    code = tmp
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) {
	double tmp;
	if ((y <= -4e-93) || !(y <= 2e-54)) {
		tmp = x + (y / ((a - t) / (z - t)));
	} else {
		tmp = x + ((y / (1.0 / (z - t))) / (a - t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	return x + ((y * (z - t)) / (a - t))
def code(x, y, z, t, a):
	tmp = 0
	if (y <= -4e-93) or not (y <= 2e-54):
		tmp = x + (y / ((a - t) / (z - t)))
	else:
		tmp = x + ((y / (1.0 / (z - t))) / (a - t))
	return tmp
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)
	tmp = 0.0
	if ((y <= -4e-93) || !(y <= 2e-54))
		tmp = Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t))));
	else
		tmp = Float64(x + Float64(Float64(y / Float64(1.0 / Float64(z - t))) / Float64(a - t)));
	end
	return tmp
end
function tmp = code(x, y, z, t, a)
	tmp = x + ((y * (z - t)) / (a - t));
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((y <= -4e-93) || ~((y <= 2e-54)))
		tmp = x + (y / ((a - t) / (z - t)));
	else
		tmp = x + ((y / (1.0 / (z - t))) / (a - t));
	end
	tmp_2 = tmp;
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_] := If[Or[LessEqual[y, -4e-93], N[Not[LessEqual[y, 2e-54]], $MachinePrecision]], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / N[(1.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{-93} \lor \neg \left(y \leq 2 \cdot 10^{-54}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{y}{\frac{1}{z - t}}}{a - t}\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original11.4
Target1.2
Herbie0.5
\[x + \frac{y}{\frac{a - t}{z - t}} \]

Derivation

  1. Split input into 2 regimes
  2. if y < -3.9999999999999996e-93 or 2.0000000000000001e-54 < y

    1. Initial program 18.9

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

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

      [Start]18.9

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

      associate-/l* [=>]0.7

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

    if -3.9999999999999996e-93 < y < 2.0000000000000001e-54

    1. Initial program 0.3

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Applied egg-rr0.4

      \[\leadsto x + \frac{\color{blue}{\frac{y}{\frac{1}{z - t}}}}{a - t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{-93} \lor \neg \left(y \leq 2 \cdot 10^{-54}\right):\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{y}{\frac{1}{z - t}}}{a - t}\\ \end{array} \]

Alternatives

Alternative 1
Error0.5
Cost969
\[\begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{-19} \lor \neg \left(y \leq 10^{-67}\right):\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \end{array} \]
Alternative 2
Error10.7
Cost841
\[\begin{array}{l} \mathbf{if}\;t \leq -1.5 \cdot 10^{+44} \lor \neg \left(t \leq 6.5 \cdot 10^{+78}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{a - t}\\ \end{array} \]
Alternative 3
Error8.6
Cost841
\[\begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+32} \lor \neg \left(z \leq 6.2 \cdot 10^{-24}\right):\\ \;\;\;\;x + y \cdot \frac{z}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\ \end{array} \]
Alternative 4
Error10.4
Cost840
\[\begin{array}{l} \mathbf{if}\;t \leq -5.4 \cdot 10^{+42}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{+65}:\\ \;\;\;\;x + y \cdot \frac{z}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x - \left(z - t\right) \cdot \frac{y}{t}\\ \end{array} \]
Alternative 5
Error23.0
Cost713
\[\begin{array}{l} \mathbf{if}\;x \leq -4.4 \cdot 10^{-193} \lor \neg \left(x \leq 3.2 \cdot 10^{-157}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{a - t}\\ \end{array} \]
Alternative 6
Error22.8
Cost713
\[\begin{array}{l} \mathbf{if}\;x \leq -1.85 \cdot 10^{-193} \lor \neg \left(x \leq 4.8 \cdot 10^{-157}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{a - t}\\ \end{array} \]
Alternative 7
Error14.6
Cost713
\[\begin{array}{l} \mathbf{if}\;t \leq -9.5 \cdot 10^{-95} \lor \neg \left(t \leq 1.7 \cdot 10^{+48}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{z}}\\ \end{array} \]
Alternative 8
Error14.6
Cost712
\[\begin{array}{l} \mathbf{if}\;t \leq -3.7 \cdot 10^{-73}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{-60}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
Alternative 9
Error3.0
Cost704
\[x + \left(z - t\right) \cdot \frac{y}{a - t} \]
Alternative 10
Error1.2
Cost704
\[x + \frac{y}{\frac{a - t}{z - t}} \]
Alternative 11
Error19.6
Cost456
\[\begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{-81}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 8.6 \cdot 10^{-69}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
Alternative 12
Error26.9
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -3.1 \cdot 10^{-110}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-153}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 13
Error28.8
Cost64
\[x \]

Error

Reproduce

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