
(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 8 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 (+ x (* (- z t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / 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 + ((z - t) * (y / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / a));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a}
\end{array}
Initial program 90.6%
*-commutative90.6%
associate-/l*96.9%
Applied egg-rr96.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e+92) (not (<= z 1.75e+27))) (+ x (* z (/ y a))) (- x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e+92) || !(z <= 1.75e+27)) {
tmp = x + (z * (y / a));
} else {
tmp = x - (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-9d+92)) .or. (.not. (z <= 1.75d+27))) then
tmp = x + (z * (y / a))
else
tmp = x - (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e+92) || !(z <= 1.75e+27)) {
tmp = x + (z * (y / a));
} else {
tmp = x - (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9e+92) or not (z <= 1.75e+27): tmp = x + (z * (y / a)) else: tmp = x - (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9e+92) || !(z <= 1.75e+27)) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x - Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9e+92) || ~((z <= 1.75e+27))) tmp = x + (z * (y / a)); else tmp = x - (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9e+92], N[Not[LessEqual[z, 1.75e+27]], $MachinePrecision]], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+92} \lor \neg \left(z \leq 1.75 \cdot 10^{+27}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -8.9999999999999998e92 or 1.7500000000000001e27 < z Initial program 86.2%
*-commutative86.2%
associate-/l*98.8%
Applied egg-rr98.8%
Taylor expanded in z around inf 77.8%
*-commutative77.8%
associate-*r/88.9%
Simplified88.9%
if -8.9999999999999998e92 < z < 1.7500000000000001e27Initial program 93.6%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around 0 84.0%
mul-1-neg84.0%
unsub-neg84.0%
*-commutative84.0%
associate-/l*87.2%
Simplified87.2%
Final simplification87.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.3e+92) (not (<= z 3.3e+24))) (+ x (* z (/ y a))) (- x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e+92) || !(z <= 3.3e+24)) {
tmp = x + (z * (y / a));
} else {
tmp = x - (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4.3d+92)) .or. (.not. (z <= 3.3d+24))) then
tmp = x + (z * (y / a))
else
tmp = x - (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e+92) || !(z <= 3.3e+24)) {
tmp = x + (z * (y / a));
} else {
tmp = x - (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.3e+92) or not (z <= 3.3e+24): tmp = x + (z * (y / a)) else: tmp = x - (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.3e+92) || !(z <= 3.3e+24)) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x - Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.3e+92) || ~((z <= 3.3e+24))) tmp = x + (z * (y / a)); else tmp = x - (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.3e+92], N[Not[LessEqual[z, 3.3e+24]], $MachinePrecision]], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+92} \lor \neg \left(z \leq 3.3 \cdot 10^{+24}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -4.2999999999999998e92 or 3.2999999999999999e24 < z Initial program 86.2%
*-commutative86.2%
associate-/l*98.8%
Applied egg-rr98.8%
Taylor expanded in z around inf 77.8%
*-commutative77.8%
associate-*r/88.9%
Simplified88.9%
if -4.2999999999999998e92 < z < 3.2999999999999999e24Initial program 93.6%
*-commutative93.6%
associate-/l*95.6%
Applied egg-rr95.6%
Taylor expanded in z around 0 84.0%
mul-1-neg84.0%
sub-neg84.0%
associate-/l*87.0%
Simplified87.0%
Final simplification87.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.8e+219) (not (<= t 4.7e+194))) (* t (/ (- y) a)) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.8e+219) || !(t <= 4.7e+194)) {
tmp = t * (-y / a);
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-7.8d+219)) .or. (.not. (t <= 4.7d+194))) then
tmp = t * (-y / a)
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.8e+219) || !(t <= 4.7e+194)) {
tmp = t * (-y / a);
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.8e+219) or not (t <= 4.7e+194): tmp = t * (-y / a) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.8e+219) || !(t <= 4.7e+194)) tmp = Float64(t * Float64(Float64(-y) / a)); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.8e+219) || ~((t <= 4.7e+194))) tmp = t * (-y / a); else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.8e+219], N[Not[LessEqual[t, 4.7e+194]], $MachinePrecision]], N[(t * N[((-y) / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{+219} \lor \neg \left(t \leq 4.7 \cdot 10^{+194}\right):\\
\;\;\;\;t \cdot \frac{-y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -7.7999999999999998e219 or 4.69999999999999972e194 < t Initial program 87.5%
*-commutative87.5%
associate-/l*97.8%
Applied egg-rr97.8%
Taylor expanded in z around 0 84.5%
mul-1-neg84.5%
sub-neg84.5%
associate-/l*90.9%
Simplified90.9%
Taylor expanded in x around 0 65.1%
mul-1-neg65.1%
associate-*l/65.4%
distribute-lft-neg-in65.4%
*-commutative65.4%
distribute-neg-frac65.4%
Simplified65.4%
Taylor expanded in y around 0 65.1%
mul-1-neg65.1%
associate-/l*69.3%
distribute-rgt-neg-in69.3%
Simplified69.3%
if -7.7999999999999998e219 < t < 4.69999999999999972e194Initial program 91.3%
*-commutative91.3%
associate-/l*96.7%
Applied egg-rr96.7%
Taylor expanded in z around inf 78.2%
*-commutative78.2%
associate-*r/82.7%
Simplified82.7%
Final simplification80.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4.4e-30) (not (<= y 3.7e+71))) (/ (- y) (/ a t)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.4e-30) || !(y <= 3.7e+71)) {
tmp = -y / (a / t);
} 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 <= (-4.4d-30)) .or. (.not. (y <= 3.7d+71))) then
tmp = -y / (a / t)
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 <= -4.4e-30) || !(y <= 3.7e+71)) {
tmp = -y / (a / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4.4e-30) or not (y <= 3.7e+71): tmp = -y / (a / t) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4.4e-30) || !(y <= 3.7e+71)) tmp = Float64(Float64(-y) / Float64(a / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -4.4e-30) || ~((y <= 3.7e+71))) tmp = -y / (a / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4.4e-30], N[Not[LessEqual[y, 3.7e+71]], $MachinePrecision]], N[((-y) / N[(a / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{-30} \lor \neg \left(y \leq 3.7 \cdot 10^{+71}\right):\\
\;\;\;\;\frac{-y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.39999999999999967e-30 or 3.7e71 < y Initial program 80.1%
*-commutative80.1%
associate-/l*95.0%
Applied egg-rr95.0%
Taylor expanded in z around 0 50.3%
mul-1-neg50.3%
sub-neg50.3%
associate-/l*59.3%
Simplified59.3%
Taylor expanded in x around 0 40.9%
mul-1-neg40.9%
associate-*l/47.5%
distribute-lft-neg-in47.5%
*-commutative47.5%
distribute-neg-frac47.5%
Simplified47.5%
distribute-frac-neg47.5%
distribute-rgt-neg-out47.5%
clear-num47.4%
add-sqr-sqrt24.2%
sqrt-unprod24.6%
sqr-neg24.6%
sqrt-unprod4.7%
add-sqr-sqrt7.1%
un-div-inv7.1%
add-sqr-sqrt4.7%
sqrt-unprod24.7%
sqr-neg24.7%
sqrt-unprod24.2%
add-sqr-sqrt47.5%
Applied egg-rr47.5%
if -4.39999999999999967e-30 < y < 3.7e71Initial program 99.2%
associate-/l*92.0%
Simplified92.0%
Taylor expanded in x around inf 67.1%
Final simplification58.3%
(FPCore (x y z t a) :precision binary64 (if (<= y -4.4e-30) (/ (- y) (/ a t)) (if (<= y 8.2e+72) x (* t (/ (- y) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.4e-30) {
tmp = -y / (a / t);
} else if (y <= 8.2e+72) {
tmp = x;
} else {
tmp = t * (-y / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-4.4d-30)) then
tmp = -y / (a / t)
else if (y <= 8.2d+72) then
tmp = x
else
tmp = t * (-y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.4e-30) {
tmp = -y / (a / t);
} else if (y <= 8.2e+72) {
tmp = x;
} else {
tmp = t * (-y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.4e-30: tmp = -y / (a / t) elif y <= 8.2e+72: tmp = x else: tmp = t * (-y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.4e-30) tmp = Float64(Float64(-y) / Float64(a / t)); elseif (y <= 8.2e+72) tmp = x; else tmp = Float64(t * Float64(Float64(-y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.4e-30) tmp = -y / (a / t); elseif (y <= 8.2e+72) tmp = x; else tmp = t * (-y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.4e-30], N[((-y) / N[(a / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+72], x, N[(t * N[((-y) / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{-30}:\\
\;\;\;\;\frac{-y}{\frac{a}{t}}\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+72}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{-y}{a}\\
\end{array}
\end{array}
if y < -4.39999999999999967e-30Initial program 84.2%
*-commutative84.2%
associate-/l*94.7%
Applied egg-rr94.7%
Taylor expanded in z around 0 55.0%
mul-1-neg55.0%
sub-neg55.0%
associate-/l*58.8%
Simplified58.8%
Taylor expanded in x around 0 47.6%
mul-1-neg47.6%
associate-*l/51.6%
distribute-lft-neg-in51.6%
*-commutative51.6%
distribute-neg-frac51.6%
Simplified51.6%
distribute-frac-neg51.6%
distribute-rgt-neg-out51.6%
clear-num51.6%
add-sqr-sqrt26.3%
sqrt-unprod24.8%
sqr-neg24.8%
sqrt-unprod3.8%
add-sqr-sqrt7.2%
un-div-inv7.2%
add-sqr-sqrt3.8%
sqrt-unprod24.9%
sqr-neg24.9%
sqrt-unprod26.3%
add-sqr-sqrt51.7%
Applied egg-rr51.7%
if -4.39999999999999967e-30 < y < 8.19999999999999926e72Initial program 99.2%
associate-/l*92.0%
Simplified92.0%
Taylor expanded in x around inf 67.1%
if 8.19999999999999926e72 < y Initial program 73.1%
*-commutative73.1%
associate-/l*95.5%
Applied egg-rr95.5%
Taylor expanded in z around 0 42.1%
mul-1-neg42.1%
sub-neg42.1%
associate-/l*60.2%
Simplified60.2%
Taylor expanded in x around 0 29.1%
mul-1-neg29.1%
associate-*l/40.2%
distribute-lft-neg-in40.2%
*-commutative40.2%
distribute-neg-frac40.2%
Simplified40.2%
Taylor expanded in y around 0 29.1%
mul-1-neg29.1%
associate-/l*42.5%
distribute-rgt-neg-in42.5%
Simplified42.5%
Final simplification58.7%
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a}
\end{array}
Initial program 90.6%
associate-/l*95.5%
Simplified95.5%
(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 90.6%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in x around inf 43.4%
(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 2024132
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:precision binary64
:alt
(! :herbie-platform default (if (< y -430450648655599/4000000000000000000000000) (+ x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t)))))))
(+ x (/ (* y (- z t)) a)))