
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ y a) (- z t) x))
double code(double x, double y, double z, double t, double a) {
return fma((y / a), (z - t), x);
}
function code(x, y, z, t, a) return fma(Float64(y / a), Float64(z - t), x) end
code[x_, y_, z_, t_, a_] := N[(N[(y / a), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y}{a}, z - t, x\right)
\end{array}
Initial program 89.2%
+-commutative89.2%
associate-*l/97.1%
fma-def97.1%
Simplified97.1%
Final simplification97.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ y a) z))) (t_2 (* (/ y a) (- t))))
(if (<= t -4.4e+135)
t_2
(if (<= t 1.32e+109)
t_1
(if (<= t 9.8e+135) (/ t (/ (- a) y)) (if (<= t 9.5e+194) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y / a) * z);
double t_2 = (y / a) * -t;
double tmp;
if (t <= -4.4e+135) {
tmp = t_2;
} else if (t <= 1.32e+109) {
tmp = t_1;
} else if (t <= 9.8e+135) {
tmp = t / (-a / y);
} else if (t <= 9.5e+194) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + ((y / a) * z)
t_2 = (y / a) * -t
if (t <= (-4.4d+135)) then
tmp = t_2
else if (t <= 1.32d+109) then
tmp = t_1
else if (t <= 9.8d+135) then
tmp = t / (-a / y)
else if (t <= 9.5d+194) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y / a) * z);
double t_2 = (y / a) * -t;
double tmp;
if (t <= -4.4e+135) {
tmp = t_2;
} else if (t <= 1.32e+109) {
tmp = t_1;
} else if (t <= 9.8e+135) {
tmp = t / (-a / y);
} else if (t <= 9.5e+194) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y / a) * z) t_2 = (y / a) * -t tmp = 0 if t <= -4.4e+135: tmp = t_2 elif t <= 1.32e+109: tmp = t_1 elif t <= 9.8e+135: tmp = t / (-a / y) elif t <= 9.5e+194: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y / a) * z)) t_2 = Float64(Float64(y / a) * Float64(-t)) tmp = 0.0 if (t <= -4.4e+135) tmp = t_2; elseif (t <= 1.32e+109) tmp = t_1; elseif (t <= 9.8e+135) tmp = Float64(t / Float64(Float64(-a) / y)); elseif (t <= 9.5e+194) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y / a) * z); t_2 = (y / a) * -t; tmp = 0.0; if (t <= -4.4e+135) tmp = t_2; elseif (t <= 1.32e+109) tmp = t_1; elseif (t <= 9.8e+135) tmp = t / (-a / y); elseif (t <= 9.5e+194) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] * (-t)), $MachinePrecision]}, If[LessEqual[t, -4.4e+135], t$95$2, If[LessEqual[t, 1.32e+109], t$95$1, If[LessEqual[t, 9.8e+135], N[(t / N[((-a) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e+194], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{a} \cdot z\\
t_2 := \frac{y}{a} \cdot \left(-t\right)\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{+135}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.32 \cdot 10^{+109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9.8 \cdot 10^{+135}:\\
\;\;\;\;\frac{t}{\frac{-a}{y}}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+194}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -4.3999999999999999e135 or 9.5e194 < t Initial program 84.7%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in z around 0 80.3%
mul-1-neg80.3%
associate-*l/94.0%
distribute-rgt-neg-out94.0%
+-commutative94.0%
*-commutative94.0%
distribute-lft-neg-out94.0%
unsub-neg94.0%
Simplified94.0%
clear-num92.8%
div-inv92.8%
Applied egg-rr92.8%
Taylor expanded in x around 0 70.7%
mul-1-neg70.7%
associate-*l/80.5%
distribute-lft-neg-in80.5%
*-commutative80.5%
Simplified80.5%
if -4.3999999999999999e135 < t < 1.32000000000000008e109 or 9.8000000000000002e135 < t < 9.5e194Initial program 90.7%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in t around 0 78.3%
associate-*l/85.9%
*-commutative85.9%
Simplified85.9%
if 1.32000000000000008e109 < t < 9.8000000000000002e135Initial program 99.8%
associate-*l/99.6%
Simplified99.6%
Taylor expanded in y around inf 86.1%
Taylor expanded in z around 0 84.4%
mul-1-neg84.4%
distribute-frac-neg84.4%
Simplified84.4%
associate-*l/98.1%
associate-/l*97.8%
distribute-neg-frac97.8%
frac-2neg97.8%
distribute-neg-frac97.8%
remove-double-neg97.8%
distribute-neg-frac97.8%
Applied egg-rr97.8%
Final simplification84.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y a) (- t))))
(if (<= t -2.5e+134)
t_1
(if (<= t -4.5e-138)
x
(if (<= t -6.2e-214) (* y (/ z a)) (if (<= t 1.9e+108) x t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / a) * -t;
double tmp;
if (t <= -2.5e+134) {
tmp = t_1;
} else if (t <= -4.5e-138) {
tmp = x;
} else if (t <= -6.2e-214) {
tmp = y * (z / a);
} else if (t <= 1.9e+108) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y / a) * -t
if (t <= (-2.5d+134)) then
tmp = t_1
else if (t <= (-4.5d-138)) then
tmp = x
else if (t <= (-6.2d-214)) then
tmp = y * (z / a)
else if (t <= 1.9d+108) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y / a) * -t;
double tmp;
if (t <= -2.5e+134) {
tmp = t_1;
} else if (t <= -4.5e-138) {
tmp = x;
} else if (t <= -6.2e-214) {
tmp = y * (z / a);
} else if (t <= 1.9e+108) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / a) * -t tmp = 0 if t <= -2.5e+134: tmp = t_1 elif t <= -4.5e-138: tmp = x elif t <= -6.2e-214: tmp = y * (z / a) elif t <= 1.9e+108: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / a) * Float64(-t)) tmp = 0.0 if (t <= -2.5e+134) tmp = t_1; elseif (t <= -4.5e-138) tmp = x; elseif (t <= -6.2e-214) tmp = Float64(y * Float64(z / a)); elseif (t <= 1.9e+108) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / a) * -t; tmp = 0.0; if (t <= -2.5e+134) tmp = t_1; elseif (t <= -4.5e-138) tmp = x; elseif (t <= -6.2e-214) tmp = y * (z / a); elseif (t <= 1.9e+108) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * (-t)), $MachinePrecision]}, If[LessEqual[t, -2.5e+134], t$95$1, If[LessEqual[t, -4.5e-138], x, If[LessEqual[t, -6.2e-214], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e+108], x, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot \left(-t\right)\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{+134}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{-138}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -6.2 \cdot 10^{-214}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+108}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -2.4999999999999999e134 or 1.90000000000000004e108 < t Initial program 84.9%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in z around 0 80.2%
mul-1-neg80.2%
associate-*l/93.0%
distribute-rgt-neg-out93.0%
+-commutative93.0%
*-commutative93.0%
distribute-lft-neg-out93.0%
unsub-neg93.0%
Simplified93.0%
clear-num92.0%
div-inv92.1%
Applied egg-rr92.1%
Taylor expanded in x around 0 66.4%
mul-1-neg66.4%
associate-*l/76.1%
distribute-lft-neg-in76.1%
*-commutative76.1%
Simplified76.1%
if -2.4999999999999999e134 < t < -4.50000000000000008e-138 or -6.20000000000000008e-214 < t < 1.90000000000000004e108Initial program 91.8%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in x around inf 55.2%
if -4.50000000000000008e-138 < t < -6.20000000000000008e-214Initial program 91.0%
associate-*l/82.9%
Simplified82.9%
Taylor expanded in y around inf 82.5%
Taylor expanded in z around inf 64.6%
Final simplification63.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.2e-13) (not (<= z 3.4e+93))) (+ x (* (/ y a) z)) (- x (* (/ y a) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.2e-13) || !(z <= 3.4e+93)) {
tmp = x + ((y / a) * z);
} else {
tmp = x - ((y / a) * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-8.2d-13)) .or. (.not. (z <= 3.4d+93))) then
tmp = x + ((y / a) * z)
else
tmp = x - ((y / a) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.2e-13) || !(z <= 3.4e+93)) {
tmp = x + ((y / a) * z);
} else {
tmp = x - ((y / a) * t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.2e-13) or not (z <= 3.4e+93): tmp = x + ((y / a) * z) else: tmp = x - ((y / a) * t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.2e-13) || !(z <= 3.4e+93)) tmp = Float64(x + Float64(Float64(y / a) * z)); else tmp = Float64(x - Float64(Float64(y / a) * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.2e-13) || ~((z <= 3.4e+93))) tmp = x + ((y / a) * z); else tmp = x - ((y / a) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.2e-13], N[Not[LessEqual[z, 3.4e+93]], $MachinePrecision]], N[(x + N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{-13} \lor \neg \left(z \leq 3.4 \cdot 10^{+93}\right):\\
\;\;\;\;x + \frac{y}{a} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{a} \cdot t\\
\end{array}
\end{array}
if z < -8.2000000000000004e-13 or 3.4e93 < z Initial program 84.7%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in t around 0 74.1%
associate-*l/84.7%
*-commutative84.7%
Simplified84.7%
if -8.2000000000000004e-13 < z < 3.4e93Initial program 92.7%
associate-*l/95.9%
Simplified95.9%
Taylor expanded in z around 0 88.3%
mul-1-neg88.3%
associate-*l/91.9%
distribute-rgt-neg-out91.9%
+-commutative91.9%
*-commutative91.9%
distribute-lft-neg-out91.9%
unsub-neg91.9%
Simplified91.9%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -38000000.0) (not (<= y 7e+20))) (* (/ y a) z) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -38000000.0) || !(y <= 7e+20)) {
tmp = (y / a) * z;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-38000000.0d0)) .or. (.not. (y <= 7d+20))) then
tmp = (y / a) * z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -38000000.0) || !(y <= 7e+20)) {
tmp = (y / a) * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -38000000.0) or not (y <= 7e+20): tmp = (y / a) * z else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -38000000.0) || !(y <= 7e+20)) tmp = Float64(Float64(y / a) * z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -38000000.0) || ~((y <= 7e+20))) tmp = (y / a) * z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -38000000.0], N[Not[LessEqual[y, 7e+20]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -38000000 \lor \neg \left(y \leq 7 \cdot 10^{+20}\right):\\
\;\;\;\;\frac{y}{a} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.8e7 or 7e20 < y Initial program 81.0%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in y around inf 81.6%
Taylor expanded in z around inf 43.2%
associate-*l/35.6%
associate-/l*45.3%
Applied egg-rr45.3%
clear-num45.2%
associate-/r/45.3%
clear-num45.3%
Applied egg-rr45.3%
if -3.8e7 < y < 7e20Initial program 98.3%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in x around inf 65.8%
Final simplification55.1%
(FPCore (x y z t a) :precision binary64 (+ x (* (/ y a) (- z t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (z - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y / a) * (z - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (z - t));
}
def code(x, y, z, t, a): return x + ((y / a) * (z - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y / a) * Float64(z - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y / a) * (z - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y / a), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{a} \cdot \left(z - t\right)
\end{array}
Initial program 89.2%
associate-*l/97.1%
Simplified97.1%
Final simplification97.1%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 89.2%
associate-*l/97.1%
Simplified97.1%
Taylor expanded in x around inf 39.9%
Final simplification39.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ a (- z t))))
(if (< y -1.0761266216389975e-10)
(+ x (/ 1.0 (/ t_1 y)))
(if (< y 2.894426862792089e-49)
(+ x (/ (* y (- z t)) a))
(+ x (/ y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x + (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a / (z - t)
if (y < (-1.0761266216389975d-10)) then
tmp = x + (1.0d0 / (t_1 / y))
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) / a)
else
tmp = x + (y / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x + (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a / (z - t) tmp = 0 if y < -1.0761266216389975e-10: tmp = x + (1.0 / (t_1 / y)) elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) / a) else: tmp = x + (y / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(a / Float64(z - t)) tmp = 0.0 if (y < -1.0761266216389975e-10) tmp = Float64(x + Float64(1.0 / Float64(t_1 / y))); elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x + Float64(y / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a / (z - t); tmp = 0.0; if (y < -1.0761266216389975e-10) tmp = x + (1.0 / (t_1 / y)); elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) / a); else tmp = x + (y / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -1.0761266216389975e-10], N[(x + N[(1.0 / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x + \frac{1}{\frac{t_1}{y}}\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t_1}\\
\end{array}
\end{array}
herbie shell --seed 2023268
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:precision binary64
:herbie-target
(if (< y -1.0761266216389975e-10) (+ x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
(+ x (/ (* y (- z t)) a)))