
(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 12 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 93.1%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in y around 0 93.1%
associate-*l/98.1%
*-commutative98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.2e+150)
(/ (* z y) a)
(if (<= z 1.15e-212)
x
(if (<= z 3.15e-140)
(* t (/ (- y) a))
(if (<= z 1.25) x (/ y (/ a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e+150) {
tmp = (z * y) / a;
} else if (z <= 1.15e-212) {
tmp = x;
} else if (z <= 3.15e-140) {
tmp = t * (-y / a);
} else if (z <= 1.25) {
tmp = x;
} else {
tmp = 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 (z <= (-1.2d+150)) then
tmp = (z * y) / a
else if (z <= 1.15d-212) then
tmp = x
else if (z <= 3.15d-140) then
tmp = t * (-y / a)
else if (z <= 1.25d0) then
tmp = x
else
tmp = 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 (z <= -1.2e+150) {
tmp = (z * y) / a;
} else if (z <= 1.15e-212) {
tmp = x;
} else if (z <= 3.15e-140) {
tmp = t * (-y / a);
} else if (z <= 1.25) {
tmp = x;
} else {
tmp = y / (a / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.2e+150: tmp = (z * y) / a elif z <= 1.15e-212: tmp = x elif z <= 3.15e-140: tmp = t * (-y / a) elif z <= 1.25: tmp = x else: tmp = y / (a / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.2e+150) tmp = Float64(Float64(z * y) / a); elseif (z <= 1.15e-212) tmp = x; elseif (z <= 3.15e-140) tmp = Float64(t * Float64(Float64(-y) / a)); elseif (z <= 1.25) tmp = x; else tmp = Float64(y / Float64(a / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.2e+150) tmp = (z * y) / a; elseif (z <= 1.15e-212) tmp = x; elseif (z <= 3.15e-140) tmp = t * (-y / a); elseif (z <= 1.25) tmp = x; else tmp = y / (a / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.2e+150], N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 1.15e-212], x, If[LessEqual[z, 3.15e-140], N[(t * N[((-y) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25], x, N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+150}:\\
\;\;\;\;\frac{z \cdot y}{a}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-212}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{-140}:\\
\;\;\;\;t \cdot \frac{-y}{a}\\
\mathbf{elif}\;z \leq 1.25:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if z < -1.20000000000000001e150Initial program 94.9%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in y around 0 94.9%
associate-*l/97.4%
*-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 94.9%
+-commutative94.9%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in z around inf 73.2%
if -1.20000000000000001e150 < z < 1.15e-212 or 3.15000000000000003e-140 < z < 1.25Initial program 95.2%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in x around inf 55.6%
if 1.15e-212 < z < 3.15000000000000003e-140Initial program 100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 67.6%
associate-*r/67.6%
neg-mul-167.6%
distribute-rgt-neg-in67.6%
distribute-neg-frac67.6%
Simplified67.6%
if 1.25 < z Initial program 85.5%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in y around 0 85.5%
associate-*l/99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x around 0 85.5%
+-commutative85.5%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in z around inf 52.0%
associate-*r/53.4%
Simplified53.4%
clear-num53.4%
un-div-inv53.4%
Applied egg-rr53.4%
Final simplification58.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.7e+99) (not (<= t 2.2e+23))) (- x (* t (/ y a))) (+ x (/ z (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.7e+99) || !(t <= 2.2e+23)) {
tmp = x - (t * (y / a));
} else {
tmp = x + (z / (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 <= (-1.7d+99)) .or. (.not. (t <= 2.2d+23))) then
tmp = x - (t * (y / a))
else
tmp = x + (z / (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 <= -1.7e+99) || !(t <= 2.2e+23)) {
tmp = x - (t * (y / a));
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.7e+99) or not (t <= 2.2e+23): tmp = x - (t * (y / a)) else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.7e+99) || !(t <= 2.2e+23)) tmp = Float64(x - Float64(t * Float64(y / a))); else tmp = Float64(x + Float64(z / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.7e+99) || ~((t <= 2.2e+23))) tmp = x - (t * (y / a)); else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.7e+99], N[Not[LessEqual[t, 2.2e+23]], $MachinePrecision]], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{+99} \lor \neg \left(t \leq 2.2 \cdot 10^{+23}\right):\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -1.69999999999999992e99 or 2.20000000000000008e23 < t Initial program 89.5%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in y around 0 89.5%
associate-*l/98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in z around 0 79.6%
associate-*l/82.4%
*-commutative82.4%
neg-mul-182.4%
sub-neg82.4%
*-commutative82.4%
associate-*l/79.6%
associate-*r/86.4%
Simplified86.4%
if -1.69999999999999992e99 < t < 2.20000000000000008e23Initial program 95.5%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in t around 0 85.6%
+-commutative85.6%
associate-/l*85.7%
Simplified85.7%
clear-num45.1%
un-div-inv45.1%
Applied egg-rr85.6%
associate-/r/89.3%
Applied egg-rr89.3%
*-commutative89.3%
clear-num89.3%
un-div-inv89.5%
Applied egg-rr89.5%
Final simplification88.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.7e+224) (* y (/ (- t) a)) (if (<= t 2.65e+144) (+ x (/ (* z y) a)) (* t (/ (- y) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.7e+224) {
tmp = y * (-t / a);
} else if (t <= 2.65e+144) {
tmp = x + ((z * y) / a);
} 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 (t <= (-3.7d+224)) then
tmp = y * (-t / a)
else if (t <= 2.65d+144) then
tmp = x + ((z * y) / a)
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 (t <= -3.7e+224) {
tmp = y * (-t / a);
} else if (t <= 2.65e+144) {
tmp = x + ((z * y) / a);
} else {
tmp = t * (-y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.7e+224: tmp = y * (-t / a) elif t <= 2.65e+144: tmp = x + ((z * y) / a) else: tmp = t * (-y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.7e+224) tmp = Float64(y * Float64(Float64(-t) / a)); elseif (t <= 2.65e+144) tmp = Float64(x + Float64(Float64(z * y) / a)); 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 (t <= -3.7e+224) tmp = y * (-t / a); elseif (t <= 2.65e+144) tmp = x + ((z * y) / a); else tmp = t * (-y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.7e+224], N[(y * N[((-t) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.65e+144], N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(t * N[((-y) / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{+224}:\\
\;\;\;\;y \cdot \frac{-t}{a}\\
\mathbf{elif}\;t \leq 2.65 \cdot 10^{+144}:\\
\;\;\;\;x + \frac{z \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{-y}{a}\\
\end{array}
\end{array}
if t < -3.70000000000000003e224Initial program 82.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 82.7%
associate-*l/96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 82.7%
+-commutative82.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 65.9%
mul-1-neg65.9%
*-commutative65.9%
associate-*r/77.1%
distribute-rgt-neg-out77.1%
Simplified77.1%
if -3.70000000000000003e224 < t < 2.6499999999999998e144Initial program 94.4%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in z around inf 78.3%
if 2.6499999999999998e144 < t Initial program 89.5%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in y around 0 89.5%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 89.5%
+-commutative89.5%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in t around inf 51.7%
associate-*r/62.2%
neg-mul-162.2%
distribute-rgt-neg-in62.2%
distribute-neg-frac62.2%
Simplified62.2%
Final simplification76.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.8e+226) (* y (/ (- t) a)) (if (<= t 5.5e+143) (+ x (* y (/ z a))) (* t (/ (- y) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.8e+226) {
tmp = y * (-t / a);
} else if (t <= 5.5e+143) {
tmp = x + (y * (z / a));
} 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 (t <= (-3.8d+226)) then
tmp = y * (-t / a)
else if (t <= 5.5d+143) then
tmp = x + (y * (z / a))
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 (t <= -3.8e+226) {
tmp = y * (-t / a);
} else if (t <= 5.5e+143) {
tmp = x + (y * (z / a));
} else {
tmp = t * (-y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.8e+226: tmp = y * (-t / a) elif t <= 5.5e+143: tmp = x + (y * (z / a)) else: tmp = t * (-y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.8e+226) tmp = Float64(y * Float64(Float64(-t) / a)); elseif (t <= 5.5e+143) tmp = Float64(x + Float64(y * Float64(z / a))); 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 (t <= -3.8e+226) tmp = y * (-t / a); elseif (t <= 5.5e+143) tmp = x + (y * (z / a)); else tmp = t * (-y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.8e+226], N[(y * N[((-t) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e+143], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[((-y) / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+226}:\\
\;\;\;\;y \cdot \frac{-t}{a}\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+143}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{-y}{a}\\
\end{array}
\end{array}
if t < -3.79999999999999983e226Initial program 82.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 82.7%
associate-*l/96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 82.7%
+-commutative82.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 65.9%
mul-1-neg65.9%
*-commutative65.9%
associate-*r/77.1%
distribute-rgt-neg-out77.1%
Simplified77.1%
if -3.79999999999999983e226 < t < 5.4999999999999997e143Initial program 94.4%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in t around 0 78.3%
+-commutative78.3%
associate-/l*79.6%
Simplified79.6%
if 5.4999999999999997e143 < t Initial program 89.5%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in y around 0 89.5%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 89.5%
+-commutative89.5%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in t around inf 51.7%
associate-*r/62.2%
neg-mul-162.2%
distribute-rgt-neg-in62.2%
distribute-neg-frac62.2%
Simplified62.2%
Final simplification77.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.8e+222) (* y (/ (- t) a)) (if (<= t 1.05e+146) (+ x (* z (/ y a))) (* t (/ (- y) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.8e+222) {
tmp = y * (-t / a);
} else if (t <= 1.05e+146) {
tmp = x + (z * (y / a));
} 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 (t <= (-4.8d+222)) then
tmp = y * (-t / a)
else if (t <= 1.05d+146) then
tmp = x + (z * (y / a))
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 (t <= -4.8e+222) {
tmp = y * (-t / a);
} else if (t <= 1.05e+146) {
tmp = x + (z * (y / a));
} else {
tmp = t * (-y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.8e+222: tmp = y * (-t / a) elif t <= 1.05e+146: tmp = x + (z * (y / a)) else: tmp = t * (-y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.8e+222) tmp = Float64(y * Float64(Float64(-t) / a)); elseif (t <= 1.05e+146) tmp = Float64(x + Float64(z * Float64(y / a))); 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 (t <= -4.8e+222) tmp = y * (-t / a); elseif (t <= 1.05e+146) tmp = x + (z * (y / a)); else tmp = t * (-y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.8e+222], N[(y * N[((-t) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.05e+146], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[((-y) / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+222}:\\
\;\;\;\;y \cdot \frac{-t}{a}\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+146}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{-y}{a}\\
\end{array}
\end{array}
if t < -4.8000000000000002e222Initial program 82.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 82.7%
associate-*l/96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 82.7%
+-commutative82.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 65.9%
mul-1-neg65.9%
*-commutative65.9%
associate-*r/77.1%
distribute-rgt-neg-out77.1%
Simplified77.1%
if -4.8000000000000002e222 < t < 1.05e146Initial program 94.4%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in t around 0 78.3%
+-commutative78.3%
associate-/l*79.6%
Simplified79.6%
clear-num39.8%
un-div-inv39.8%
Applied egg-rr79.6%
associate-/r/81.9%
Applied egg-rr81.9%
if 1.05e146 < t Initial program 89.5%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in y around 0 89.5%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 89.5%
+-commutative89.5%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in t around inf 51.7%
associate-*r/62.2%
neg-mul-162.2%
distribute-rgt-neg-in62.2%
distribute-neg-frac62.2%
Simplified62.2%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -4e+224) (* y (/ (- t) a)) (if (<= t 2.9e+143) (+ x (/ z (/ a y))) (* t (/ (- y) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4e+224) {
tmp = y * (-t / a);
} else if (t <= 2.9e+143) {
tmp = x + (z / (a / y));
} 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 (t <= (-4d+224)) then
tmp = y * (-t / a)
else if (t <= 2.9d+143) then
tmp = x + (z / (a / y))
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 (t <= -4e+224) {
tmp = y * (-t / a);
} else if (t <= 2.9e+143) {
tmp = x + (z / (a / y));
} else {
tmp = t * (-y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4e+224: tmp = y * (-t / a) elif t <= 2.9e+143: tmp = x + (z / (a / y)) else: tmp = t * (-y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4e+224) tmp = Float64(y * Float64(Float64(-t) / a)); elseif (t <= 2.9e+143) tmp = Float64(x + Float64(z / Float64(a / y))); 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 (t <= -4e+224) tmp = y * (-t / a); elseif (t <= 2.9e+143) tmp = x + (z / (a / y)); else tmp = t * (-y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4e+224], N[(y * N[((-t) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e+143], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[((-y) / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+224}:\\
\;\;\;\;y \cdot \frac{-t}{a}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+143}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{-y}{a}\\
\end{array}
\end{array}
if t < -3.99999999999999988e224Initial program 82.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 82.7%
associate-*l/96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 82.7%
+-commutative82.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 65.9%
mul-1-neg65.9%
*-commutative65.9%
associate-*r/77.1%
distribute-rgt-neg-out77.1%
Simplified77.1%
if -3.99999999999999988e224 < t < 2.8999999999999998e143Initial program 94.4%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in t around 0 78.3%
+-commutative78.3%
associate-/l*79.6%
Simplified79.6%
clear-num39.8%
un-div-inv39.8%
Applied egg-rr79.6%
associate-/r/81.9%
Applied egg-rr81.9%
*-commutative81.9%
clear-num81.8%
un-div-inv82.0%
Applied egg-rr82.0%
if 2.8999999999999998e143 < t Initial program 89.5%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in y around 0 89.5%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 89.5%
+-commutative89.5%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in t around inf 51.7%
associate-*r/62.2%
neg-mul-162.2%
distribute-rgt-neg-in62.2%
distribute-neg-frac62.2%
Simplified62.2%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4e+149) (not (<= z 0.84))) (* y (/ z a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4e+149) || !(z <= 0.84)) {
tmp = y * (z / 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 ((z <= (-4d+149)) .or. (.not. (z <= 0.84d0))) then
tmp = y * (z / 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 ((z <= -4e+149) || !(z <= 0.84)) {
tmp = y * (z / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4e+149) or not (z <= 0.84): tmp = y * (z / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4e+149) || !(z <= 0.84)) tmp = Float64(y * Float64(z / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4e+149) || ~((z <= 0.84))) tmp = y * (z / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4e+149], N[Not[LessEqual[z, 0.84]], $MachinePrecision]], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+149} \lor \neg \left(z \leq 0.84\right):\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.0000000000000002e149 or 0.839999999999999969 < z Initial program 89.2%
associate-/l*92.1%
Simplified92.1%
Taylor expanded in y around 0 89.2%
associate-*l/98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in x around 0 89.2%
+-commutative89.2%
associate-/l*92.1%
Simplified92.1%
Taylor expanded in z around inf 60.2%
associate-*r/61.1%
Simplified61.1%
if -4.0000000000000002e149 < z < 0.839999999999999969Initial program 95.6%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in x around inf 53.5%
Final simplification56.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.5e+149) (* y (/ z a)) (if (<= z 1.25) x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e+149) {
tmp = y * (z / a);
} else if (z <= 1.25) {
tmp = x;
} else {
tmp = 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 (z <= (-7.5d+149)) then
tmp = y * (z / a)
else if (z <= 1.25d0) then
tmp = x
else
tmp = 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 (z <= -7.5e+149) {
tmp = y * (z / a);
} else if (z <= 1.25) {
tmp = x;
} else {
tmp = y / (a / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.5e+149: tmp = y * (z / a) elif z <= 1.25: tmp = x else: tmp = y / (a / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.5e+149) tmp = Float64(y * Float64(z / a)); elseif (z <= 1.25) tmp = x; else tmp = Float64(y / Float64(a / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.5e+149) tmp = y * (z / a); elseif (z <= 1.25) tmp = x; else tmp = y / (a / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.5e+149], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25], x, N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+149}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;z \leq 1.25:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if z < -7.50000000000000031e149Initial program 94.9%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in y around 0 94.9%
associate-*l/97.4%
*-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 94.9%
+-commutative94.9%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in z around inf 73.2%
associate-*r/73.1%
Simplified73.1%
if -7.50000000000000031e149 < z < 1.25Initial program 95.6%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in x around inf 53.5%
if 1.25 < z Initial program 85.5%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in y around 0 85.5%
associate-*l/99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x around 0 85.5%
+-commutative85.5%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in z around inf 52.0%
associate-*r/53.4%
Simplified53.4%
clear-num53.4%
un-div-inv53.4%
Applied egg-rr53.4%
Final simplification56.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.9e+149) (/ (* z y) a) (if (<= z 0.9) x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.9e+149) {
tmp = (z * y) / a;
} else if (z <= 0.9) {
tmp = x;
} else {
tmp = 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 (z <= (-3.9d+149)) then
tmp = (z * y) / a
else if (z <= 0.9d0) then
tmp = x
else
tmp = 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 (z <= -3.9e+149) {
tmp = (z * y) / a;
} else if (z <= 0.9) {
tmp = x;
} else {
tmp = y / (a / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.9e+149: tmp = (z * y) / a elif z <= 0.9: tmp = x else: tmp = y / (a / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.9e+149) tmp = Float64(Float64(z * y) / a); elseif (z <= 0.9) tmp = x; else tmp = Float64(y / Float64(a / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.9e+149) tmp = (z * y) / a; elseif (z <= 0.9) tmp = x; else tmp = y / (a / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.9e+149], N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 0.9], x, N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+149}:\\
\;\;\;\;\frac{z \cdot y}{a}\\
\mathbf{elif}\;z \leq 0.9:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if z < -3.8999999999999999e149Initial program 94.9%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in y around 0 94.9%
associate-*l/97.4%
*-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 94.9%
+-commutative94.9%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in z around inf 73.2%
if -3.8999999999999999e149 < z < 0.900000000000000022Initial program 95.6%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in x around inf 53.5%
if 0.900000000000000022 < z Initial program 85.5%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in y around 0 85.5%
associate-*l/99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x around 0 85.5%
+-commutative85.5%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in z around inf 52.0%
associate-*r/53.4%
Simplified53.4%
clear-num53.4%
un-div-inv53.4%
Applied egg-rr53.4%
Final simplification56.4%
(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 93.1%
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 93.1%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in x around inf 41.3%
Final simplification41.3%
(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 2024115
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:precision binary64
:alt
(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)))