Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B

Percentage Accurate: 98.3% → 98.3%
Time: 6.9s
Alternatives: 8
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x + y \cdot \frac{z - t}{a - t} \end{array} \]
(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)));
}
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)));
}
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 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]
\begin{array}{l}

\\
x + y \cdot \frac{z - t}{a - t}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 98.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + y \cdot \frac{z - t}{a - t} \end{array} \]
(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)));
}
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)));
}
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 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]
\begin{array}{l}

\\
x + y \cdot \frac{z - t}{a - t}
\end{array}

Alternative 1: 98.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + y \cdot \frac{z - t}{a - t} \end{array} \]
(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)));
}
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)));
}
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 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]
\begin{array}{l}

\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Derivation
  1. Initial program 99.2%

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

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

Alternative 2: 75.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{z}{a}\\ \mathbf{if}\;t \leq -4.5 \cdot 10^{-74}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{-92}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-24}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;t \leq 49:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* y (/ z a)))))
   (if (<= t -4.5e-74)
     (+ x y)
     (if (<= t 1.45e-92)
       t_1
       (if (<= t 4.5e-24) (- x (/ y (/ t z))) (if (<= t 49.0) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (z / a));
	double tmp;
	if (t <= -4.5e-74) {
		tmp = x + y;
	} else if (t <= 1.45e-92) {
		tmp = t_1;
	} else if (t <= 4.5e-24) {
		tmp = x - (y / (t / z));
	} else if (t <= 49.0) {
		tmp = t_1;
	} else {
		tmp = x + y;
	}
	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
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (y * (z / a))
    if (t <= (-4.5d-74)) then
        tmp = x + y
    else if (t <= 1.45d-92) then
        tmp = t_1
    else if (t <= 4.5d-24) then
        tmp = x - (y / (t / z))
    else if (t <= 49.0d0) then
        tmp = t_1
    else
        tmp = x + y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (z / a));
	double tmp;
	if (t <= -4.5e-74) {
		tmp = x + y;
	} else if (t <= 1.45e-92) {
		tmp = t_1;
	} else if (t <= 4.5e-24) {
		tmp = x - (y / (t / z));
	} else if (t <= 49.0) {
		tmp = t_1;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * (z / a))
	tmp = 0
	if t <= -4.5e-74:
		tmp = x + y
	elif t <= 1.45e-92:
		tmp = t_1
	elif t <= 4.5e-24:
		tmp = x - (y / (t / z))
	elif t <= 49.0:
		tmp = t_1
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y * Float64(z / a)))
	tmp = 0.0
	if (t <= -4.5e-74)
		tmp = Float64(x + y);
	elseif (t <= 1.45e-92)
		tmp = t_1;
	elseif (t <= 4.5e-24)
		tmp = Float64(x - Float64(y / Float64(t / z)));
	elseif (t <= 49.0)
		tmp = t_1;
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y * (z / a));
	tmp = 0.0;
	if (t <= -4.5e-74)
		tmp = x + y;
	elseif (t <= 1.45e-92)
		tmp = t_1;
	elseif (t <= 4.5e-24)
		tmp = x - (y / (t / z));
	elseif (t <= 49.0)
		tmp = t_1;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.5e-74], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.45e-92], t$95$1, If[LessEqual[t, 4.5e-24], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 49.0], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{a}\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{-74}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;t \leq 1.45 \cdot 10^{-92}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 4.5 \cdot 10^{-24}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\

\mathbf{elif}\;t \leq 49:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;x + y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.4999999999999999e-74 or 49 < t

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around inf 81.2%

      \[\leadsto \color{blue}{y + x} \]

    if -4.4999999999999999e-74 < t < 1.44999999999999992e-92 or 4.4999999999999997e-24 < t < 49

    1. Initial program 98.0%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around 0 87.3%

      \[\leadsto x + y \cdot \color{blue}{\frac{z}{a}} \]

    if 1.44999999999999992e-92 < t < 4.4999999999999997e-24

    1. Initial program 99.6%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in a around 0 89.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{\left(z - t\right) \cdot y}{t} + x} \]
    3. Step-by-step derivation
      1. +-commutative89.7%

        \[\leadsto \color{blue}{x + -1 \cdot \frac{\left(z - t\right) \cdot y}{t}} \]
      2. mul-1-neg89.7%

        \[\leadsto x + \color{blue}{\left(-\frac{\left(z - t\right) \cdot y}{t}\right)} \]
      3. unsub-neg89.7%

        \[\leadsto \color{blue}{x - \frac{\left(z - t\right) \cdot y}{t}} \]
      4. associate-/l*84.9%

        \[\leadsto x - \color{blue}{\frac{z - t}{\frac{t}{y}}} \]
    4. Simplified84.9%

      \[\leadsto \color{blue}{x - \frac{z - t}{\frac{t}{y}}} \]
    5. Taylor expanded in z around inf 66.8%

      \[\leadsto x - \color{blue}{\frac{y \cdot z}{t}} \]
    6. Step-by-step derivation
      1. associate-/l*66.8%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
    7. Simplified66.8%

      \[\leadsto x - \color{blue}{\frac{y}{\frac{t}{z}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.5 \cdot 10^{-74}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{-92}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-24}:\\ \;\;\;\;x - \frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;t \leq 49:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 3: 84.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -6.3 \cdot 10^{+66} \lor \neg \left(t \leq 5.5 \cdot 10^{+149}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{a - t}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= t -6.3e+66) (not (<= t 5.5e+149)))
   (+ x y)
   (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -6.3e+66) || !(t <= 5.5e+149)) {
		tmp = x + y;
	} else {
		tmp = x + (y * (z / (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
    real(8) :: tmp
    if ((t <= (-6.3d+66)) .or. (.not. (t <= 5.5d+149))) then
        tmp = x + y
    else
        tmp = x + (y * (z / (a - t)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -6.3e+66) || !(t <= 5.5e+149)) {
		tmp = x + y;
	} else {
		tmp = x + (y * (z / (a - t)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -6.3e+66) or not (t <= 5.5e+149):
		tmp = x + y
	else:
		tmp = x + (y * (z / (a - t)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((t <= -6.3e+66) || !(t <= 5.5e+149))
		tmp = Float64(x + y);
	else
		tmp = Float64(x + Float64(y * Float64(z / Float64(a - t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((t <= -6.3e+66) || ~((t <= 5.5e+149)))
		tmp = x + y;
	else
		tmp = x + (y * (z / (a - t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.3e+66], N[Not[LessEqual[t, 5.5e+149]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.3 \cdot 10^{+66} \lor \neg \left(t \leq 5.5 \cdot 10^{+149}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.2999999999999998e66 or 5.49999999999999999e149 < t

    1. Initial program 100.0%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around inf 88.0%

      \[\leadsto \color{blue}{y + x} \]

    if -6.2999999999999998e66 < t < 5.49999999999999999e149

    1. Initial program 98.7%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in z around inf 85.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.3 \cdot 10^{+66} \lor \neg \left(t \leq 5.5 \cdot 10^{+149}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{a - t}\\ \end{array} \]

Alternative 4: 82.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{-24} \lor \neg \left(t \leq 1.45 \cdot 10^{-92}\right):\\ \;\;\;\;x + \left(y - \frac{y}{\frac{t}{z}}\right)\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{t - z}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= t -1.3e-24) (not (<= t 1.45e-92)))
   (+ x (- y (/ y (/ t z))))
   (- x (* y (/ (- t z) a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -1.3e-24) || !(t <= 1.45e-92)) {
		tmp = x + (y - (y / (t / z)));
	} else {
		tmp = x - (y * ((t - z) / a));
	}
	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
    real(8) :: tmp
    if ((t <= (-1.3d-24)) .or. (.not. (t <= 1.45d-92))) then
        tmp = x + (y - (y / (t / z)))
    else
        tmp = x - (y * ((t - z) / a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -1.3e-24) || !(t <= 1.45e-92)) {
		tmp = x + (y - (y / (t / z)));
	} else {
		tmp = x - (y * ((t - z) / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -1.3e-24) or not (t <= 1.45e-92):
		tmp = x + (y - (y / (t / z)))
	else:
		tmp = x - (y * ((t - z) / a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((t <= -1.3e-24) || !(t <= 1.45e-92))
		tmp = Float64(x + Float64(y - Float64(y / Float64(t / z))));
	else
		tmp = Float64(x - Float64(y * Float64(Float64(t - z) / a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((t <= -1.3e-24) || ~((t <= 1.45e-92)))
		tmp = x + (y - (y / (t / z)));
	else
		tmp = x - (y * ((t - z) / a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.3e-24], N[Not[LessEqual[t, 1.45e-92]], $MachinePrecision]], N[(x + N[(y - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{-24} \lor \neg \left(t \leq 1.45 \cdot 10^{-92}\right):\\
\;\;\;\;x + \left(y - \frac{y}{\frac{t}{z}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.3e-24 or 1.44999999999999992e-92 < t

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in a around 0 73.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{\left(z - t\right) \cdot y}{t} + x} \]
    3. Step-by-step derivation
      1. +-commutative73.6%

        \[\leadsto \color{blue}{x + -1 \cdot \frac{\left(z - t\right) \cdot y}{t}} \]
      2. mul-1-neg73.6%

        \[\leadsto x + \color{blue}{\left(-\frac{\left(z - t\right) \cdot y}{t}\right)} \]
      3. unsub-neg73.6%

        \[\leadsto \color{blue}{x - \frac{\left(z - t\right) \cdot y}{t}} \]
      4. associate-/l*83.5%

        \[\leadsto x - \color{blue}{\frac{z - t}{\frac{t}{y}}} \]
    4. Simplified83.5%

      \[\leadsto \color{blue}{x - \frac{z - t}{\frac{t}{y}}} \]
    5. Taylor expanded in z around 0 84.6%

      \[\leadsto x - \color{blue}{\left(\frac{y \cdot z}{t} + -1 \cdot y\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg84.6%

        \[\leadsto x - \left(\frac{y \cdot z}{t} + \color{blue}{\left(-y\right)}\right) \]
      2. unsub-neg84.6%

        \[\leadsto x - \color{blue}{\left(\frac{y \cdot z}{t} - y\right)} \]
      3. associate-/l*89.5%

        \[\leadsto x - \left(\color{blue}{\frac{y}{\frac{t}{z}}} - y\right) \]
    7. Simplified89.5%

      \[\leadsto x - \color{blue}{\left(\frac{y}{\frac{t}{z}} - y\right)} \]

    if -1.3e-24 < t < 1.44999999999999992e-92

    1. Initial program 98.0%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in a around inf 90.2%

      \[\leadsto x + y \cdot \color{blue}{\frac{z - t}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{-24} \lor \neg \left(t \leq 1.45 \cdot 10^{-92}\right):\\ \;\;\;\;x + \left(y - \frac{y}{\frac{t}{z}}\right)\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{t - z}{a}\\ \end{array} \]

Alternative 5: 75.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.8 \cdot 10^{-75}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{-89}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= t -3.8e-75) (+ x y) (if (<= t 3.5e-89) (+ x (* y (/ z a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= -3.8e-75) {
		tmp = x + y;
	} else if (t <= 3.5e-89) {
		tmp = x + (y * (z / a));
	} else {
		tmp = x + y;
	}
	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
    real(8) :: tmp
    if (t <= (-3.8d-75)) then
        tmp = x + y
    else if (t <= 3.5d-89) then
        tmp = x + (y * (z / a))
    else
        tmp = x + y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= -3.8e-75) {
		tmp = x + y;
	} else if (t <= 3.5e-89) {
		tmp = x + (y * (z / a));
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if t <= -3.8e-75:
		tmp = x + y
	elif t <= 3.5e-89:
		tmp = x + (y * (z / a))
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (t <= -3.8e-75)
		tmp = Float64(x + y);
	elseif (t <= 3.5e-89)
		tmp = Float64(x + Float64(y * Float64(z / a)));
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= -3.8e-75)
		tmp = x + y;
	elseif (t <= 3.5e-89)
		tmp = x + (y * (z / a));
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.8e-75], N[(x + y), $MachinePrecision], If[LessEqual[t, 3.5e-89], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{-75}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;t \leq 3.5 \cdot 10^{-89}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\

\mathbf{else}:\\
\;\;\;\;x + y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.79999999999999994e-75 or 3.4999999999999997e-89 < t

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around inf 77.7%

      \[\leadsto \color{blue}{y + x} \]

    if -3.79999999999999994e-75 < t < 3.4999999999999997e-89

    1. Initial program 97.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around 0 85.8%

      \[\leadsto x + y \cdot \color{blue}{\frac{z}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification80.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.8 \cdot 10^{-75}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{-89}:\\ \;\;\;\;x + y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 6: 62.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5.5 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{+51}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -5.5e+39) x (if (<= a 5.4e+51) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -5.5e+39) {
		tmp = x;
	} else if (a <= 5.4e+51) {
		tmp = x + y;
	} else {
		tmp = x;
	}
	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
    real(8) :: tmp
    if (a <= (-5.5d+39)) then
        tmp = x
    else if (a <= 5.4d+51) then
        tmp = x + y
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -5.5e+39) {
		tmp = x;
	} else if (a <= 5.4e+51) {
		tmp = x + y;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -5.5e+39:
		tmp = x
	elif a <= 5.4e+51:
		tmp = x + y
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -5.5e+39)
		tmp = x;
	elseif (a <= 5.4e+51)
		tmp = Float64(x + y);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -5.5e+39)
		tmp = x;
	elseif (a <= 5.4e+51)
		tmp = x + y;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.5e+39], x, If[LessEqual[a, 5.4e+51], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+39}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 5.4 \cdot 10^{+51}:\\
\;\;\;\;x + y\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.4999999999999997e39 or 5.39999999999999983e51 < a

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in x around inf 70.8%

      \[\leadsto \color{blue}{x} \]

    if -5.4999999999999997e39 < a < 5.39999999999999983e51

    1. Initial program 98.7%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in t around inf 65.8%

      \[\leadsto \color{blue}{y + x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification67.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.5 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{+51}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 7: 53.1% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{+218}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+188}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= y -3.5e+218) y (if (<= y 7.2e+188) x y)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -3.5e+218) {
		tmp = y;
	} else if (y <= 7.2e+188) {
		tmp = x;
	} else {
		tmp = y;
	}
	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
    real(8) :: tmp
    if (y <= (-3.5d+218)) then
        tmp = y
    else if (y <= 7.2d+188) then
        tmp = x
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -3.5e+218) {
		tmp = y;
	} else if (y <= 7.2e+188) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if y <= -3.5e+218:
		tmp = y
	elif y <= 7.2e+188:
		tmp = x
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -3.5e+218)
		tmp = y;
	elseif (y <= 7.2e+188)
		tmp = x;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (y <= -3.5e+218)
		tmp = y;
	elseif (y <= 7.2e+188)
		tmp = x;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.5e+218], y, If[LessEqual[y, 7.2e+188], x, y]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+218}:\\
\;\;\;\;y\\

\mathbf{elif}\;y \leq 7.2 \cdot 10^{+188}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.50000000000000019e218 or 7.20000000000000041e188 < y

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in x around 0 51.1%

      \[\leadsto \color{blue}{\frac{\left(z - t\right) \cdot y}{a - t}} \]
    3. Taylor expanded in t around inf 45.2%

      \[\leadsto \color{blue}{y} \]

    if -3.50000000000000019e218 < y < 7.20000000000000041e188

    1. Initial program 99.0%

      \[x + y \cdot \frac{z - t}{a - t} \]
    2. Taylor expanded in x around inf 59.2%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{+218}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+188}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 8: 50.7% accurate, 11.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
	return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
	return x;
}
def code(x, y, z, t, a):
	return x
function code(x, y, z, t, a)
	return x
end
function tmp = code(x, y, z, t, a)
	tmp = x;
end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 99.2%

    \[x + y \cdot \frac{z - t}{a - t} \]
  2. Taylor expanded in x around inf 51.1%

    \[\leadsto \color{blue}{x} \]
  3. Final simplification51.1%

    \[\leadsto x \]

Developer target: 99.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{z - t}{a - t}\\ \mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
   (if (< y -8.508084860551241e-17)
     t_1
     (if (< y 2.894426862792089e-49)
       (+ x (* (* y (- z t)) (/ 1.0 (- a t))))
       t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * ((z - t) / (a - t)));
	double tmp;
	if (y < -8.508084860551241e-17) {
		tmp = t_1;
	} else if (y < 2.894426862792089e-49) {
		tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
	} else {
		tmp = t_1;
	}
	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
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (y * ((z - t) / (a - t)))
    if (y < (-8.508084860551241d-17)) then
        tmp = t_1
    else if (y < 2.894426862792089d-49) then
        tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * ((z - t) / (a - t)));
	double tmp;
	if (y < -8.508084860551241e-17) {
		tmp = t_1;
	} else if (y < 2.894426862792089e-49) {
		tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * ((z - t) / (a - t)))
	tmp = 0
	if y < -8.508084860551241e-17:
		tmp = t_1
	elif y < 2.894426862792089e-49:
		tmp = x + ((y * (z - t)) * (1.0 / (a - t)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t))))
	tmp = 0.0
	if (y < -8.508084860551241e-17)
		tmp = t_1;
	elseif (y < 2.894426862792089e-49)
		tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y * ((z - t) / (a - t)));
	tmp = 0.0;
	if (y < -8.508084860551241e-17)
		tmp = t_1;
	elseif (y < 2.894426862792089e-49)
		tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}

Reproduce

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