
(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 13 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 (if (<= y -5e-24) (- x (/ y (/ a (- z t)))) (+ x (/ (* y (- t z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5e-24) {
tmp = x - (y / (a / (z - t)));
} else {
tmp = x + ((y * (t - z)) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-5d-24)) then
tmp = x - (y / (a / (z - t)))
else
tmp = x + ((y * (t - z)) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5e-24) {
tmp = x - (y / (a / (z - t)));
} else {
tmp = x + ((y * (t - z)) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5e-24: tmp = x - (y / (a / (z - t))) else: tmp = x + ((y * (t - z)) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5e-24) tmp = Float64(x - Float64(y / Float64(a / Float64(z - t)))); else tmp = Float64(x + Float64(Float64(y * Float64(t - z)) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5e-24) tmp = x - (y / (a / (z - t))); else tmp = x + ((y * (t - z)) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5e-24], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-24}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(t - z\right)}{a}\\
\end{array}
\end{array}
if y < -4.9999999999999998e-24Initial program 88.9%
associate-/l*99.8%
Simplified99.8%
if -4.9999999999999998e-24 < y Initial program 96.7%
Final simplification97.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ (- y) a))))
(if (<= t -2.7e-12)
(/ t (/ a y))
(if (<= t -9.2e-227)
x
(if (<= t -6.5e-257)
t_1
(if (<= t 7e-135)
x
(if (<= t 9.5e-66)
t_1
(if (<= t 40000000000000.0) x (/ (* y t) a)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (-y / a);
double tmp;
if (t <= -2.7e-12) {
tmp = t / (a / y);
} else if (t <= -9.2e-227) {
tmp = x;
} else if (t <= -6.5e-257) {
tmp = t_1;
} else if (t <= 7e-135) {
tmp = x;
} else if (t <= 9.5e-66) {
tmp = t_1;
} else if (t <= 40000000000000.0) {
tmp = x;
} else {
tmp = (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) :: t_1
real(8) :: tmp
t_1 = z * (-y / a)
if (t <= (-2.7d-12)) then
tmp = t / (a / y)
else if (t <= (-9.2d-227)) then
tmp = x
else if (t <= (-6.5d-257)) then
tmp = t_1
else if (t <= 7d-135) then
tmp = x
else if (t <= 9.5d-66) then
tmp = t_1
else if (t <= 40000000000000.0d0) then
tmp = x
else
tmp = (y * t) / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = z * (-y / a);
double tmp;
if (t <= -2.7e-12) {
tmp = t / (a / y);
} else if (t <= -9.2e-227) {
tmp = x;
} else if (t <= -6.5e-257) {
tmp = t_1;
} else if (t <= 7e-135) {
tmp = x;
} else if (t <= 9.5e-66) {
tmp = t_1;
} else if (t <= 40000000000000.0) {
tmp = x;
} else {
tmp = (y * t) / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (-y / a) tmp = 0 if t <= -2.7e-12: tmp = t / (a / y) elif t <= -9.2e-227: tmp = x elif t <= -6.5e-257: tmp = t_1 elif t <= 7e-135: tmp = x elif t <= 9.5e-66: tmp = t_1 elif t <= 40000000000000.0: tmp = x else: tmp = (y * t) / a return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(Float64(-y) / a)) tmp = 0.0 if (t <= -2.7e-12) tmp = Float64(t / Float64(a / y)); elseif (t <= -9.2e-227) tmp = x; elseif (t <= -6.5e-257) tmp = t_1; elseif (t <= 7e-135) tmp = x; elseif (t <= 9.5e-66) tmp = t_1; elseif (t <= 40000000000000.0) tmp = x; else tmp = Float64(Float64(y * t) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (-y / a); tmp = 0.0; if (t <= -2.7e-12) tmp = t / (a / y); elseif (t <= -9.2e-227) tmp = x; elseif (t <= -6.5e-257) tmp = t_1; elseif (t <= 7e-135) tmp = x; elseif (t <= 9.5e-66) tmp = t_1; elseif (t <= 40000000000000.0) tmp = x; else tmp = (y * t) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.7e-12], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -9.2e-227], x, If[LessEqual[t, -6.5e-257], t$95$1, If[LessEqual[t, 7e-135], x, If[LessEqual[t, 9.5e-66], t$95$1, If[LessEqual[t, 40000000000000.0], x, N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{-y}{a}\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{-12}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;t \leq -9.2 \cdot 10^{-227}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -6.5 \cdot 10^{-257}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-135}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 40000000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\end{array}
\end{array}
if t < -2.6999999999999998e-12Initial program 90.4%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in t around inf 60.4%
associate-/l*61.9%
Simplified61.9%
if -2.6999999999999998e-12 < t < -9.20000000000000048e-227 or -6.5000000000000002e-257 < t < 6.9999999999999997e-135 or 9.5000000000000004e-66 < t < 4e13Initial program 95.5%
associate-*l/94.0%
Simplified94.0%
Taylor expanded in x around inf 53.7%
if -9.20000000000000048e-227 < t < -6.5000000000000002e-257 or 6.9999999999999997e-135 < t < 9.5000000000000004e-66Initial program 95.8%
associate-*l/92.3%
Simplified92.3%
Taylor expanded in z around inf 60.1%
mul-1-neg60.1%
associate-*l/64.4%
distribute-rgt-neg-in64.4%
Simplified64.4%
if 4e13 < t Initial program 96.7%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in t around inf 62.4%
Final simplification58.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.5e-39)
(/ t (/ a y))
(if (<= t -2.1e-275)
(* (/ -1.0 a) (* y z))
(if (<= t 5.4e-135)
x
(if (<= t 8.5e-67)
(* z (/ (- y) a))
(if (<= t 6600000000000.0) x (/ (* y t) a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.5e-39) {
tmp = t / (a / y);
} else if (t <= -2.1e-275) {
tmp = (-1.0 / a) * (y * z);
} else if (t <= 5.4e-135) {
tmp = x;
} else if (t <= 8.5e-67) {
tmp = z * (-y / a);
} else if (t <= 6600000000000.0) {
tmp = x;
} else {
tmp = (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 (t <= (-3.5d-39)) then
tmp = t / (a / y)
else if (t <= (-2.1d-275)) then
tmp = ((-1.0d0) / a) * (y * z)
else if (t <= 5.4d-135) then
tmp = x
else if (t <= 8.5d-67) then
tmp = z * (-y / a)
else if (t <= 6600000000000.0d0) then
tmp = x
else
tmp = (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 (t <= -3.5e-39) {
tmp = t / (a / y);
} else if (t <= -2.1e-275) {
tmp = (-1.0 / a) * (y * z);
} else if (t <= 5.4e-135) {
tmp = x;
} else if (t <= 8.5e-67) {
tmp = z * (-y / a);
} else if (t <= 6600000000000.0) {
tmp = x;
} else {
tmp = (y * t) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.5e-39: tmp = t / (a / y) elif t <= -2.1e-275: tmp = (-1.0 / a) * (y * z) elif t <= 5.4e-135: tmp = x elif t <= 8.5e-67: tmp = z * (-y / a) elif t <= 6600000000000.0: tmp = x else: tmp = (y * t) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.5e-39) tmp = Float64(t / Float64(a / y)); elseif (t <= -2.1e-275) tmp = Float64(Float64(-1.0 / a) * Float64(y * z)); elseif (t <= 5.4e-135) tmp = x; elseif (t <= 8.5e-67) tmp = Float64(z * Float64(Float64(-y) / a)); elseif (t <= 6600000000000.0) tmp = x; else tmp = Float64(Float64(y * t) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.5e-39) tmp = t / (a / y); elseif (t <= -2.1e-275) tmp = (-1.0 / a) * (y * z); elseif (t <= 5.4e-135) tmp = x; elseif (t <= 8.5e-67) tmp = z * (-y / a); elseif (t <= 6600000000000.0) tmp = x; else tmp = (y * t) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.5e-39], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.1e-275], N[(N[(-1.0 / a), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.4e-135], x, If[LessEqual[t, 8.5e-67], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6600000000000.0], x, N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-39}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;t \leq -2.1 \cdot 10^{-275}:\\
\;\;\;\;\frac{-1}{a} \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{-135}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-67}:\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\mathbf{elif}\;t \leq 6600000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\end{array}
\end{array}
if t < -3.5e-39Initial program 90.8%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in t around inf 57.7%
associate-/l*59.1%
Simplified59.1%
if -3.5e-39 < t < -2.09999999999999988e-275Initial program 96.4%
associate-*l/89.7%
Simplified89.7%
Taylor expanded in z around inf 50.8%
mul-1-neg50.8%
associate-*l/46.1%
distribute-rgt-neg-in46.1%
Simplified46.1%
distribute-rgt-neg-out46.1%
associate-/r/47.5%
clear-num47.5%
distribute-neg-frac47.5%
metadata-eval47.5%
associate-/l/50.8%
add-sqr-sqrt33.8%
sqrt-unprod28.9%
sqr-neg28.9%
sqrt-unprod2.2%
add-sqr-sqrt3.5%
*-commutative3.5%
add-sqr-sqrt2.2%
sqrt-unprod28.9%
sqr-neg28.9%
sqrt-unprod33.8%
add-sqr-sqrt50.8%
Applied egg-rr50.8%
associate-/r/50.8%
*-commutative50.8%
Simplified50.8%
if -2.09999999999999988e-275 < t < 5.39999999999999997e-135 or 8.49999999999999993e-67 < t < 6.6e12Initial program 94.9%
associate-*l/98.4%
Simplified98.4%
Taylor expanded in x around inf 61.1%
if 5.39999999999999997e-135 < t < 8.49999999999999993e-67Initial program 94.6%
associate-*l/89.7%
Simplified89.7%
Taylor expanded in z around inf 46.9%
mul-1-neg46.9%
associate-*l/52.5%
distribute-rgt-neg-in52.5%
Simplified52.5%
if 6.6e12 < t Initial program 96.7%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in t around inf 62.4%
Final simplification58.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -4.1e+15) (not (<= x 4.3e-10))) (+ x (* t (/ y a))) (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -4.1e+15) || !(x <= 4.3e-10)) {
tmp = x + (t * (y / a));
} else {
tmp = (y / a) * (t - z);
}
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 ((x <= (-4.1d+15)) .or. (.not. (x <= 4.3d-10))) then
tmp = x + (t * (y / a))
else
tmp = (y / a) * (t - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -4.1e+15) || !(x <= 4.3e-10)) {
tmp = x + (t * (y / a));
} else {
tmp = (y / a) * (t - z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -4.1e+15) or not (x <= 4.3e-10): tmp = x + (t * (y / a)) else: tmp = (y / a) * (t - z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -4.1e+15) || !(x <= 4.3e-10)) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(Float64(y / a) * Float64(t - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -4.1e+15) || ~((x <= 4.3e-10))) tmp = x + (t * (y / a)); else tmp = (y / a) * (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -4.1e+15], N[Not[LessEqual[x, 4.3e-10]], $MachinePrecision]], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.1 \cdot 10^{+15} \lor \neg \left(x \leq 4.3 \cdot 10^{-10}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if x < -4.1e15 or 4.30000000000000014e-10 < x Initial program 94.7%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in z around 0 76.8%
sub-neg76.8%
mul-1-neg76.8%
remove-double-neg76.8%
+-commutative76.8%
associate-*r/80.5%
Simplified80.5%
if -4.1e15 < x < 4.30000000000000014e-10Initial program 94.6%
associate-*l/94.7%
Simplified94.7%
*-commutative94.7%
clear-num94.5%
un-div-inv94.6%
Applied egg-rr94.6%
Taylor expanded in x around 0 81.8%
mul-1-neg81.8%
associate-*l/81.9%
distribute-rgt-out--78.0%
sub-neg78.0%
+-commutative78.0%
distribute-neg-in78.0%
remove-double-neg78.0%
sub-neg78.0%
distribute-rgt-out--81.9%
Simplified81.9%
Final simplification81.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9.5) (not (<= t 1050000000000.0))) (+ x (* t (/ y a))) (- x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.5) || !(t <= 1050000000000.0)) {
tmp = x + (t * (y / a));
} else {
tmp = x - (y / (a / z));
}
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 <= (-9.5d0)) .or. (.not. (t <= 1050000000000.0d0))) then
tmp = x + (t * (y / a))
else
tmp = x - (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.5) || !(t <= 1050000000000.0)) {
tmp = x + (t * (y / a));
} else {
tmp = x - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9.5) or not (t <= 1050000000000.0): tmp = x + (t * (y / a)) else: tmp = x - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9.5) || !(t <= 1050000000000.0)) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x - Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -9.5) || ~((t <= 1050000000000.0))) tmp = x + (t * (y / a)); else tmp = x - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9.5], N[Not[LessEqual[t, 1050000000000.0]], $MachinePrecision]], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \lor \neg \left(t \leq 1050000000000\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -9.5 or 1.05e12 < t Initial program 93.5%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in z around 0 80.4%
sub-neg80.4%
mul-1-neg80.4%
remove-double-neg80.4%
+-commutative80.4%
associate-*r/81.1%
Simplified81.1%
if -9.5 < t < 1.05e12Initial program 95.6%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in z around inf 87.4%
Final simplification84.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.7e+128) x (if (<= a 2.3e+35) (* (/ y a) (- t z)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.7e+128) {
tmp = x;
} else if (a <= 2.3e+35) {
tmp = (y / a) * (t - 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 (a <= (-6.7d+128)) then
tmp = x
else if (a <= 2.3d+35) then
tmp = (y / a) * (t - 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 (a <= -6.7e+128) {
tmp = x;
} else if (a <= 2.3e+35) {
tmp = (y / a) * (t - z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.7e+128: tmp = x elif a <= 2.3e+35: tmp = (y / a) * (t - z) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.7e+128) tmp = x; elseif (a <= 2.3e+35) tmp = Float64(Float64(y / a) * Float64(t - z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6.7e+128) tmp = x; elseif (a <= 2.3e+35) tmp = (y / a) * (t - z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.7e+128], x, If[LessEqual[a, 2.3e+35], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.7 \cdot 10^{+128}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{+35}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -6.69999999999999993e128 or 2.2999999999999998e35 < a Initial program 86.4%
associate-*l/94.2%
Simplified94.2%
Taylor expanded in x around inf 62.3%
if -6.69999999999999993e128 < a < 2.2999999999999998e35Initial program 98.7%
associate-*l/95.5%
Simplified95.5%
*-commutative95.5%
clear-num95.4%
un-div-inv96.6%
Applied egg-rr96.6%
Taylor expanded in x around 0 77.7%
mul-1-neg77.7%
associate-*l/75.1%
distribute-rgt-out--65.6%
sub-neg65.6%
+-commutative65.6%
distribute-neg-in65.6%
remove-double-neg65.6%
sub-neg65.6%
distribute-rgt-out--75.1%
Simplified75.1%
Final simplification70.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9e-19) (not (<= t 4400000000000.0))) (* t (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9e-19) || !(t <= 4400000000000.0)) {
tmp = t * (y / a);
} 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 ((t <= (-9d-19)) .or. (.not. (t <= 4400000000000.0d0))) then
tmp = t * (y / a)
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 ((t <= -9e-19) || !(t <= 4400000000000.0)) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9e-19) or not (t <= 4400000000000.0): tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9e-19) || !(t <= 4400000000000.0)) tmp = Float64(t * Float64(y / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -9e-19) || ~((t <= 4400000000000.0))) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9e-19], N[Not[LessEqual[t, 4400000000000.0]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{-19} \lor \neg \left(t \leq 4400000000000\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -9.00000000000000026e-19 or 4.4e12 < t Initial program 93.6%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in t around inf 61.4%
associate-*r/60.7%
Simplified60.7%
if -9.00000000000000026e-19 < t < 4.4e12Initial program 95.6%
associate-*l/93.7%
Simplified93.7%
Taylor expanded in x around inf 48.2%
Final simplification54.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.8e-17) (* t (/ y a)) (if (<= t 2.4e+14) x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.8e-17) {
tmp = t * (y / a);
} else if (t <= 2.4e+14) {
tmp = x;
} else {
tmp = 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 (t <= (-6.8d-17)) then
tmp = t * (y / a)
else if (t <= 2.4d+14) then
tmp = x
else
tmp = 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 (t <= -6.8e-17) {
tmp = t * (y / a);
} else if (t <= 2.4e+14) {
tmp = x;
} else {
tmp = y * (t / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.8e-17: tmp = t * (y / a) elif t <= 2.4e+14: tmp = x else: tmp = y * (t / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.8e-17) tmp = Float64(t * Float64(y / a)); elseif (t <= 2.4e+14) tmp = x; else tmp = Float64(y * Float64(t / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6.8e-17) tmp = t * (y / a); elseif (t <= 2.4e+14) tmp = x; else tmp = y * (t / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.8e-17], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e+14], x, N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{-17}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{+14}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if t < -6.7999999999999996e-17Initial program 90.4%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in t around inf 60.4%
associate-*r/61.9%
Simplified61.9%
if -6.7999999999999996e-17 < t < 2.4e14Initial program 95.6%
associate-*l/93.7%
Simplified93.7%
Taylor expanded in x around inf 48.2%
if 2.4e14 < t Initial program 96.7%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in t around inf 62.4%
associate-/l*59.5%
Simplified59.5%
associate-/r/59.7%
Applied egg-rr59.7%
Final simplification54.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.5e-17) (/ t (/ a y)) (if (<= t 1.3e+15) x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.5e-17) {
tmp = t / (a / y);
} else if (t <= 1.3e+15) {
tmp = x;
} else {
tmp = 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 (t <= (-5.5d-17)) then
tmp = t / (a / y)
else if (t <= 1.3d+15) then
tmp = x
else
tmp = 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 (t <= -5.5e-17) {
tmp = t / (a / y);
} else if (t <= 1.3e+15) {
tmp = x;
} else {
tmp = y * (t / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.5e-17: tmp = t / (a / y) elif t <= 1.3e+15: tmp = x else: tmp = y * (t / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.5e-17) tmp = Float64(t / Float64(a / y)); elseif (t <= 1.3e+15) tmp = x; else tmp = Float64(y * Float64(t / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.5e-17) tmp = t / (a / y); elseif (t <= 1.3e+15) tmp = x; else tmp = y * (t / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.5e-17], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e+15], x, N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-17}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if t < -5.50000000000000001e-17Initial program 90.4%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in t around inf 60.4%
associate-/l*61.9%
Simplified61.9%
if -5.50000000000000001e-17 < t < 1.3e15Initial program 95.6%
associate-*l/93.7%
Simplified93.7%
Taylor expanded in x around inf 48.2%
if 1.3e15 < t Initial program 96.7%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in t around inf 62.4%
associate-/l*59.5%
Simplified59.5%
associate-/r/59.7%
Applied egg-rr59.7%
Final simplification54.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.5e-12) (/ t (/ a y)) (if (<= t 112000000000.0) x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.5e-12) {
tmp = t / (a / y);
} else if (t <= 112000000000.0) {
tmp = x;
} else {
tmp = 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 (t <= (-4.5d-12)) then
tmp = t / (a / y)
else if (t <= 112000000000.0d0) then
tmp = x
else
tmp = 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 (t <= -4.5e-12) {
tmp = t / (a / y);
} else if (t <= 112000000000.0) {
tmp = x;
} else {
tmp = y / (a / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.5e-12: tmp = t / (a / y) elif t <= 112000000000.0: tmp = x else: tmp = y / (a / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.5e-12) tmp = Float64(t / Float64(a / y)); elseif (t <= 112000000000.0) tmp = x; else tmp = Float64(y / Float64(a / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.5e-12) tmp = t / (a / y); elseif (t <= 112000000000.0) tmp = x; else tmp = y / (a / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.5e-12], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 112000000000.0], x, N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;t \leq 112000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if t < -4.49999999999999981e-12Initial program 90.4%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in t around inf 60.4%
associate-/l*61.9%
Simplified61.9%
if -4.49999999999999981e-12 < t < 1.12e11Initial program 95.6%
associate-*l/93.7%
Simplified93.7%
Taylor expanded in x around inf 48.2%
if 1.12e11 < t Initial program 96.7%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in t around inf 62.4%
associate-/l*59.5%
Simplified59.5%
clear-num59.5%
associate-/r/59.5%
clear-num59.5%
Applied egg-rr59.5%
associate-/r/60.4%
Applied egg-rr60.4%
Final simplification54.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.5e-12) (/ t (/ a y)) (if (<= t 1.35e+15) x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.5e-12) {
tmp = t / (a / y);
} else if (t <= 1.35e+15) {
tmp = x;
} else {
tmp = (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 (t <= (-1.5d-12)) then
tmp = t / (a / y)
else if (t <= 1.35d+15) then
tmp = x
else
tmp = (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 (t <= -1.5e-12) {
tmp = t / (a / y);
} else if (t <= 1.35e+15) {
tmp = x;
} else {
tmp = (y * t) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.5e-12: tmp = t / (a / y) elif t <= 1.35e+15: tmp = x else: tmp = (y * t) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.5e-12) tmp = Float64(t / Float64(a / y)); elseif (t <= 1.35e+15) tmp = x; else tmp = Float64(Float64(y * t) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.5e-12) tmp = t / (a / y); elseif (t <= 1.35e+15) tmp = x; else tmp = (y * t) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.5e-12], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+15], x, N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+15}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\end{array}
\end{array}
if t < -1.5000000000000001e-12Initial program 90.4%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in t around inf 60.4%
associate-/l*61.9%
Simplified61.9%
if -1.5000000000000001e-12 < t < 1.35e15Initial program 95.6%
associate-*l/93.7%
Simplified93.7%
Taylor expanded in x around inf 48.2%
if 1.35e15 < t Initial program 96.7%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in t around inf 62.4%
Final simplification54.9%
(FPCore (x y z t a) :precision binary64 (+ x (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (t - z));
}
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) * (t - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (t - z));
}
def code(x, y, z, t, a): return x + ((y / a) * (t - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y / a) * Float64(t - z))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y / a) * (t - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{a} \cdot \left(t - z\right)
\end{array}
Initial program 94.6%
associate-*l/95.1%
Simplified95.1%
Final simplification95.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 94.6%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in x around inf 35.5%
Final simplification35.5%
(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 2024034
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
: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)))