
(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 11 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) (- 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 93.2%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in y around 0 93.2%
associate-*l/98.1%
*-commutative98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- y) (/ z a))))
(if (<= z -3.7e+149)
t_1
(if (<= z 4.2e-215)
x
(if (<= z 1.16e-140) (* y (/ t a)) (if (<= z 1.25) x t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -y * (z / a);
double tmp;
if (z <= -3.7e+149) {
tmp = t_1;
} else if (z <= 4.2e-215) {
tmp = x;
} else if (z <= 1.16e-140) {
tmp = y * (t / a);
} else if (z <= 1.25) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = -y * (z / a)
if (z <= (-3.7d+149)) then
tmp = t_1
else if (z <= 4.2d-215) then
tmp = x
else if (z <= 1.16d-140) then
tmp = y * (t / a)
else if (z <= 1.25d0) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -y * (z / a);
double tmp;
if (z <= -3.7e+149) {
tmp = t_1;
} else if (z <= 4.2e-215) {
tmp = x;
} else if (z <= 1.16e-140) {
tmp = y * (t / a);
} else if (z <= 1.25) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -y * (z / a) tmp = 0 if z <= -3.7e+149: tmp = t_1 elif z <= 4.2e-215: tmp = x elif z <= 1.16e-140: tmp = y * (t / a) elif z <= 1.25: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(-y) * Float64(z / a)) tmp = 0.0 if (z <= -3.7e+149) tmp = t_1; elseif (z <= 4.2e-215) tmp = x; elseif (z <= 1.16e-140) tmp = Float64(y * Float64(t / a)); elseif (z <= 1.25) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -y * (z / a); tmp = 0.0; if (z <= -3.7e+149) tmp = t_1; elseif (z <= 4.2e-215) tmp = x; elseif (z <= 1.16e-140) tmp = y * (t / a); elseif (z <= 1.25) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-y) * N[(z / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e+149], t$95$1, If[LessEqual[z, 4.2e-215], x, If[LessEqual[z, 1.16e-140], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25], x, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-y\right) \cdot \frac{z}{a}\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-215}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{-140}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 1.25:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.69999999999999978e149 or 1.25 < z Initial program 89.1%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in z around inf 60.3%
mul-1-neg60.3%
associate-/l*61.2%
distribute-rgt-neg-in61.2%
distribute-neg-frac261.2%
Simplified61.2%
if -3.69999999999999978e149 < z < 4.2e-215 or 1.16e-140 < z < 1.25Initial program 95.3%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in x around inf 55.7%
if 4.2e-215 < z < 1.16e-140Initial program 100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 67.6%
*-commutative67.6%
associate-/l*67.6%
Simplified67.6%
Final simplification58.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.6e+149)
(* (- y) (/ z a))
(if (<= z 9e-213)
x
(if (<= z 1.3e-142) (* y (/ t a)) (if (<= z 1.6) x (* z (/ (- y) a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.6e+149) {
tmp = -y * (z / a);
} else if (z <= 9e-213) {
tmp = x;
} else if (z <= 1.3e-142) {
tmp = y * (t / a);
} else if (z <= 1.6) {
tmp = x;
} else {
tmp = z * (-y / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.6d+149)) then
tmp = -y * (z / a)
else if (z <= 9d-213) then
tmp = x
else if (z <= 1.3d-142) then
tmp = y * (t / a)
else if (z <= 1.6d0) then
tmp = x
else
tmp = z * (-y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.6e+149) {
tmp = -y * (z / a);
} else if (z <= 9e-213) {
tmp = x;
} else if (z <= 1.3e-142) {
tmp = y * (t / a);
} else if (z <= 1.6) {
tmp = x;
} else {
tmp = z * (-y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.6e+149: tmp = -y * (z / a) elif z <= 9e-213: tmp = x elif z <= 1.3e-142: tmp = y * (t / a) elif z <= 1.6: tmp = x else: tmp = z * (-y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.6e+149) tmp = Float64(Float64(-y) * Float64(z / a)); elseif (z <= 9e-213) tmp = x; elseif (z <= 1.3e-142) tmp = Float64(y * Float64(t / a)); elseif (z <= 1.6) tmp = x; else tmp = Float64(z * Float64(Float64(-y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.6e+149) tmp = -y * (z / a); elseif (z <= 9e-213) tmp = x; elseif (z <= 1.3e-142) tmp = y * (t / a); elseif (z <= 1.6) tmp = x; else tmp = z * (-y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.6e+149], N[((-y) * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-213], x, If[LessEqual[z, 1.3e-142], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6], x, N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+149}:\\
\;\;\;\;\left(-y\right) \cdot \frac{z}{a}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-213}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-142}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 1.6:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\end{array}
\end{array}
if z < -5.5999999999999998e149Initial program 95.0%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in z around inf 73.5%
mul-1-neg73.5%
associate-/l*73.6%
distribute-rgt-neg-in73.6%
distribute-neg-frac273.6%
Simplified73.6%
if -5.5999999999999998e149 < z < 9.0000000000000002e-213 or 1.3e-142 < z < 1.6000000000000001Initial program 95.3%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in x around inf 55.7%
if 9.0000000000000002e-213 < z < 1.3e-142Initial program 100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 67.6%
*-commutative67.6%
associate-/l*67.6%
Simplified67.6%
if 1.6000000000000001 < z Initial program 85.3%
associate-/l*90.4%
Simplified90.4%
Taylor expanded in y around 0 85.3%
associate-*l/99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in z around inf 51.9%
mul-1-neg51.9%
distribute-neg-frac251.9%
*-commutative51.9%
associate-*r/58.2%
Simplified58.2%
Final simplification59.5%
(FPCore (x y z t a)
:precision binary64
(if (<= x -2.45e+94)
x
(if (or (<= x -7e+67) (and (not (<= x -1.7e-70)) (<= x 2.1e-109)))
(* t (/ y a))
x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.45e+94) {
tmp = x;
} else if ((x <= -7e+67) || (!(x <= -1.7e-70) && (x <= 2.1e-109))) {
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 (x <= (-2.45d+94)) then
tmp = x
else if ((x <= (-7d+67)) .or. (.not. (x <= (-1.7d-70))) .and. (x <= 2.1d-109)) 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 (x <= -2.45e+94) {
tmp = x;
} else if ((x <= -7e+67) || (!(x <= -1.7e-70) && (x <= 2.1e-109))) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.45e+94: tmp = x elif (x <= -7e+67) or (not (x <= -1.7e-70) and (x <= 2.1e-109)): tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.45e+94) tmp = x; elseif ((x <= -7e+67) || (!(x <= -1.7e-70) && (x <= 2.1e-109))) 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 (x <= -2.45e+94) tmp = x; elseif ((x <= -7e+67) || (~((x <= -1.7e-70)) && (x <= 2.1e-109))) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.45e+94], x, If[Or[LessEqual[x, -7e+67], And[N[Not[LessEqual[x, -1.7e-70]], $MachinePrecision], LessEqual[x, 2.1e-109]]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{+94}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -7 \cdot 10^{+67} \lor \neg \left(x \leq -1.7 \cdot 10^{-70}\right) \land x \leq 2.1 \cdot 10^{-109}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.4499999999999999e94 or -7e67 < x < -1.69999999999999998e-70 or 2.09999999999999996e-109 < x Initial program 94.3%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in x around inf 56.7%
if -2.4499999999999999e94 < x < -7e67 or -1.69999999999999998e-70 < x < 2.09999999999999996e-109Initial program 90.9%
associate-/l*94.3%
Simplified94.3%
Taylor expanded in t around inf 42.8%
*-commutative42.8%
Simplified42.8%
*-commutative42.8%
associate-/l*49.2%
*-commutative49.2%
Applied egg-rr49.2%
Final simplification54.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.1e-95) (not (<= t 1.65e-25))) (+ x (* t (/ y a))) (- x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.1e-95) || !(t <= 1.65e-25)) {
tmp = x + (t * (y / a));
} else {
tmp = x - ((z * y) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-4.1d-95)) .or. (.not. (t <= 1.65d-25))) then
tmp = x + (t * (y / a))
else
tmp = x - ((z * y) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.1e-95) || !(t <= 1.65e-25)) {
tmp = x + (t * (y / a));
} else {
tmp = x - ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.1e-95) or not (t <= 1.65e-25): tmp = x + (t * (y / a)) else: tmp = x - ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.1e-95) || !(t <= 1.65e-25)) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x - Float64(Float64(z * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.1e-95) || ~((t <= 1.65e-25))) tmp = x + (t * (y / a)); else tmp = x - ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.1e-95], N[Not[LessEqual[t, 1.65e-25]], $MachinePrecision]], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{-95} \lor \neg \left(t \leq 1.65 \cdot 10^{-25}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if t < -4.0999999999999997e-95 or 1.6499999999999999e-25 < t Initial program 90.0%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in y around 0 90.0%
associate-*l/98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in z around 0 77.4%
mul-1-neg77.4%
distribute-frac-neg277.4%
associate-/l*82.2%
Simplified82.2%
if -4.0999999999999997e-95 < t < 1.6499999999999999e-25Initial program 97.2%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in z around inf 92.0%
Final simplification86.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.1e+150) (* (- y) (/ z a)) (if (<= z 3e+20) (+ x (/ (* t y) a)) (* z (/ (- y) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.1e+150) {
tmp = -y * (z / a);
} else if (z <= 3e+20) {
tmp = x + ((t * y) / a);
} else {
tmp = z * (-y / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.1d+150)) then
tmp = -y * (z / a)
else if (z <= 3d+20) then
tmp = x + ((t * y) / a)
else
tmp = z * (-y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.1e+150) {
tmp = -y * (z / a);
} else if (z <= 3e+20) {
tmp = x + ((t * y) / a);
} else {
tmp = z * (-y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.1e+150: tmp = -y * (z / a) elif z <= 3e+20: tmp = x + ((t * y) / a) else: tmp = z * (-y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.1e+150) tmp = Float64(Float64(-y) * Float64(z / a)); elseif (z <= 3e+20) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = Float64(z * Float64(Float64(-y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.1e+150) tmp = -y * (z / a); elseif (z <= 3e+20) tmp = x + ((t * y) / a); else tmp = z * (-y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.1e+150], N[((-y) * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+20], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+150}:\\
\;\;\;\;\left(-y\right) \cdot \frac{z}{a}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+20}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\end{array}
\end{array}
if z < -2.09999999999999998e150Initial program 95.0%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in z around inf 73.5%
mul-1-neg73.5%
associate-/l*73.6%
distribute-rgt-neg-in73.6%
distribute-neg-frac273.6%
Simplified73.6%
if -2.09999999999999998e150 < z < 3e20Initial program 95.8%
sub-neg95.8%
distribute-frac-neg295.8%
+-commutative95.8%
associate-/l*97.0%
fma-define97.0%
distribute-frac-neg297.0%
distribute-neg-frac97.0%
sub-neg97.0%
distribute-neg-in97.0%
remove-double-neg97.0%
+-commutative97.0%
sub-neg97.0%
Simplified97.0%
Taylor expanded in z around 0 82.6%
if 3e20 < z Initial program 83.7%
associate-/l*89.3%
Simplified89.3%
Taylor expanded in y around 0 83.7%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 53.8%
mul-1-neg53.8%
distribute-neg-frac253.8%
*-commutative53.8%
associate-*r/60.8%
Simplified60.8%
Final simplification76.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.15e+150) (* (- y) (/ z a)) (if (<= z 1.25e+173) (+ x (* y (/ t a))) (* z (/ (- y) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.15e+150) {
tmp = -y * (z / a);
} else if (z <= 1.25e+173) {
tmp = x + (y * (t / a));
} else {
tmp = z * (-y / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.15d+150)) then
tmp = -y * (z / a)
else if (z <= 1.25d+173) then
tmp = x + (y * (t / a))
else
tmp = z * (-y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.15e+150) {
tmp = -y * (z / a);
} else if (z <= 1.25e+173) {
tmp = x + (y * (t / a));
} else {
tmp = z * (-y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.15e+150: tmp = -y * (z / a) elif z <= 1.25e+173: tmp = x + (y * (t / a)) else: tmp = z * (-y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.15e+150) tmp = Float64(Float64(-y) * Float64(z / a)); elseif (z <= 1.25e+173) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(z * Float64(Float64(-y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.15e+150) tmp = -y * (z / a); elseif (z <= 1.25e+173) tmp = x + (y * (t / a)); else tmp = z * (-y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.15e+150], N[((-y) * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e+173], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+150}:\\
\;\;\;\;\left(-y\right) \cdot \frac{z}{a}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+173}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\end{array}
\end{array}
if z < -1.15000000000000001e150Initial program 95.0%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in z around inf 73.5%
mul-1-neg73.5%
associate-/l*73.6%
distribute-rgt-neg-in73.6%
distribute-neg-frac273.6%
Simplified73.6%
if -1.15000000000000001e150 < z < 1.25000000000000009e173Initial program 93.1%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in y around 0 93.1%
associate-*l/98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in z around 0 76.3%
mul-1-neg76.3%
distribute-frac-neg276.3%
associate-/l*79.2%
Simplified79.2%
sub-neg79.2%
+-commutative79.2%
associate-*r/76.3%
distribute-neg-frac76.3%
frac-2neg76.3%
associate-*l/77.7%
*-commutative77.7%
Applied egg-rr77.7%
if 1.25000000000000009e173 < z Initial program 90.2%
associate-/l*85.6%
Simplified85.6%
Taylor expanded in y around 0 90.2%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 66.0%
mul-1-neg66.0%
distribute-neg-frac266.0%
*-commutative66.0%
associate-*r/75.4%
Simplified75.4%
Final simplification76.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.1e-95) (+ x (* y (/ t a))) (if (<= t 4.3e-22) (- x (/ (* z y) a)) (+ x (/ (* t y) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.1e-95) {
tmp = x + (y * (t / a));
} else if (t <= 4.3e-22) {
tmp = x - ((z * y) / a);
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-4.1d-95)) then
tmp = x + (y * (t / a))
else if (t <= 4.3d-22) then
tmp = x - ((z * y) / a)
else
tmp = x + ((t * y) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.1e-95) {
tmp = x + (y * (t / a));
} else if (t <= 4.3e-22) {
tmp = x - ((z * y) / a);
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.1e-95: tmp = x + (y * (t / a)) elif t <= 4.3e-22: tmp = x - ((z * y) / a) else: tmp = x + ((t * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.1e-95) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (t <= 4.3e-22) tmp = Float64(x - Float64(Float64(z * y) / a)); else tmp = Float64(x + Float64(Float64(t * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.1e-95) tmp = x + (y * (t / a)); elseif (t <= 4.3e-22) tmp = x - ((z * y) / a); else tmp = x + ((t * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.1e-95], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.3e-22], N[(x - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{-95}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{-22}:\\
\;\;\;\;x - \frac{z \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if t < -4.0999999999999997e-95Initial program 87.7%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in y around 0 87.7%
associate-*l/98.8%
*-commutative98.8%
Simplified98.8%
Taylor expanded in z around 0 71.0%
mul-1-neg71.0%
distribute-frac-neg271.0%
associate-/l*77.3%
Simplified77.3%
sub-neg77.3%
+-commutative77.3%
associate-*r/71.0%
distribute-neg-frac71.0%
frac-2neg71.0%
associate-*l/77.0%
*-commutative77.0%
Applied egg-rr77.0%
if -4.0999999999999997e-95 < t < 4.30000000000000037e-22Initial program 97.2%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in z around inf 92.0%
if 4.30000000000000037e-22 < t Initial program 92.7%
sub-neg92.7%
distribute-frac-neg292.7%
+-commutative92.7%
associate-/l*92.8%
fma-define92.9%
distribute-frac-neg292.9%
distribute-neg-frac92.9%
sub-neg92.9%
distribute-neg-in92.9%
remove-double-neg92.9%
+-commutative92.9%
sub-neg92.9%
Simplified92.9%
Taylor expanded in z around 0 85.1%
Final simplification85.7%
(FPCore (x y z t a) :precision binary64 (if (<= x -4.7e-70) x (if (<= x 4.8e-110) (* y (/ t a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4.7e-70) {
tmp = x;
} else if (x <= 4.8e-110) {
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 (x <= (-4.7d-70)) then
tmp = x
else if (x <= 4.8d-110) 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 (x <= -4.7e-70) {
tmp = x;
} else if (x <= 4.8e-110) {
tmp = y * (t / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -4.7e-70: tmp = x elif x <= 4.8e-110: tmp = y * (t / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -4.7e-70) tmp = x; elseif (x <= 4.8e-110) 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 (x <= -4.7e-70) tmp = x; elseif (x <= 4.8e-110) tmp = y * (t / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -4.7e-70], x, If[LessEqual[x, 4.8e-110], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{-70}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-110}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.6999999999999998e-70 or 4.80000000000000013e-110 < x Initial program 94.4%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in x around inf 55.1%
if -4.6999999999999998e-70 < x < 4.80000000000000013e-110Initial program 90.4%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in t around inf 40.4%
*-commutative40.4%
associate-/l*46.2%
Simplified46.2%
Final simplification52.3%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- t z) a))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / 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 * ((t - z) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / a));
}
def code(x, y, z, t, a): return x + (y * ((t - z) / a))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(t - z) / a))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((t - z) / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{t - z}{a}
\end{array}
Initial program 93.2%
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.2%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in x around inf 41.2%
Final simplification41.2%
(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, F"
: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)))