
(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 10 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 (* (/ 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 88.8%
associate-*l/97.9%
Simplified97.9%
Final simplification97.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.28e-260) (not (<= y 6e-177))) (- x (* y (/ (- z t) a))) (- x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.28e-260) || !(y <= 6e-177)) {
tmp = x - (y * ((z - t) / a));
} else {
tmp = x - ((y * 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 <= (-1.28d-260)) .or. (.not. (y <= 6d-177))) then
tmp = x - (y * ((z - t) / a))
else
tmp = x - ((y * 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 <= -1.28e-260) || !(y <= 6e-177)) {
tmp = x - (y * ((z - t) / a));
} else {
tmp = x - ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.28e-260) or not (y <= 6e-177): tmp = x - (y * ((z - t) / a)) else: tmp = x - ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.28e-260) || !(y <= 6e-177)) tmp = Float64(x - Float64(y * Float64(Float64(z - t) / a))); else tmp = Float64(x - Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.28e-260) || ~((y <= 6e-177))) tmp = x - (y * ((z - t) / a)); else tmp = x - ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.28e-260], N[Not[LessEqual[y, 6e-177]], $MachinePrecision]], N[(x - N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.28 \cdot 10^{-260} \lor \neg \left(y \leq 6 \cdot 10^{-177}\right):\\
\;\;\;\;x - y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if y < -1.28000000000000002e-260 or 6.00000000000000015e-177 < y Initial program 87.0%
associate-*r/96.0%
Simplified96.0%
if -1.28000000000000002e-260 < y < 6.00000000000000015e-177Initial program 99.8%
associate-*r/60.9%
Simplified60.9%
Taylor expanded in z around inf 86.6%
Final simplification94.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.4e+48) (not (<= t 4.2e+94))) (+ x (/ t (/ a y))) (- x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.4e+48) || !(t <= 4.2e+94)) {
tmp = x + (t / (a / y));
} else {
tmp = x - (y * (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 ((t <= (-1.4d+48)) .or. (.not. (t <= 4.2d+94))) then
tmp = x + (t / (a / y))
else
tmp = x - (y * (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 ((t <= -1.4e+48) || !(t <= 4.2e+94)) {
tmp = x + (t / (a / y));
} else {
tmp = x - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.4e+48) or not (t <= 4.2e+94): tmp = x + (t / (a / y)) else: tmp = x - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.4e+48) || !(t <= 4.2e+94)) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.4e+48) || ~((t <= 4.2e+94))) tmp = x + (t / (a / y)); else tmp = x - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.4e+48], N[Not[LessEqual[t, 4.2e+94]], $MachinePrecision]], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+48} \lor \neg \left(t \leq 4.2 \cdot 10^{+94}\right):\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.40000000000000006e48 or 4.19999999999999979e94 < t Initial program 83.1%
associate-*r/86.9%
Simplified86.9%
Taylor expanded in z around 0 74.8%
mul-1-neg74.8%
associate-*l/86.9%
distribute-rgt-neg-out86.9%
Simplified86.9%
Taylor expanded in x around 0 74.8%
associate-/l*78.0%
+-commutative78.0%
associate-/l*74.8%
*-commutative74.8%
associate-/l*86.9%
Simplified86.9%
if -1.40000000000000006e48 < t < 4.19999999999999979e94Initial program 92.6%
associate-*r/93.8%
Simplified93.8%
Taylor expanded in z around inf 87.2%
Final simplification87.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.4e+49) (not (<= t 7.4e+92))) (+ x (/ t (/ a y))) (- x (* (/ y a) z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e+49) || !(t <= 7.4e+92)) {
tmp = x + (t / (a / y));
} 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 <= (-3.4d+49)) .or. (.not. (t <= 7.4d+92))) then
tmp = x + (t / (a / y))
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 <= -3.4e+49) || !(t <= 7.4e+92)) {
tmp = x + (t / (a / y));
} else {
tmp = x - ((y / a) * z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.4e+49) or not (t <= 7.4e+92): tmp = x + (t / (a / y)) else: tmp = x - ((y / a) * z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.4e+49) || !(t <= 7.4e+92)) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x - Float64(Float64(y / a) * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.4e+49) || ~((t <= 7.4e+92))) tmp = x + (t / (a / y)); else tmp = x - ((y / a) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.4e+49], N[Not[LessEqual[t, 7.4e+92]], $MachinePrecision]], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+49} \lor \neg \left(t \leq 7.4 \cdot 10^{+92}\right):\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{a} \cdot z\\
\end{array}
\end{array}
if t < -3.4000000000000001e49 or 7.39999999999999997e92 < t Initial program 83.1%
associate-*r/86.9%
Simplified86.9%
Taylor expanded in z around 0 74.8%
mul-1-neg74.8%
associate-*l/86.9%
distribute-rgt-neg-out86.9%
Simplified86.9%
Taylor expanded in x around 0 74.8%
associate-/l*78.0%
+-commutative78.0%
associate-/l*74.8%
*-commutative74.8%
associate-/l*86.9%
Simplified86.9%
if -3.4000000000000001e49 < t < 7.39999999999999997e92Initial program 92.6%
associate-*r/93.8%
Simplified93.8%
Taylor expanded in z around inf 86.0%
associate-*l/91.8%
*-commutative91.8%
Simplified91.8%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -7.5e+46) (+ x (* (/ y a) t)) (if (<= t 1.8e+92) (- x (* (/ y a) z)) (+ x (/ t (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.5e+46) {
tmp = x + ((y / a) * t);
} else if (t <= 1.8e+92) {
tmp = x - ((y / a) * z);
} else {
tmp = x + (t / (a / y));
}
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.5d+46)) then
tmp = x + ((y / a) * t)
else if (t <= 1.8d+92) then
tmp = x - ((y / a) * z)
else
tmp = x + (t / (a / y))
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.5e+46) {
tmp = x + ((y / a) * t);
} else if (t <= 1.8e+92) {
tmp = x - ((y / a) * z);
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.5e+46: tmp = x + ((y / a) * t) elif t <= 1.8e+92: tmp = x - ((y / a) * z) else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.5e+46) tmp = Float64(x + Float64(Float64(y / a) * t)); elseif (t <= 1.8e+92) tmp = Float64(x - Float64(Float64(y / a) * z)); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.5e+46) tmp = x + ((y / a) * t); elseif (t <= 1.8e+92) tmp = x - ((y / a) * z); else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.5e+46], N[(x + N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e+92], N[(x - N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{+46}:\\
\;\;\;\;x + \frac{y}{a} \cdot t\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{+92}:\\
\;\;\;\;x - \frac{y}{a} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -7.5000000000000003e46Initial program 86.3%
associate-*r/88.2%
Simplified88.2%
Taylor expanded in z around 0 76.9%
mul-1-neg76.9%
associate-*l/86.7%
distribute-rgt-neg-out86.7%
Simplified86.7%
if -7.5000000000000003e46 < t < 1.8e92Initial program 92.6%
associate-*r/93.8%
Simplified93.8%
Taylor expanded in z around inf 86.0%
associate-*l/91.8%
*-commutative91.8%
Simplified91.8%
if 1.8e92 < t Initial program 80.3%
associate-*r/85.7%
Simplified85.7%
Taylor expanded in z around 0 72.8%
mul-1-neg72.8%
associate-*l/87.2%
distribute-rgt-neg-out87.2%
Simplified87.2%
Taylor expanded in x around 0 72.8%
associate-/l*77.8%
+-commutative77.8%
associate-/l*72.8%
*-commutative72.8%
associate-/l*87.2%
Simplified87.2%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.8e+27) (not (<= t 7.8e+72))) (* y (/ t a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.8e+27) || !(t <= 7.8e+72)) {
tmp = y * (t / 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 <= (-2.8d+27)) .or. (.not. (t <= 7.8d+72))) then
tmp = y * (t / 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 <= -2.8e+27) || !(t <= 7.8e+72)) {
tmp = y * (t / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.8e+27) or not (t <= 7.8e+72): tmp = y * (t / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.8e+27) || !(t <= 7.8e+72)) tmp = Float64(y * Float64(t / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.8e+27) || ~((t <= 7.8e+72))) tmp = y * (t / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.8e+27], N[Not[LessEqual[t, 7.8e+72]], $MachinePrecision]], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+27} \lor \neg \left(t \leq 7.8 \cdot 10^{+72}\right):\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.7999999999999999e27 or 7.79999999999999984e72 < t Initial program 83.5%
associate-*r/87.9%
Simplified87.9%
Taylor expanded in z around 0 73.9%
mul-1-neg73.9%
associate-*l/85.2%
distribute-rgt-neg-out85.2%
Simplified85.2%
Taylor expanded in x around 0 55.8%
*-commutative55.8%
associate-/l*61.8%
Simplified61.8%
associate-/r/54.2%
Applied egg-rr54.2%
if -2.7999999999999999e27 < t < 7.79999999999999984e72Initial program 92.8%
associate-*r/93.5%
Simplified93.5%
Taylor expanded in z around 0 51.7%
mul-1-neg51.7%
associate-*l/53.6%
distribute-rgt-neg-out53.6%
Simplified53.6%
Taylor expanded in x around inf 44.7%
Final simplification48.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.8e+27) (not (<= t 1.42e+72))) (* (/ y a) t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.8e+27) || !(t <= 1.42e+72)) {
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 ((t <= (-2.8d+27)) .or. (.not. (t <= 1.42d+72))) 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 ((t <= -2.8e+27) || !(t <= 1.42e+72)) {
tmp = (y / a) * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.8e+27) or not (t <= 1.42e+72): tmp = (y / a) * t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.8e+27) || !(t <= 1.42e+72)) tmp = Float64(Float64(y / a) * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.8e+27) || ~((t <= 1.42e+72))) tmp = (y / a) * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.8e+27], N[Not[LessEqual[t, 1.42e+72]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+27} \lor \neg \left(t \leq 1.42 \cdot 10^{+72}\right):\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.7999999999999999e27 or 1.41999999999999997e72 < t Initial program 83.5%
associate-*r/87.9%
Simplified87.9%
Taylor expanded in z around 0 73.9%
mul-1-neg73.9%
associate-*l/85.2%
distribute-rgt-neg-out85.2%
Simplified85.2%
Taylor expanded in x around 0 55.8%
*-commutative55.8%
associate-/l*61.8%
Simplified61.8%
div-inv61.8%
clear-num61.8%
*-commutative61.8%
Applied egg-rr61.8%
if -2.7999999999999999e27 < t < 1.41999999999999997e72Initial program 92.8%
associate-*r/93.5%
Simplified93.5%
Taylor expanded in z around 0 51.7%
mul-1-neg51.7%
associate-*l/53.6%
distribute-rgt-neg-out53.6%
Simplified53.6%
Taylor expanded in x around inf 44.7%
Final simplification52.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -7.4e+22) (* (/ y a) t) (if (<= t 5.8e+71) x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.4e+22) {
tmp = (y / a) * t;
} else if (t <= 5.8e+71) {
tmp = x;
} else {
tmp = t / (a / y);
}
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.4d+22)) then
tmp = (y / a) * t
else if (t <= 5.8d+71) then
tmp = x
else
tmp = t / (a / y)
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.4e+22) {
tmp = (y / a) * t;
} else if (t <= 5.8e+71) {
tmp = x;
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.4e+22: tmp = (y / a) * t elif t <= 5.8e+71: tmp = x else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.4e+22) tmp = Float64(Float64(y / a) * t); elseif (t <= 5.8e+71) tmp = x; else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.4e+22) tmp = (y / a) * t; elseif (t <= 5.8e+71) tmp = x; else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.4e+22], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t, 5.8e+71], x, N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.4 \cdot 10^{+22}:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+71}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -7.3999999999999996e22Initial program 85.5%
associate-*r/89.1%
Simplified89.1%
Taylor expanded in z around 0 75.0%
mul-1-neg75.0%
associate-*l/84.0%
distribute-rgt-neg-out84.0%
Simplified84.0%
Taylor expanded in x around 0 56.6%
*-commutative56.6%
associate-/l*60.3%
Simplified60.3%
div-inv60.3%
clear-num60.4%
*-commutative60.4%
Applied egg-rr60.4%
if -7.3999999999999996e22 < t < 5.80000000000000014e71Initial program 92.8%
associate-*r/93.5%
Simplified93.5%
Taylor expanded in z around 0 51.7%
mul-1-neg51.7%
associate-*l/53.6%
distribute-rgt-neg-out53.6%
Simplified53.6%
Taylor expanded in x around inf 44.7%
if 5.80000000000000014e71 < t Initial program 81.6%
associate-*r/86.7%
Simplified86.7%
Taylor expanded in z around 0 73.0%
mul-1-neg73.0%
associate-*l/86.3%
distribute-rgt-neg-out86.3%
Simplified86.3%
Taylor expanded in x around 0 55.1%
*-commutative55.1%
associate-/l*63.2%
Simplified63.2%
Final simplification52.0%
(FPCore (x y z t a) :precision binary64 (+ x (/ t (/ a y))))
double code(double x, double y, double z, double t, double a) {
return x + (t / (a / y));
}
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 + (t / (a / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t / (a / y));
}
def code(x, y, z, t, a): return x + (t / (a / y))
function code(x, y, z, t, a) return Float64(x + Float64(t / Float64(a / y))) end
function tmp = code(x, y, z, t, a) tmp = x + (t / (a / y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{t}{\frac{a}{y}}
\end{array}
Initial program 88.8%
associate-*r/91.1%
Simplified91.1%
Taylor expanded in z around 0 61.2%
mul-1-neg61.2%
associate-*l/67.1%
distribute-rgt-neg-out67.1%
Simplified67.1%
Taylor expanded in x around 0 61.2%
associate-/l*62.5%
+-commutative62.5%
associate-/l*61.2%
*-commutative61.2%
associate-/l*67.1%
Simplified67.1%
Final simplification67.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 88.8%
associate-*r/91.1%
Simplified91.1%
Taylor expanded in z around 0 61.2%
mul-1-neg61.2%
associate-*l/67.1%
distribute-rgt-neg-out67.1%
Simplified67.1%
Taylor expanded in x around inf 36.0%
Final simplification36.0%
(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 2023229
(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)))