Rosa's DopplerBench

Percentage Accurate: 72.8% → 98.0%
Time: 9.7s
Alternatives: 11
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\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 11 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: 72.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}

Alternative 1: 98.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u} \end{array} \]
(FPCore (u v t1) :precision binary64 (* (/ (- t1) (+ t1 u)) (/ v (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 / (t1 + u)) * (v / (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 / (t1 + u)) * (v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 / (t1 + u)) * (v / (t1 + u));
}
def code(u, v, t1):
	return (-t1 / (t1 + u)) * (v / (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) / Float64(t1 + u)) * Float64(v / Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 / (t1 + u)) * (v / (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}
\end{array}
Derivation
  1. Initial program 72.4%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac98.0%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  3. Simplified98.0%

    \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  4. Add Preprocessing
  5. Final simplification98.0%

    \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u} \]
  6. Add Preprocessing

Alternative 2: 79.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -4.8 \cdot 10^{+24} \lor \neg \left(t1 \leq -2.5 \cdot 10^{-19}\right) \land \left(t1 \leq -2.5 \cdot 10^{-45} \lor \neg \left(t1 \leq 6.2 \cdot 10^{-73}\right)\right):\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -4.8e+24)
         (and (not (<= t1 -2.5e-19))
              (or (<= t1 -2.5e-45) (not (<= t1 6.2e-73)))))
   (/ (- v) (+ t1 u))
   (* (/ (- t1) u) (/ v u))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -4.8e+24) || (!(t1 <= -2.5e-19) && ((t1 <= -2.5e-45) || !(t1 <= 6.2e-73)))) {
		tmp = -v / (t1 + u);
	} else {
		tmp = (-t1 / u) * (v / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-4.8d+24)) .or. (.not. (t1 <= (-2.5d-19))) .and. (t1 <= (-2.5d-45)) .or. (.not. (t1 <= 6.2d-73))) then
        tmp = -v / (t1 + u)
    else
        tmp = (-t1 / u) * (v / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -4.8e+24) || (!(t1 <= -2.5e-19) && ((t1 <= -2.5e-45) || !(t1 <= 6.2e-73)))) {
		tmp = -v / (t1 + u);
	} else {
		tmp = (-t1 / u) * (v / u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -4.8e+24) or (not (t1 <= -2.5e-19) and ((t1 <= -2.5e-45) or not (t1 <= 6.2e-73))):
		tmp = -v / (t1 + u)
	else:
		tmp = (-t1 / u) * (v / u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -4.8e+24) || (!(t1 <= -2.5e-19) && ((t1 <= -2.5e-45) || !(t1 <= 6.2e-73))))
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	else
		tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -4.8e+24) || (~((t1 <= -2.5e-19)) && ((t1 <= -2.5e-45) || ~((t1 <= 6.2e-73)))))
		tmp = -v / (t1 + u);
	else
		tmp = (-t1 / u) * (v / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -4.8e+24], And[N[Not[LessEqual[t1, -2.5e-19]], $MachinePrecision], Or[LessEqual[t1, -2.5e-45], N[Not[LessEqual[t1, 6.2e-73]], $MachinePrecision]]]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -4.8 \cdot 10^{+24} \lor \neg \left(t1 \leq -2.5 \cdot 10^{-19}\right) \land \left(t1 \leq -2.5 \cdot 10^{-45} \lor \neg \left(t1 \leq 6.2 \cdot 10^{-73}\right)\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\

\mathbf{else}:\\
\;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -4.8000000000000001e24 or -2.5000000000000002e-19 < t1 < -2.49999999999999988e-45 or 6.19999999999999938e-73 < t1

    1. Initial program 67.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 83.7%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]

    if -4.8000000000000001e24 < t1 < -2.5000000000000002e-19 or -2.49999999999999988e-45 < t1 < 6.19999999999999938e-73

    1. Initial program 78.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac95.6%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified95.6%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 78.2%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/78.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. neg-mul-178.2%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    7. Simplified78.2%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Taylor expanded in t1 around 0 82.0%

      \[\leadsto \frac{-t1}{u} \cdot \color{blue}{\frac{v}{u}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -4.8 \cdot 10^{+24} \lor \neg \left(t1 \leq -2.5 \cdot 10^{-19}\right) \land \left(t1 \leq -2.5 \cdot 10^{-45} \lor \neg \left(t1 \leq 6.2 \cdot 10^{-73}\right)\right):\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 78.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-v}{t1 + u}\\ t_2 := \frac{-t1}{u} \cdot \frac{v}{u}\\ \mathbf{if}\;t1 \leq -4.3 \cdot 10^{+27}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq -3.6 \cdot 10^{-19}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t1 \leq -8.8 \cdot 10^{-45}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq 3.65 \cdot 10^{-72}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (- v) (+ t1 u))) (t_2 (* (/ (- t1) u) (/ v u))))
   (if (<= t1 -4.3e+27)
     t_1
     (if (<= t1 -3.6e-19)
       t_2
       (if (<= t1 -8.8e-45)
         t_1
         (if (<= t1 3.65e-72) t_2 (/ -1.0 (/ (+ t1 u) v))))))))
double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + u);
	double t_2 = (-t1 / u) * (v / u);
	double tmp;
	if (t1 <= -4.3e+27) {
		tmp = t_1;
	} else if (t1 <= -3.6e-19) {
		tmp = t_2;
	} else if (t1 <= -8.8e-45) {
		tmp = t_1;
	} else if (t1 <= 3.65e-72) {
		tmp = t_2;
	} else {
		tmp = -1.0 / ((t1 + u) / v);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = -v / (t1 + u)
    t_2 = (-t1 / u) * (v / u)
    if (t1 <= (-4.3d+27)) then
        tmp = t_1
    else if (t1 <= (-3.6d-19)) then
        tmp = t_2
    else if (t1 <= (-8.8d-45)) then
        tmp = t_1
    else if (t1 <= 3.65d-72) then
        tmp = t_2
    else
        tmp = (-1.0d0) / ((t1 + u) / v)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + u);
	double t_2 = (-t1 / u) * (v / u);
	double tmp;
	if (t1 <= -4.3e+27) {
		tmp = t_1;
	} else if (t1 <= -3.6e-19) {
		tmp = t_2;
	} else if (t1 <= -8.8e-45) {
		tmp = t_1;
	} else if (t1 <= 3.65e-72) {
		tmp = t_2;
	} else {
		tmp = -1.0 / ((t1 + u) / v);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -v / (t1 + u)
	t_2 = (-t1 / u) * (v / u)
	tmp = 0
	if t1 <= -4.3e+27:
		tmp = t_1
	elif t1 <= -3.6e-19:
		tmp = t_2
	elif t1 <= -8.8e-45:
		tmp = t_1
	elif t1 <= 3.65e-72:
		tmp = t_2
	else:
		tmp = -1.0 / ((t1 + u) / v)
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-v) / Float64(t1 + u))
	t_2 = Float64(Float64(Float64(-t1) / u) * Float64(v / u))
	tmp = 0.0
	if (t1 <= -4.3e+27)
		tmp = t_1;
	elseif (t1 <= -3.6e-19)
		tmp = t_2;
	elseif (t1 <= -8.8e-45)
		tmp = t_1;
	elseif (t1 <= 3.65e-72)
		tmp = t_2;
	else
		tmp = Float64(-1.0 / Float64(Float64(t1 + u) / v));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -v / (t1 + u);
	t_2 = (-t1 / u) * (v / u);
	tmp = 0.0;
	if (t1 <= -4.3e+27)
		tmp = t_1;
	elseif (t1 <= -3.6e-19)
		tmp = t_2;
	elseif (t1 <= -8.8e-45)
		tmp = t_1;
	elseif (t1 <= 3.65e-72)
		tmp = t_2;
	else
		tmp = -1.0 / ((t1 + u) / v);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -4.3e+27], t$95$1, If[LessEqual[t1, -3.6e-19], t$95$2, If[LessEqual[t1, -8.8e-45], t$95$1, If[LessEqual[t1, 3.65e-72], t$95$2, N[(-1.0 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
t_2 := \frac{-t1}{u} \cdot \frac{v}{u}\\
\mathbf{if}\;t1 \leq -4.3 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t1 \leq -3.6 \cdot 10^{-19}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t1 \leq -8.8 \cdot 10^{-45}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t1 \leq 3.65 \cdot 10^{-72}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -4.30000000000000008e27 or -3.6000000000000001e-19 < t1 < -8.79999999999999974e-45

    1. Initial program 59.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 86.7%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]

    if -4.30000000000000008e27 < t1 < -3.6000000000000001e-19 or -8.79999999999999974e-45 < t1 < 3.65000000000000001e-72

    1. Initial program 78.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac95.6%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified95.6%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 78.2%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/78.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. neg-mul-178.2%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    7. Simplified78.2%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Taylor expanded in t1 around 0 82.0%

      \[\leadsto \frac{-t1}{u} \cdot \color{blue}{\frac{v}{u}} \]

    if 3.65000000000000001e-72 < t1

    1. Initial program 74.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.1%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
      2. associate-/r/99.7%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\left(\frac{1}{t1 + u} \cdot v\right)} \]
    6. Applied egg-rr99.7%

      \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\left(\frac{1}{t1 + u} \cdot v\right)} \]
    7. Taylor expanded in t1 around inf 80.5%

      \[\leadsto \color{blue}{-1} \cdot \left(\frac{1}{t1 + u} \cdot v\right) \]
    8. Step-by-step derivation
      1. associate-/r/80.9%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
    9. Applied egg-rr80.9%

      \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification83.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -4.3 \cdot 10^{+27}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{elif}\;t1 \leq -3.6 \cdot 10^{-19}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \mathbf{elif}\;t1 \leq -8.8 \cdot 10^{-45}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{elif}\;t1 \leq 3.65 \cdot 10^{-72}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-v}{t1 + u}\\ \mathbf{if}\;t1 \leq -1.3 \cdot 10^{+25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq -3.9 \cdot 10^{-20}:\\ \;\;\;\;\frac{\frac{t1 \cdot v}{u}}{t1 - u}\\ \mathbf{elif}\;t1 \leq -8 \cdot 10^{-45}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq 6.2 \cdot 10^{-73}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (- v) (+ t1 u))))
   (if (<= t1 -1.3e+25)
     t_1
     (if (<= t1 -3.9e-20)
       (/ (/ (* t1 v) u) (- t1 u))
       (if (<= t1 -8e-45)
         t_1
         (if (<= t1 6.2e-73)
           (* (/ (- t1) u) (/ v u))
           (/ -1.0 (/ (+ t1 u) v))))))))
double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + u);
	double tmp;
	if (t1 <= -1.3e+25) {
		tmp = t_1;
	} else if (t1 <= -3.9e-20) {
		tmp = ((t1 * v) / u) / (t1 - u);
	} else if (t1 <= -8e-45) {
		tmp = t_1;
	} else if (t1 <= 6.2e-73) {
		tmp = (-t1 / u) * (v / u);
	} else {
		tmp = -1.0 / ((t1 + u) / v);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -v / (t1 + u)
    if (t1 <= (-1.3d+25)) then
        tmp = t_1
    else if (t1 <= (-3.9d-20)) then
        tmp = ((t1 * v) / u) / (t1 - u)
    else if (t1 <= (-8d-45)) then
        tmp = t_1
    else if (t1 <= 6.2d-73) then
        tmp = (-t1 / u) * (v / u)
    else
        tmp = (-1.0d0) / ((t1 + u) / v)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + u);
	double tmp;
	if (t1 <= -1.3e+25) {
		tmp = t_1;
	} else if (t1 <= -3.9e-20) {
		tmp = ((t1 * v) / u) / (t1 - u);
	} else if (t1 <= -8e-45) {
		tmp = t_1;
	} else if (t1 <= 6.2e-73) {
		tmp = (-t1 / u) * (v / u);
	} else {
		tmp = -1.0 / ((t1 + u) / v);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -v / (t1 + u)
	tmp = 0
	if t1 <= -1.3e+25:
		tmp = t_1
	elif t1 <= -3.9e-20:
		tmp = ((t1 * v) / u) / (t1 - u)
	elif t1 <= -8e-45:
		tmp = t_1
	elif t1 <= 6.2e-73:
		tmp = (-t1 / u) * (v / u)
	else:
		tmp = -1.0 / ((t1 + u) / v)
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-v) / Float64(t1 + u))
	tmp = 0.0
	if (t1 <= -1.3e+25)
		tmp = t_1;
	elseif (t1 <= -3.9e-20)
		tmp = Float64(Float64(Float64(t1 * v) / u) / Float64(t1 - u));
	elseif (t1 <= -8e-45)
		tmp = t_1;
	elseif (t1 <= 6.2e-73)
		tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u));
	else
		tmp = Float64(-1.0 / Float64(Float64(t1 + u) / v));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -v / (t1 + u);
	tmp = 0.0;
	if (t1 <= -1.3e+25)
		tmp = t_1;
	elseif (t1 <= -3.9e-20)
		tmp = ((t1 * v) / u) / (t1 - u);
	elseif (t1 <= -8e-45)
		tmp = t_1;
	elseif (t1 <= 6.2e-73)
		tmp = (-t1 / u) * (v / u);
	else
		tmp = -1.0 / ((t1 + u) / v);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1.3e+25], t$95$1, If[LessEqual[t1, -3.9e-20], N[(N[(N[(t1 * v), $MachinePrecision] / u), $MachinePrecision] / N[(t1 - u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, -8e-45], t$95$1, If[LessEqual[t1, 6.2e-73], N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -1.3 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t1 \leq -3.9 \cdot 10^{-20}:\\
\;\;\;\;\frac{\frac{t1 \cdot v}{u}}{t1 - u}\\

\mathbf{elif}\;t1 \leq -8 \cdot 10^{-45}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t1 \leq 6.2 \cdot 10^{-73}:\\
\;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t1 < -1.2999999999999999e25 or -3.90000000000000007e-20 < t1 < -7.99999999999999987e-45

    1. Initial program 59.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 86.7%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]

    if -1.2999999999999999e25 < t1 < -3.90000000000000007e-20

    1. Initial program 58.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/l*58.4%

        \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified58.4%

      \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/58.4%

        \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. frac-times99.8%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      3. frac-2neg99.8%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. remove-double-neg99.8%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      5. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{t1 \cdot \frac{v}{t1 + u}}{-\left(t1 + u\right)}} \]
      6. distribute-neg-in99.7%

        \[\leadsto \frac{t1 \cdot \frac{v}{t1 + u}}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      7. add-sqr-sqrt99.5%

        \[\leadsto \frac{t1 \cdot \frac{v}{t1 + u}}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      8. sqrt-unprod99.7%

        \[\leadsto \frac{t1 \cdot \frac{v}{t1 + u}}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      9. sqr-neg99.7%

        \[\leadsto \frac{t1 \cdot \frac{v}{t1 + u}}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      10. sqrt-unprod0.0%

        \[\leadsto \frac{t1 \cdot \frac{v}{t1 + u}}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      11. add-sqr-sqrt88.8%

        \[\leadsto \frac{t1 \cdot \frac{v}{t1 + u}}{\color{blue}{t1} + \left(-u\right)} \]
      12. sub-neg88.8%

        \[\leadsto \frac{t1 \cdot \frac{v}{t1 + u}}{\color{blue}{t1 - u}} \]
    6. Applied egg-rr88.8%

      \[\leadsto \color{blue}{\frac{t1 \cdot \frac{v}{t1 + u}}{t1 - u}} \]
    7. Taylor expanded in t1 around 0 89.1%

      \[\leadsto \frac{\color{blue}{\frac{t1 \cdot v}{u}}}{t1 - u} \]

    if -7.99999999999999987e-45 < t1 < 6.19999999999999938e-73

    1. Initial program 80.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac95.3%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified95.3%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 77.3%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/77.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. neg-mul-177.3%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    7. Simplified77.3%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Taylor expanded in t1 around 0 81.4%

      \[\leadsto \frac{-t1}{u} \cdot \color{blue}{\frac{v}{u}} \]

    if 6.19999999999999938e-73 < t1

    1. Initial program 74.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.1%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
      2. associate-/r/99.7%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\left(\frac{1}{t1 + u} \cdot v\right)} \]
    6. Applied egg-rr99.7%

      \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\left(\frac{1}{t1 + u} \cdot v\right)} \]
    7. Taylor expanded in t1 around inf 80.5%

      \[\leadsto \color{blue}{-1} \cdot \left(\frac{1}{t1 + u} \cdot v\right) \]
    8. Step-by-step derivation
      1. associate-/r/80.9%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
    9. Applied egg-rr80.9%

      \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification83.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.3 \cdot 10^{+25}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{elif}\;t1 \leq -3.9 \cdot 10^{-20}:\\ \;\;\;\;\frac{\frac{t1 \cdot v}{u}}{t1 - u}\\ \mathbf{elif}\;t1 \leq -8 \cdot 10^{-45}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{elif}\;t1 \leq 6.2 \cdot 10^{-73}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 86.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -3.6 \cdot 10^{+98}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{elif}\;t1 \leq 6.2 \cdot 10^{+73}:\\ \;\;\;\;t1 \cdot \frac{-v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -3.6e+98)
   (/ (- v) (+ t1 u))
   (if (<= t1 6.2e+73)
     (* t1 (/ (- v) (* (+ t1 u) (+ t1 u))))
     (/ -1.0 (/ (+ t1 u) v)))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -3.6e+98) {
		tmp = -v / (t1 + u);
	} else if (t1 <= 6.2e+73) {
		tmp = t1 * (-v / ((t1 + u) * (t1 + u)));
	} else {
		tmp = -1.0 / ((t1 + u) / v);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (t1 <= (-3.6d+98)) then
        tmp = -v / (t1 + u)
    else if (t1 <= 6.2d+73) then
        tmp = t1 * (-v / ((t1 + u) * (t1 + u)))
    else
        tmp = (-1.0d0) / ((t1 + u) / v)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -3.6e+98) {
		tmp = -v / (t1 + u);
	} else if (t1 <= 6.2e+73) {
		tmp = t1 * (-v / ((t1 + u) * (t1 + u)));
	} else {
		tmp = -1.0 / ((t1 + u) / v);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -3.6e+98:
		tmp = -v / (t1 + u)
	elif t1 <= 6.2e+73:
		tmp = t1 * (-v / ((t1 + u) * (t1 + u)))
	else:
		tmp = -1.0 / ((t1 + u) / v)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -3.6e+98)
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	elseif (t1 <= 6.2e+73)
		tmp = Float64(t1 * Float64(Float64(-v) / Float64(Float64(t1 + u) * Float64(t1 + u))));
	else
		tmp = Float64(-1.0 / Float64(Float64(t1 + u) / v));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -3.6e+98)
		tmp = -v / (t1 + u);
	elseif (t1 <= 6.2e+73)
		tmp = t1 * (-v / ((t1 + u) * (t1 + u)));
	else
		tmp = -1.0 / ((t1 + u) / v);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -3.6e+98], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 6.2e+73], N[(t1 * N[((-v) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.6 \cdot 10^{+98}:\\
\;\;\;\;\frac{-v}{t1 + u}\\

\mathbf{elif}\;t1 \leq 6.2 \cdot 10^{+73}:\\
\;\;\;\;t1 \cdot \frac{-v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -3.59999999999999981e98

    1. Initial program 47.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 89.1%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]

    if -3.59999999999999981e98 < t1 < 6.1999999999999999e73

    1. Initial program 82.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/l*85.4%

        \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified85.4%

      \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing

    if 6.1999999999999999e73 < t1

    1. Initial program 61.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac100.0%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num98.8%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
      2. associate-/r/99.8%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\left(\frac{1}{t1 + u} \cdot v\right)} \]
    6. Applied egg-rr99.8%

      \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\left(\frac{1}{t1 + u} \cdot v\right)} \]
    7. Taylor expanded in t1 around inf 91.8%

      \[\leadsto \color{blue}{-1} \cdot \left(\frac{1}{t1 + u} \cdot v\right) \]
    8. Step-by-step derivation
      1. associate-/r/92.3%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
    9. Applied egg-rr92.3%

      \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -3.6 \cdot 10^{+98}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{elif}\;t1 \leq 6.2 \cdot 10^{+73}:\\ \;\;\;\;t1 \cdot \frac{-v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 80.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -7.4 \cdot 10^{-56} \lor \neg \left(u \leq 1.02 \cdot 10^{-28}\right):\\ \;\;\;\;\frac{t1 \cdot \frac{v}{t1 + u}}{t1 - u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -7.4e-56) (not (<= u 1.02e-28)))
   (/ (* t1 (/ v (+ t1 u))) (- t1 u))
   (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -7.4e-56) || !(u <= 1.02e-28)) {
		tmp = (t1 * (v / (t1 + u))) / (t1 - u);
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-7.4d-56)) .or. (.not. (u <= 1.02d-28))) then
        tmp = (t1 * (v / (t1 + u))) / (t1 - u)
    else
        tmp = -v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -7.4e-56) || !(u <= 1.02e-28)) {
		tmp = (t1 * (v / (t1 + u))) / (t1 - u);
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -7.4e-56) or not (u <= 1.02e-28):
		tmp = (t1 * (v / (t1 + u))) / (t1 - u)
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -7.4e-56) || !(u <= 1.02e-28))
		tmp = Float64(Float64(t1 * Float64(v / Float64(t1 + u))) / Float64(t1 - u));
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -7.4e-56) || ~((u <= 1.02e-28)))
		tmp = (t1 * (v / (t1 + u))) / (t1 - u);
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -7.4e-56], N[Not[LessEqual[u, 1.02e-28]], $MachinePrecision]], N[(N[(t1 * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t1 - u), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -7.4 \cdot 10^{-56} \lor \neg \left(u \leq 1.02 \cdot 10^{-28}\right):\\
\;\;\;\;\frac{t1 \cdot \frac{v}{t1 + u}}{t1 - u}\\

\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -7.4000000000000004e-56 or 1.01999999999999997e-28 < u

    1. Initial program 77.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/l*79.6%

        \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified79.6%

      \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/77.4%

        \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. frac-times97.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      3. frac-2neg97.9%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. remove-double-neg97.9%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      5. associate-*l/99.3%

        \[\leadsto \color{blue}{\frac{t1 \cdot \frac{v}{t1 + u}}{-\left(t1 + u\right)}} \]
      6. distribute-neg-in99.3%

        \[\leadsto \frac{t1 \cdot \frac{v}{t1 + u}}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      7. add-sqr-sqrt52.6%

        \[\leadsto \frac{t1 \cdot \frac{v}{t1 + u}}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      8. sqrt-unprod82.5%

        \[\leadsto \frac{t1 \cdot \frac{v}{t1 + u}}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      9. sqr-neg82.5%

        \[\leadsto \frac{t1 \cdot \frac{v}{t1 + u}}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      10. sqrt-unprod37.3%

        \[\leadsto \frac{t1 \cdot \frac{v}{t1 + u}}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      11. add-sqr-sqrt81.6%

        \[\leadsto \frac{t1 \cdot \frac{v}{t1 + u}}{\color{blue}{t1} + \left(-u\right)} \]
      12. sub-neg81.6%

        \[\leadsto \frac{t1 \cdot \frac{v}{t1 + u}}{\color{blue}{t1 - u}} \]
    6. Applied egg-rr81.6%

      \[\leadsto \color{blue}{\frac{t1 \cdot \frac{v}{t1 + u}}{t1 - u}} \]

    if -7.4000000000000004e-56 < u < 1.01999999999999997e-28

    1. Initial program 65.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/l*63.2%

        \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified63.2%

      \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 83.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/83.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-183.5%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified83.5%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -7.4 \cdot 10^{-56} \lor \neg \left(u \leq 1.02 \cdot 10^{-28}\right):\\ \;\;\;\;\frac{t1 \cdot \frac{v}{t1 + u}}{t1 - u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 79.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -5.2 \cdot 10^{-56} \lor \neg \left(u \leq 6.2 \cdot 10^{-30}\right):\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -5.2e-56) (not (<= u 6.2e-30)))
   (* (/ v (+ t1 u)) (/ (- t1) u))
   (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -5.2e-56) || !(u <= 6.2e-30)) {
		tmp = (v / (t1 + u)) * (-t1 / u);
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-5.2d-56)) .or. (.not. (u <= 6.2d-30))) then
        tmp = (v / (t1 + u)) * (-t1 / u)
    else
        tmp = -v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -5.2e-56) || !(u <= 6.2e-30)) {
		tmp = (v / (t1 + u)) * (-t1 / u);
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -5.2e-56) or not (u <= 6.2e-30):
		tmp = (v / (t1 + u)) * (-t1 / u)
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -5.2e-56) || !(u <= 6.2e-30))
		tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(Float64(-t1) / u));
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -5.2e-56) || ~((u <= 6.2e-30)))
		tmp = (v / (t1 + u)) * (-t1 / u);
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -5.2e-56], N[Not[LessEqual[u, 6.2e-30]], $MachinePrecision]], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.2 \cdot 10^{-56} \lor \neg \left(u \leq 6.2 \cdot 10^{-30}\right):\\
\;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\

\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -5.19999999999999994e-56 or 6.19999999999999982e-30 < u

    1. Initial program 77.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified97.9%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 79.5%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/79.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. neg-mul-179.5%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    7. Simplified79.5%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]

    if -5.19999999999999994e-56 < u < 6.19999999999999982e-30

    1. Initial program 65.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/l*63.2%

        \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified63.2%

      \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 83.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/83.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-183.5%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified83.5%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification81.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -5.2 \cdot 10^{-56} \lor \neg \left(u \leq 6.2 \cdot 10^{-30}\right):\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 68.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -3.9 \cdot 10^{+133} \lor \neg \left(u \leq 1.02 \cdot 10^{+75}\right):\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -3.9e+133) (not (<= u 1.02e+75)))
   (/ t1 (* u (/ u v)))
   (/ (- v) (+ t1 u))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -3.9e+133) || !(u <= 1.02e+75)) {
		tmp = t1 / (u * (u / v));
	} else {
		tmp = -v / (t1 + u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-3.9d+133)) .or. (.not. (u <= 1.02d+75))) then
        tmp = t1 / (u * (u / v))
    else
        tmp = -v / (t1 + u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -3.9e+133) || !(u <= 1.02e+75)) {
		tmp = t1 / (u * (u / v));
	} else {
		tmp = -v / (t1 + u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -3.9e+133) or not (u <= 1.02e+75):
		tmp = t1 / (u * (u / v))
	else:
		tmp = -v / (t1 + u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -3.9e+133) || !(u <= 1.02e+75))
		tmp = Float64(t1 / Float64(u * Float64(u / v)));
	else
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -3.9e+133) || ~((u <= 1.02e+75)))
		tmp = t1 / (u * (u / v));
	else
		tmp = -v / (t1 + u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.9e+133], N[Not[LessEqual[u, 1.02e+75]], $MachinePrecision]], N[(t1 / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.9 \cdot 10^{+133} \lor \neg \left(u \leq 1.02 \cdot 10^{+75}\right):\\
\;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\

\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.90000000000000014e133 or 1.0200000000000001e75 < u

    1. Initial program 77.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac96.5%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified96.5%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 88.7%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/88.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. neg-mul-188.7%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    7. Simplified88.7%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Taylor expanded in t1 around 0 88.8%

      \[\leadsto \frac{-t1}{u} \cdot \color{blue}{\frac{v}{u}} \]
    9. Step-by-step derivation
      1. *-commutative88.8%

        \[\leadsto \color{blue}{\frac{v}{u} \cdot \frac{-t1}{u}} \]
      2. clear-num88.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{v}}} \cdot \frac{-t1}{u} \]
      3. frac-times84.5%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-t1\right)}{\frac{u}{v} \cdot u}} \]
      4. *-un-lft-identity84.5%

        \[\leadsto \frac{\color{blue}{-t1}}{\frac{u}{v} \cdot u} \]
      5. add-sqr-sqrt42.4%

        \[\leadsto \frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{\frac{u}{v} \cdot u} \]
      6. sqrt-unprod63.3%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{\frac{u}{v} \cdot u} \]
      7. sqr-neg63.3%

        \[\leadsto \frac{\sqrt{\color{blue}{t1 \cdot t1}}}{\frac{u}{v} \cdot u} \]
      8. sqrt-unprod34.7%

        \[\leadsto \frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{\frac{u}{v} \cdot u} \]
      9. add-sqr-sqrt68.3%

        \[\leadsto \frac{\color{blue}{t1}}{\frac{u}{v} \cdot u} \]
    10. Applied egg-rr68.3%

      \[\leadsto \color{blue}{\frac{t1}{\frac{u}{v} \cdot u}} \]

    if -3.90000000000000014e133 < u < 1.0200000000000001e75

    1. Initial program 69.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac98.8%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified98.8%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 69.9%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification69.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3.9 \cdot 10^{+133} \lor \neg \left(u \leq 1.02 \cdot 10^{+75}\right):\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 58.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.4 \cdot 10^{+178} \lor \neg \left(u \leq 3.5 \cdot 10^{+143}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -1.4e+178) (not (<= u 3.5e+143))) (/ v u) (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -1.4e+178) || !(u <= 3.5e+143)) {
		tmp = v / u;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-1.4d+178)) .or. (.not. (u <= 3.5d+143))) then
        tmp = v / u
    else
        tmp = -v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -1.4e+178) || !(u <= 3.5e+143)) {
		tmp = v / u;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -1.4e+178) or not (u <= 3.5e+143):
		tmp = v / u
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -1.4e+178) || !(u <= 3.5e+143))
		tmp = Float64(v / u);
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -1.4e+178) || ~((u <= 3.5e+143)))
		tmp = v / u;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.4e+178], N[Not[LessEqual[u, 3.5e+143]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.4 \cdot 10^{+178} \lor \neg \left(u \leq 3.5 \cdot 10^{+143}\right):\\
\;\;\;\;\frac{v}{u}\\

\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.39999999999999997e178 or 3.50000000000000008e143 < u

    1. Initial program 77.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 96.4%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/96.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. neg-mul-196.4%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    7. Simplified96.4%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Step-by-step derivation
      1. associate-*r/96.3%

        \[\leadsto \color{blue}{\frac{\frac{-t1}{u} \cdot v}{t1 + u}} \]
      2. frac-2neg96.3%

        \[\leadsto \color{blue}{\frac{-\frac{-t1}{u} \cdot v}{-\left(t1 + u\right)}} \]
      3. add-sqr-sqrt51.9%

        \[\leadsto \frac{-\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{u} \cdot v}{-\left(t1 + u\right)} \]
      4. sqrt-unprod76.9%

        \[\leadsto \frac{-\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{u} \cdot v}{-\left(t1 + u\right)} \]
      5. sqr-neg76.9%

        \[\leadsto \frac{-\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{u} \cdot v}{-\left(t1 + u\right)} \]
      6. sqrt-unprod42.1%

        \[\leadsto \frac{-\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{u} \cdot v}{-\left(t1 + u\right)} \]
      7. add-sqr-sqrt77.9%

        \[\leadsto \frac{-\frac{\color{blue}{t1}}{u} \cdot v}{-\left(t1 + u\right)} \]
      8. distribute-lft-neg-out77.9%

        \[\leadsto \frac{\color{blue}{\left(-\frac{t1}{u}\right) \cdot v}}{-\left(t1 + u\right)} \]
      9. distribute-frac-neg77.9%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{u}} \cdot v}{-\left(t1 + u\right)} \]
      10. *-commutative77.9%

        \[\leadsto \frac{\color{blue}{v \cdot \frac{-t1}{u}}}{-\left(t1 + u\right)} \]
      11. add-sqr-sqrt35.8%

        \[\leadsto \frac{v \cdot \frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{u}}{-\left(t1 + u\right)} \]
      12. sqrt-unprod64.1%

        \[\leadsto \frac{v \cdot \frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{u}}{-\left(t1 + u\right)} \]
      13. sqr-neg64.1%

        \[\leadsto \frac{v \cdot \frac{\sqrt{\color{blue}{t1 \cdot t1}}}{u}}{-\left(t1 + u\right)} \]
      14. sqrt-unprod44.4%

        \[\leadsto \frac{v \cdot \frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{u}}{-\left(t1 + u\right)} \]
      15. add-sqr-sqrt96.3%

        \[\leadsto \frac{v \cdot \frac{\color{blue}{t1}}{u}}{-\left(t1 + u\right)} \]
      16. distribute-neg-in96.3%

        \[\leadsto \frac{v \cdot \frac{t1}{u}}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      17. add-sqr-sqrt51.9%

        \[\leadsto \frac{v \cdot \frac{t1}{u}}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      18. sqrt-unprod90.5%

        \[\leadsto \frac{v \cdot \frac{t1}{u}}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      19. sqr-neg90.5%

        \[\leadsto \frac{v \cdot \frac{t1}{u}}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      20. sqrt-unprod44.6%

        \[\leadsto \frac{v \cdot \frac{t1}{u}}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      21. add-sqr-sqrt96.4%

        \[\leadsto \frac{v \cdot \frac{t1}{u}}{\color{blue}{t1} + \left(-u\right)} \]
      22. sub-neg96.4%

        \[\leadsto \frac{v \cdot \frac{t1}{u}}{\color{blue}{t1 - u}} \]
    9. Applied egg-rr96.4%

      \[\leadsto \color{blue}{\frac{v \cdot \frac{t1}{u}}{t1 - u}} \]
    10. Step-by-step derivation
      1. associate-/l*85.8%

        \[\leadsto \color{blue}{v \cdot \frac{\frac{t1}{u}}{t1 - u}} \]
    11. Simplified85.8%

      \[\leadsto \color{blue}{v \cdot \frac{\frac{t1}{u}}{t1 - u}} \]
    12. Taylor expanded in t1 around inf 46.1%

      \[\leadsto \color{blue}{\frac{v}{u}} \]

    if -1.39999999999999997e178 < u < 3.50000000000000008e143

    1. Initial program 70.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/l*70.9%

        \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified70.9%

      \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 64.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/64.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-164.5%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified64.5%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.4 \cdot 10^{+178} \lor \neg \left(u \leq 3.5 \cdot 10^{+143}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 61.6% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \frac{-v}{t1 + u} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (- v) (+ t1 u)))
double code(double u, double v, double t1) {
	return -v / (t1 + u);
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = -v / (t1 + u)
end function
public static double code(double u, double v, double t1) {
	return -v / (t1 + u);
}
def code(u, v, t1):
	return -v / (t1 + u)
function code(u, v, t1)
	return Float64(Float64(-v) / Float64(t1 + u))
end
function tmp = code(u, v, t1)
	tmp = -v / (t1 + u);
end
code[u_, v_, t1_] := N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{-v}{t1 + u}
\end{array}
Derivation
  1. Initial program 72.4%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac98.0%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  3. Simplified98.0%

    \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  4. Add Preprocessing
  5. Taylor expanded in t1 around inf 61.2%

    \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
  6. Final simplification61.2%

    \[\leadsto \frac{-v}{t1 + u} \]
  7. Add Preprocessing

Alternative 11: 17.2% accurate, 4.0× speedup?

\[\begin{array}{l} \\ \frac{v}{u} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ v u))
double code(double u, double v, double t1) {
	return v / u;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = v / u
end function
public static double code(double u, double v, double t1) {
	return v / u;
}
def code(u, v, t1):
	return v / u
function code(u, v, t1)
	return Float64(v / u)
end
function tmp = code(u, v, t1)
	tmp = v / u;
end
code[u_, v_, t1_] := N[(v / u), $MachinePrecision]
\begin{array}{l}

\\
\frac{v}{u}
\end{array}
Derivation
  1. Initial program 72.4%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac98.0%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  3. Simplified98.0%

    \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  4. Add Preprocessing
  5. Taylor expanded in t1 around 0 55.5%

    \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
  6. Step-by-step derivation
    1. associate-*r/55.5%

      \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
    2. neg-mul-155.5%

      \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
  7. Simplified55.5%

    \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
  8. Step-by-step derivation
    1. associate-*r/51.7%

      \[\leadsto \color{blue}{\frac{\frac{-t1}{u} \cdot v}{t1 + u}} \]
    2. frac-2neg51.7%

      \[\leadsto \color{blue}{\frac{-\frac{-t1}{u} \cdot v}{-\left(t1 + u\right)}} \]
    3. add-sqr-sqrt25.9%

      \[\leadsto \frac{-\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{u} \cdot v}{-\left(t1 + u\right)} \]
    4. sqrt-unprod32.0%

      \[\leadsto \frac{-\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{u} \cdot v}{-\left(t1 + u\right)} \]
    5. sqr-neg32.0%

      \[\leadsto \frac{-\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{u} \cdot v}{-\left(t1 + u\right)} \]
    6. sqrt-unprod14.7%

      \[\leadsto \frac{-\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{u} \cdot v}{-\left(t1 + u\right)} \]
    7. add-sqr-sqrt31.7%

      \[\leadsto \frac{-\frac{\color{blue}{t1}}{u} \cdot v}{-\left(t1 + u\right)} \]
    8. distribute-lft-neg-out31.7%

      \[\leadsto \frac{\color{blue}{\left(-\frac{t1}{u}\right) \cdot v}}{-\left(t1 + u\right)} \]
    9. distribute-frac-neg31.7%

      \[\leadsto \frac{\color{blue}{\frac{-t1}{u}} \cdot v}{-\left(t1 + u\right)} \]
    10. *-commutative31.7%

      \[\leadsto \frac{\color{blue}{v \cdot \frac{-t1}{u}}}{-\left(t1 + u\right)} \]
    11. add-sqr-sqrt16.9%

      \[\leadsto \frac{v \cdot \frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{u}}{-\left(t1 + u\right)} \]
    12. sqrt-unprod31.0%

      \[\leadsto \frac{v \cdot \frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{u}}{-\left(t1 + u\right)} \]
    13. sqr-neg31.0%

      \[\leadsto \frac{v \cdot \frac{\sqrt{\color{blue}{t1 \cdot t1}}}{u}}{-\left(t1 + u\right)} \]
    14. sqrt-unprod25.7%

      \[\leadsto \frac{v \cdot \frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{u}}{-\left(t1 + u\right)} \]
    15. add-sqr-sqrt51.7%

      \[\leadsto \frac{v \cdot \frac{\color{blue}{t1}}{u}}{-\left(t1 + u\right)} \]
    16. distribute-neg-in51.7%

      \[\leadsto \frac{v \cdot \frac{t1}{u}}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
    17. add-sqr-sqrt25.9%

      \[\leadsto \frac{v \cdot \frac{t1}{u}}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
    18. sqrt-unprod54.2%

      \[\leadsto \frac{v \cdot \frac{t1}{u}}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
    19. sqr-neg54.2%

      \[\leadsto \frac{v \cdot \frac{t1}{u}}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
    20. sqrt-unprod24.6%

      \[\leadsto \frac{v \cdot \frac{t1}{u}}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
    21. add-sqr-sqrt52.3%

      \[\leadsto \frac{v \cdot \frac{t1}{u}}{\color{blue}{t1} + \left(-u\right)} \]
    22. sub-neg52.3%

      \[\leadsto \frac{v \cdot \frac{t1}{u}}{\color{blue}{t1 - u}} \]
  9. Applied egg-rr52.3%

    \[\leadsto \color{blue}{\frac{v \cdot \frac{t1}{u}}{t1 - u}} \]
  10. Step-by-step derivation
    1. associate-/l*49.4%

      \[\leadsto \color{blue}{v \cdot \frac{\frac{t1}{u}}{t1 - u}} \]
  11. Simplified49.4%

    \[\leadsto \color{blue}{v \cdot \frac{\frac{t1}{u}}{t1 - u}} \]
  12. Taylor expanded in t1 around inf 18.8%

    \[\leadsto \color{blue}{\frac{v}{u}} \]
  13. Final simplification18.8%

    \[\leadsto \frac{v}{u} \]
  14. Add Preprocessing

Reproduce

?
herbie shell --seed 2024036 
(FPCore (u v t1)
  :name "Rosa's DopplerBench"
  :precision binary64
  (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))