Rosa's DopplerBench

Percentage Accurate: 72.0% → 98.0%
Time: 10.1s
Alternatives: 12
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 12 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.0% 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 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.4%

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

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

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

Alternative 2: 86.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t1 \cdot \frac{v}{\left(t1 + u\right) \cdot \left(\left(-t1\right) - u\right)}\\ t_2 := \frac{v}{u \cdot -2 - t1}\\ \mathbf{if}\;t1 \leq -7.6 \cdot 10^{+131}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t1 \leq -4.5 \cdot 10^{-174}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq 8 \cdot 10^{-294}:\\ \;\;\;\;v \cdot \frac{\frac{t1}{u}}{t1 - u}\\ \mathbf{elif}\;t1 \leq 1.16 \cdot 10^{+84}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (* t1 (/ v (* (+ t1 u) (- (- t1) u)))))
        (t_2 (/ v (- (* u -2.0) t1))))
   (if (<= t1 -7.6e+131)
     t_2
     (if (<= t1 -4.5e-174)
       t_1
       (if (<= t1 8e-294)
         (* v (/ (/ t1 u) (- t1 u)))
         (if (<= t1 1.16e+84) t_1 t_2))))))
double code(double u, double v, double t1) {
	double t_1 = t1 * (v / ((t1 + u) * (-t1 - u)));
	double t_2 = v / ((u * -2.0) - t1);
	double tmp;
	if (t1 <= -7.6e+131) {
		tmp = t_2;
	} else if (t1 <= -4.5e-174) {
		tmp = t_1;
	} else if (t1 <= 8e-294) {
		tmp = v * ((t1 / u) / (t1 - u));
	} else if (t1 <= 1.16e+84) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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 = t1 * (v / ((t1 + u) * (-t1 - u)))
    t_2 = v / ((u * (-2.0d0)) - t1)
    if (t1 <= (-7.6d+131)) then
        tmp = t_2
    else if (t1 <= (-4.5d-174)) then
        tmp = t_1
    else if (t1 <= 8d-294) then
        tmp = v * ((t1 / u) / (t1 - u))
    else if (t1 <= 1.16d+84) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = t1 * (v / ((t1 + u) * (-t1 - u)));
	double t_2 = v / ((u * -2.0) - t1);
	double tmp;
	if (t1 <= -7.6e+131) {
		tmp = t_2;
	} else if (t1 <= -4.5e-174) {
		tmp = t_1;
	} else if (t1 <= 8e-294) {
		tmp = v * ((t1 / u) / (t1 - u));
	} else if (t1 <= 1.16e+84) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = t1 * (v / ((t1 + u) * (-t1 - u)))
	t_2 = v / ((u * -2.0) - t1)
	tmp = 0
	if t1 <= -7.6e+131:
		tmp = t_2
	elif t1 <= -4.5e-174:
		tmp = t_1
	elif t1 <= 8e-294:
		tmp = v * ((t1 / u) / (t1 - u))
	elif t1 <= 1.16e+84:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(u, v, t1)
	t_1 = Float64(t1 * Float64(v / Float64(Float64(t1 + u) * Float64(Float64(-t1) - u))))
	t_2 = Float64(v / Float64(Float64(u * -2.0) - t1))
	tmp = 0.0
	if (t1 <= -7.6e+131)
		tmp = t_2;
	elseif (t1 <= -4.5e-174)
		tmp = t_1;
	elseif (t1 <= 8e-294)
		tmp = Float64(v * Float64(Float64(t1 / u) / Float64(t1 - u)));
	elseif (t1 <= 1.16e+84)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = t1 * (v / ((t1 + u) * (-t1 - u)));
	t_2 = v / ((u * -2.0) - t1);
	tmp = 0.0;
	if (t1 <= -7.6e+131)
		tmp = t_2;
	elseif (t1 <= -4.5e-174)
		tmp = t_1;
	elseif (t1 <= 8e-294)
		tmp = v * ((t1 / u) / (t1 - u));
	elseif (t1 <= 1.16e+84)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(t1 * N[(v / N[(N[(t1 + u), $MachinePrecision] * N[((-t1) - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -7.6e+131], t$95$2, If[LessEqual[t1, -4.5e-174], t$95$1, If[LessEqual[t1, 8e-294], N[(v * N[(N[(t1 / u), $MachinePrecision] / N[(t1 - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.16e+84], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t1 \cdot \frac{v}{\left(t1 + u\right) \cdot \left(\left(-t1\right) - u\right)}\\
t_2 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -7.6 \cdot 10^{+131}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t1 \leq -4.5 \cdot 10^{-174}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t1 \leq 1.16 \cdot 10^{+84}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -7.6000000000000007e131 or 1.16e84 < t1

    1. Initial program 52.9%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/97.4%

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

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

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

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

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

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

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \left(-\color{blue}{1}\right)\right)} \]
      11. metadata-eval97.4%

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

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

      \[\leadsto \frac{v}{\color{blue}{-2 \cdot u + -1 \cdot t1}} \]
    6. Step-by-step derivation
      1. mul-1-neg95.7%

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

        \[\leadsto \frac{v}{\color{blue}{-2 \cdot u - t1}} \]
      3. *-commutative95.7%

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

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

    if -7.6000000000000007e131 < t1 < -4.49999999999999964e-174 or 8.00000000000000013e-294 < t1 < 1.16e84

    1. Initial program 89.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{t1}{-\frac{\color{blue}{{\left(t1 + u\right)}^{2}}}{v}} \]
    6. Applied egg-rr88.6%

      \[\leadsto \color{blue}{\frac{t1}{-\frac{{\left(t1 + u\right)}^{2}}{v}}} \]
    7. Step-by-step derivation
      1. distribute-neg-frac88.6%

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

        \[\leadsto \color{blue}{\frac{t1 \cdot v}{-{\left(t1 + u\right)}^{2}}} \]
      3. *-rgt-identity89.7%

        \[\leadsto \frac{\color{blue}{\left(t1 \cdot v\right) \cdot 1}}{-{\left(t1 + u\right)}^{2}} \]
      4. associate-*r/89.6%

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

        \[\leadsto \color{blue}{t1 \cdot \left(v \cdot \frac{1}{-{\left(t1 + u\right)}^{2}}\right)} \]
      6. associate-*r/88.6%

        \[\leadsto t1 \cdot \color{blue}{\frac{v \cdot 1}{-{\left(t1 + u\right)}^{2}}} \]
      7. *-rgt-identity88.6%

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

      \[\leadsto \color{blue}{t1 \cdot \frac{v}{-{\left(t1 + u\right)}^{2}}} \]
    9. Step-by-step derivation
      1. unpow288.6%

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

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

    if -4.49999999999999964e-174 < t1 < 8.00000000000000013e-294

    1. Initial program 73.3%

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

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

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

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      2. clear-num93.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{t1} + \left(-u\right)\right)} \]
      13. sub-neg73.7%

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

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

      \[\leadsto \frac{t1}{\color{blue}{\frac{u}{v}} \cdot \left(t1 - u\right)} \]
    8. Taylor expanded in v around 0 73.3%

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

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

        \[\leadsto \color{blue}{v \cdot \frac{t1}{u \cdot \left(t1 - u\right)}} \]
      3. associate-/r*87.6%

        \[\leadsto v \cdot \color{blue}{\frac{\frac{t1}{u}}{t1 - u}} \]
    10. Simplified87.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -7.6 \cdot 10^{+131}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq -4.5 \cdot 10^{-174}:\\ \;\;\;\;t1 \cdot \frac{v}{\left(t1 + u\right) \cdot \left(\left(-t1\right) - u\right)}\\ \mathbf{elif}\;t1 \leq 8 \cdot 10^{-294}:\\ \;\;\;\;v \cdot \frac{\frac{t1}{u}}{t1 - u}\\ \mathbf{elif}\;t1 \leq 1.16 \cdot 10^{+84}:\\ \;\;\;\;t1 \cdot \frac{v}{\left(t1 + u\right) \cdot \left(\left(-t1\right) - u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 78.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -3.5 \cdot 10^{-31} \lor \neg \left(t1 \leq 4.5 \cdot 10^{-53}\right):\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -3.5e-31) (not (<= t1 4.5e-53)))
   (/ v (- (* u -2.0) t1))
   (* (/ t1 u) (/ (- v) u))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -3.5e-31) || !(t1 <= 4.5e-53)) {
		tmp = v / ((u * -2.0) - t1);
	} 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 <= (-3.5d-31)) .or. (.not. (t1 <= 4.5d-53))) then
        tmp = v / ((u * (-2.0d0)) - t1)
    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 <= -3.5e-31) || !(t1 <= 4.5e-53)) {
		tmp = v / ((u * -2.0) - t1);
	} else {
		tmp = (t1 / u) * (-v / u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -3.5e-31) or not (t1 <= 4.5e-53):
		tmp = v / ((u * -2.0) - t1)
	else:
		tmp = (t1 / u) * (-v / u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -3.5e-31) || !(t1 <= 4.5e-53))
		tmp = Float64(v / Float64(Float64(u * -2.0) - t1));
	else
		tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -3.5e-31) || ~((t1 <= 4.5e-53)))
		tmp = v / ((u * -2.0) - t1);
	else
		tmp = (t1 / u) * (-v / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.5e-31], N[Not[LessEqual[t1, 4.5e-53]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.5 \cdot 10^{-31} \lor \neg \left(t1 \leq 4.5 \cdot 10^{-53}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -3.49999999999999985e-31 or 4.49999999999999985e-53 < t1

    1. Initial program 70.4%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/95.8%

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

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

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

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

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

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

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \left(-\color{blue}{1}\right)\right)} \]
      11. metadata-eval95.8%

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

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

      \[\leadsto \frac{v}{\color{blue}{-2 \cdot u + -1 \cdot t1}} \]
    6. Step-by-step derivation
      1. mul-1-neg88.1%

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

        \[\leadsto \frac{v}{\color{blue}{-2 \cdot u - t1}} \]
      3. *-commutative88.1%

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

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

    if -3.49999999999999985e-31 < t1 < 4.49999999999999985e-53

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

Alternative 4: 59.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -4.25 \cdot 10^{+102} \lor \neg \left(u \leq 1.22 \cdot 10^{+66}\right):\\
\;\;\;\;t1 \cdot \frac{\frac{v}{u}}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -4.2499999999999998e102 or 1.21999999999999993e66 < u

    1. Initial program 83.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{t1} + \left(-u\right)\right)} \]
      13. sub-neg91.7%

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

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

      \[\leadsto \frac{t1}{\color{blue}{\frac{u}{v}} \cdot \left(t1 - u\right)} \]
    8. Taylor expanded in u around 0 53.7%

      \[\leadsto \frac{t1}{\color{blue}{\frac{t1 \cdot u}{v}}} \]
    9. Step-by-step derivation
      1. clear-num54.5%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{t1 \cdot u}{v}} \cdot t1} \]
      3. clear-num53.7%

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

        \[\leadsto \frac{v}{\color{blue}{u \cdot t1}} \cdot t1 \]
      5. associate-/r*51.6%

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

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

    if -4.2499999999999998e102 < u < 1.21999999999999993e66

    1. Initial program 74.1%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified68.4%

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

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

Alternative 5: 60.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.26 \cdot 10^{+112} \lor \neg \left(u \leq 8 \cdot 10^{+65}\right):\\ \;\;\;\;\frac{t1}{\frac{t1 \cdot u}{v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -1.26e+112) (not (<= u 8e+65)))
   (/ t1 (/ (* t1 u) v))
   (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -1.26e+112) || !(u <= 8e+65)) {
		tmp = t1 / ((t1 * u) / v);
	} 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.26d+112)) .or. (.not. (u <= 8d+65))) then
        tmp = t1 / ((t1 * u) / v)
    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.26e+112) || !(u <= 8e+65)) {
		tmp = t1 / ((t1 * u) / v);
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -1.26e+112) or not (u <= 8e+65):
		tmp = t1 / ((t1 * u) / v)
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -1.26e+112) || !(u <= 8e+65))
		tmp = Float64(t1 / Float64(Float64(t1 * u) / v));
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -1.26e+112) || ~((u <= 8e+65)))
		tmp = t1 / ((t1 * u) / v);
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.26e+112], N[Not[LessEqual[u, 8e+65]], $MachinePrecision]], N[(t1 / N[(N[(t1 * u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.26 \cdot 10^{+112} \lor \neg \left(u \leq 8 \cdot 10^{+65}\right):\\
\;\;\;\;\frac{t1}{\frac{t1 \cdot u}{v}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.26e112 or 7.9999999999999999e65 < u

    1. Initial program 83.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{t1} + \left(-u\right)\right)} \]
      13. sub-neg91.7%

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

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

      \[\leadsto \frac{t1}{\color{blue}{\frac{u}{v}} \cdot \left(t1 - u\right)} \]
    8. Taylor expanded in u around 0 53.7%

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

    if -1.26e112 < u < 7.9999999999999999e65

    1. Initial program 74.1%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified68.4%

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

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

Alternative 6: 60.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.38 \cdot 10^{+110}:\\ \;\;\;\;\frac{t1}{t1 \cdot \frac{u}{v}}\\ \mathbf{elif}\;u \leq 1.1 \cdot 10^{+66}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{u}}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -1.38e+110)
   (/ t1 (* t1 (/ u v)))
   (if (<= u 1.1e+66) (/ (- v) t1) (* t1 (/ (/ v u) t1)))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.38e+110) {
		tmp = t1 / (t1 * (u / v));
	} else if (u <= 1.1e+66) {
		tmp = -v / t1;
	} else {
		tmp = t1 * ((v / u) / 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.38d+110)) then
        tmp = t1 / (t1 * (u / v))
    else if (u <= 1.1d+66) then
        tmp = -v / t1
    else
        tmp = t1 * ((v / u) / t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.38e+110) {
		tmp = t1 / (t1 * (u / v));
	} else if (u <= 1.1e+66) {
		tmp = -v / t1;
	} else {
		tmp = t1 * ((v / u) / t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -1.38e+110:
		tmp = t1 / (t1 * (u / v))
	elif u <= 1.1e+66:
		tmp = -v / t1
	else:
		tmp = t1 * ((v / u) / t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -1.38e+110)
		tmp = Float64(t1 / Float64(t1 * Float64(u / v)));
	elseif (u <= 1.1e+66)
		tmp = Float64(Float64(-v) / t1);
	else
		tmp = Float64(t1 * Float64(Float64(v / u) / t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -1.38e+110)
		tmp = t1 / (t1 * (u / v));
	elseif (u <= 1.1e+66)
		tmp = -v / t1;
	else
		tmp = t1 * ((v / u) / t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -1.38e+110], N[(t1 / N[(t1 * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.1e+66], N[((-v) / t1), $MachinePrecision], N[(t1 * N[(N[(v / u), $MachinePrecision] / t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;u \leq 1.1 \cdot 10^{+66}:\\
\;\;\;\;\frac{-v}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -1.37999999999999998e110

    1. Initial program 79.8%

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

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

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

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      2. clear-num95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{t1}{\color{blue}{\frac{u}{v}} \cdot \left(t1 - u\right)} \]
    8. Taylor expanded in u around 0 57.7%

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

        \[\leadsto \frac{t1}{\color{blue}{t1 \cdot \frac{u}{v}}} \]
    10. Simplified57.0%

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

    if -1.37999999999999998e110 < u < 1.0999999999999999e66

    1. Initial program 74.1%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified68.4%

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

    if 1.0999999999999999e66 < u

    1. Initial program 86.2%

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

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

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

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      2. clear-num96.1%

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(-t1\right)}}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)} \]
      6. remove-double-neg98.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{t1}{\color{blue}{\frac{u}{v}} \cdot \left(t1 - u\right)} \]
    8. Taylor expanded in u around 0 50.4%

      \[\leadsto \frac{t1}{\color{blue}{\frac{t1 \cdot u}{v}}} \]
    9. Step-by-step derivation
      1. clear-num50.4%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{t1 \cdot u}{v}} \cdot t1} \]
      3. clear-num50.4%

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

        \[\leadsto \frac{v}{\color{blue}{u \cdot t1}} \cdot t1 \]
      5. associate-/r*48.5%

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

      \[\leadsto \color{blue}{\frac{\frac{v}{u}}{t1} \cdot t1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.38 \cdot 10^{+110}:\\ \;\;\;\;\frac{t1}{t1 \cdot \frac{u}{v}}\\ \mathbf{elif}\;u \leq 1.1 \cdot 10^{+66}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{u}}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 58.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -2.4 \cdot 10^{+149} \lor \neg \left(u \leq 1.45 \cdot 10^{+77}\right):\\ \;\;\;\;\frac{v}{u} \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -2.4e+149) (not (<= u 1.45e+77)))
   (* (/ v u) -0.5)
   (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.4e+149) || !(u <= 1.45e+77)) {
		tmp = (v / u) * -0.5;
	} 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 <= (-2.4d+149)) .or. (.not. (u <= 1.45d+77))) then
        tmp = (v / u) * (-0.5d0)
    else
        tmp = -v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.4e+149) || !(u <= 1.45e+77)) {
		tmp = (v / u) * -0.5;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -2.4e+149) or not (u <= 1.45e+77):
		tmp = (v / u) * -0.5
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -2.4e+149) || !(u <= 1.45e+77))
		tmp = Float64(Float64(v / u) * -0.5);
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -2.4e+149) || ~((u <= 1.45e+77)))
		tmp = (v / u) * -0.5;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.4e+149], N[Not[LessEqual[u, 1.45e+77]], $MachinePrecision]], N[(N[(v / u), $MachinePrecision] * -0.5), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.4 \cdot 10^{+149} \lor \neg \left(u \leq 1.45 \cdot 10^{+77}\right):\\
\;\;\;\;\frac{v}{u} \cdot -0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.40000000000000012e149 or 1.4500000000000001e77 < u

    1. Initial program 81.3%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/87.4%

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

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

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

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

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

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

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \left(-\color{blue}{1}\right)\right)} \]
      11. metadata-eval87.4%

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

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

      \[\leadsto \frac{v}{\color{blue}{-2 \cdot u + -1 \cdot t1}} \]
    6. Step-by-step derivation
      1. mul-1-neg56.4%

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

        \[\leadsto \frac{v}{\color{blue}{-2 \cdot u - t1}} \]
      3. *-commutative56.4%

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

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

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

    if -2.40000000000000012e149 < u < 1.4500000000000001e77

    1. Initial program 75.5%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified66.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.4 \cdot 10^{+149} \lor \neg \left(u \leq 1.45 \cdot 10^{+77}\right):\\ \;\;\;\;\frac{v}{u} \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 58.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -7.8 \cdot 10^{+152} \lor \neg \left(u \leq 1.05 \cdot 10^{+66}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -7.8e+152) (not (<= u 1.05e+66))) (/ v u) (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -7.8e+152) || !(u <= 1.05e+66)) {
		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 <= (-7.8d+152)) .or. (.not. (u <= 1.05d+66))) 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 <= -7.8e+152) || !(u <= 1.05e+66)) {
		tmp = v / u;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -7.8e+152) or not (u <= 1.05e+66):
		tmp = v / u
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -7.8e+152) || !(u <= 1.05e+66))
		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 <= -7.8e+152) || ~((u <= 1.05e+66)))
		tmp = v / u;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -7.8e+152], N[Not[LessEqual[u, 1.05e+66]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -7.8 \cdot 10^{+152} \lor \neg \left(u \leq 1.05 \cdot 10^{+66}\right):\\
\;\;\;\;\frac{v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -7.80000000000000022e152 or 1.05000000000000003e66 < u

    1. Initial program 81.7%

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

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

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

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      2. clear-num97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.80000000000000022e152 < u < 1.05000000000000003e66

    1. Initial program 75.3%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified67.6%

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

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

Alternative 9: 58.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.9 \cdot 10^{+153} \lor \neg \left(u \leq 8 \cdot 10^{+78}\right):\\ \;\;\;\;\frac{-v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -1.9e+153) (not (<= u 8e+78))) (/ (- v) u) (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -1.9e+153) || !(u <= 8e+78)) {
		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.9d+153)) .or. (.not. (u <= 8d+78))) 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.9e+153) || !(u <= 8e+78)) {
		tmp = -v / u;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -1.9e+153) or not (u <= 8e+78):
		tmp = -v / u
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -1.9e+153) || !(u <= 8e+78))
		tmp = Float64(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.9e+153) || ~((u <= 8e+78)))
		tmp = -v / u;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.9e+153], N[Not[LessEqual[u, 8e+78]], $MachinePrecision]], N[((-v) / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.9 \cdot 10^{+153} \lor \neg \left(u \leq 8 \cdot 10^{+78}\right):\\
\;\;\;\;\frac{-v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.89999999999999983e153 or 8.00000000000000007e78 < u

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{u} \]
    10. Simplified47.3%

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

    if -1.89999999999999983e153 < u < 8.00000000000000007e78

    1. Initial program 75.5%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified66.8%

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

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

Alternative 10: 23.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.25 \cdot 10^{+121} \lor \neg \left(t1 \leq 2.8 \cdot 10^{+54}\right):\\
\;\;\;\;\frac{v}{t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.25000000000000002e121 or 2.80000000000000015e54 < t1

    1. Initial program 57.0%

      \[\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. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      2. clear-num98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25000000000000002e121 < t1 < 2.80000000000000015e54

    1. Initial program 87.0%

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

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

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

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      2. clear-num96.0%

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(-t1\right)}}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)} \]
      6. remove-double-neg93.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 62.8% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \frac{v}{u \cdot -2 - t1} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ v (- (* u -2.0) t1)))
double code(double u, double v, double t1) {
	return v / ((u * -2.0) - t1);
}
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 * (-2.0d0)) - t1)
end function
public static double code(double u, double v, double t1) {
	return v / ((u * -2.0) - t1);
}
def code(u, v, t1):
	return v / ((u * -2.0) - t1)
function code(u, v, t1)
	return Float64(v / Float64(Float64(u * -2.0) - t1))
end
function tmp = code(u, v, t1)
	tmp = v / ((u * -2.0) - t1);
end
code[u_, v_, t1_] := N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{v}{u \cdot -2 - t1}
\end{array}
Derivation
  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-/r*88.1%

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

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

      \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
    4. associate-/l/94.4%

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

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

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

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

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

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

      \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \left(-\color{blue}{1}\right)\right)} \]
    11. metadata-eval94.4%

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

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

    \[\leadsto \frac{v}{\color{blue}{-2 \cdot u + -1 \cdot t1}} \]
  6. Step-by-step derivation
    1. mul-1-neg63.9%

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

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

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

    \[\leadsto \frac{v}{\color{blue}{u \cdot -2 - t1}} \]
  8. Final simplification63.9%

    \[\leadsto \frac{v}{u \cdot -2 - t1} \]
  9. Add Preprocessing

Alternative 12: 13.9% accurate, 4.0× speedup?

\[\begin{array}{l} \\ \frac{v}{t1} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ v t1))
double code(double u, double v, double t1) {
	return v / t1;
}
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
end function
public static double code(double u, double v, double t1) {
	return v / t1;
}
def code(u, v, t1):
	return v / t1
function code(u, v, t1)
	return Float64(v / t1)
end
function tmp = code(u, v, t1)
	tmp = v / t1;
end
code[u_, v_, t1_] := N[(v / t1), $MachinePrecision]
\begin{array}{l}

\\
\frac{v}{t1}
\end{array}
Derivation
  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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{t1} + \left(-u\right)\right)} \]
    13. sub-neg58.5%

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

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

    \[\leadsto \color{blue}{\frac{v}{t1}} \]
  8. Final simplification14.7%

    \[\leadsto \frac{v}{t1} \]
  9. Add Preprocessing

Reproduce

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