
(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
(let* ((t_1 (* y (- z t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+72)))
(+ x (* y (/ (- t z) a)))
(+ x (/ (* y (- t z)) a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+72)) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + ((y * (t - z)) / a);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+72)) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + ((y * (t - z)) / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z - t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+72): tmp = x + (y * ((t - z) / a)) else: tmp = x + ((y * (t - z)) / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z - t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+72)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(x + Float64(Float64(y * Float64(t - z)) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z - t); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 2e+72))) tmp = x + (y * ((t - z) / a)); else tmp = x + ((y * (t - z)) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+72]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z - t\right)\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 2 \cdot 10^{+72}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(t - z\right)}{a}\\
\end{array}
\end{array}
if (*.f64 y (-.f64 z t)) < -inf.0 or 1.99999999999999989e72 < (*.f64 y (-.f64 z t)) Initial program 81.5%
associate-/l*99.9%
Simplified99.9%
clear-num99.8%
associate-/r/99.8%
clear-num99.9%
Applied egg-rr99.9%
if -inf.0 < (*.f64 y (-.f64 z t)) < 1.99999999999999989e72Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1e-47)
(- x (/ z (/ a y)))
(if (or (<= z 3.2e+56) (and (not (<= z 3.3e+104)) (<= z 2.1e+125)))
(+ x (* y (/ t a)))
(- x (* z (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e-47) {
tmp = x - (z / (a / y));
} else if ((z <= 3.2e+56) || (!(z <= 3.3e+104) && (z <= 2.1e+125))) {
tmp = x + (y * (t / 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 (z <= (-1d-47)) then
tmp = x - (z / (a / y))
else if ((z <= 3.2d+56) .or. (.not. (z <= 3.3d+104)) .and. (z <= 2.1d+125)) then
tmp = x + (y * (t / 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 (z <= -1e-47) {
tmp = x - (z / (a / y));
} else if ((z <= 3.2e+56) || (!(z <= 3.3e+104) && (z <= 2.1e+125))) {
tmp = x + (y * (t / a));
} else {
tmp = x - (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1e-47: tmp = x - (z / (a / y)) elif (z <= 3.2e+56) or (not (z <= 3.3e+104) and (z <= 2.1e+125)): tmp = x + (y * (t / a)) else: tmp = x - (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e-47) tmp = Float64(x - Float64(z / Float64(a / y))); elseif ((z <= 3.2e+56) || (!(z <= 3.3e+104) && (z <= 2.1e+125))) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x - Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1e-47) tmp = x - (z / (a / y)); elseif ((z <= 3.2e+56) || (~((z <= 3.3e+104)) && (z <= 2.1e+125))) tmp = x + (y * (t / a)); else tmp = x - (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e-47], N[(x - N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 3.2e+56], And[N[Not[LessEqual[z, 3.3e+104]], $MachinePrecision], LessEqual[z, 2.1e+125]]], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-47}:\\
\;\;\;\;x - \frac{z}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+56} \lor \neg \left(z \leq 3.3 \cdot 10^{+104}\right) \land z \leq 2.1 \cdot 10^{+125}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -9.9999999999999997e-48Initial program 92.4%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in z around inf 76.7%
associate-*l/80.2%
*-commutative80.2%
Simplified80.2%
clear-num80.2%
div-inv80.2%
Applied egg-rr80.2%
if -9.9999999999999997e-48 < z < 3.20000000000000003e56 or 3.29999999999999985e104 < z < 2.1000000000000001e125Initial program 96.0%
associate-*l/95.3%
Simplified95.3%
*-commutative95.3%
clear-num94.7%
un-div-inv94.7%
Applied egg-rr94.7%
Taylor expanded in z around 0 90.4%
mul-1-neg90.4%
associate-*l/90.9%
distribute-rgt-neg-in90.9%
Simplified90.9%
if 3.20000000000000003e56 < z < 3.29999999999999985e104 or 2.1000000000000001e125 < z Initial program 85.1%
associate-*l/99.4%
Simplified99.4%
Taylor expanded in z around inf 79.1%
associate-*l/91.7%
*-commutative91.7%
Simplified91.7%
Final simplification88.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.5e-48)
(- x (/ z (/ a y)))
(if (<= z 4.4e+55)
(- x (/ y (/ (- a) t)))
(if (or (<= z 9e+103) (not (<= z 2.3e+125)))
(- x (* z (/ y a)))
(+ x (* y (/ t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e-48) {
tmp = x - (z / (a / y));
} else if (z <= 4.4e+55) {
tmp = x - (y / (-a / t));
} else if ((z <= 9e+103) || !(z <= 2.3e+125)) {
tmp = x - (z * (y / a));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.5d-48)) then
tmp = x - (z / (a / y))
else if (z <= 4.4d+55) then
tmp = x - (y / (-a / t))
else if ((z <= 9d+103) .or. (.not. (z <= 2.3d+125))) then
tmp = x - (z * (y / a))
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e-48) {
tmp = x - (z / (a / y));
} else if (z <= 4.4e+55) {
tmp = x - (y / (-a / t));
} else if ((z <= 9e+103) || !(z <= 2.3e+125)) {
tmp = x - (z * (y / a));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.5e-48: tmp = x - (z / (a / y)) elif z <= 4.4e+55: tmp = x - (y / (-a / t)) elif (z <= 9e+103) or not (z <= 2.3e+125): tmp = x - (z * (y / a)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.5e-48) tmp = Float64(x - Float64(z / Float64(a / y))); elseif (z <= 4.4e+55) tmp = Float64(x - Float64(y / Float64(Float64(-a) / t))); elseif ((z <= 9e+103) || !(z <= 2.3e+125)) tmp = Float64(x - Float64(z * Float64(y / a))); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.5e-48) tmp = x - (z / (a / y)); elseif (z <= 4.4e+55) tmp = x - (y / (-a / t)); elseif ((z <= 9e+103) || ~((z <= 2.3e+125))) tmp = x - (z * (y / a)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e-48], N[(x - N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e+55], N[(x - N[(y / N[((-a) / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 9e+103], N[Not[LessEqual[z, 2.3e+125]], $MachinePrecision]], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-48}:\\
\;\;\;\;x - \frac{z}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+55}:\\
\;\;\;\;x - \frac{y}{\frac{-a}{t}}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+103} \lor \neg \left(z \leq 2.3 \cdot 10^{+125}\right):\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.49999999999999991e-48Initial program 92.4%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in z around inf 76.7%
associate-*l/80.2%
*-commutative80.2%
Simplified80.2%
clear-num80.2%
div-inv80.2%
Applied egg-rr80.2%
if -3.49999999999999991e-48 < z < 4.40000000000000021e55Initial program 96.4%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in z around 0 90.6%
associate-*r/90.6%
neg-mul-190.6%
Simplified90.6%
if 4.40000000000000021e55 < z < 9.00000000000000002e103 or 2.30000000000000013e125 < z Initial program 85.1%
associate-*l/99.4%
Simplified99.4%
Taylor expanded in z around inf 79.1%
associate-*l/91.7%
*-commutative91.7%
Simplified91.7%
if 9.00000000000000002e103 < z < 2.30000000000000013e125Initial program 90.1%
associate-*l/89.4%
Simplified89.4%
*-commutative89.4%
clear-num89.2%
un-div-inv89.2%
Applied egg-rr89.2%
Taylor expanded in z around 0 90.1%
mul-1-neg90.1%
associate-*l/99.7%
distribute-rgt-neg-in99.7%
Simplified99.7%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -9.4e+101) (+ x (/ (* y t) a)) (if (<= t 1.7e+141) (- x (* z (/ y a))) (- x (/ y (/ (- a) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.4e+101) {
tmp = x + ((y * t) / a);
} else if (t <= 1.7e+141) {
tmp = x - (z * (y / a));
} else {
tmp = x - (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 <= (-9.4d+101)) then
tmp = x + ((y * t) / a)
else if (t <= 1.7d+141) then
tmp = x - (z * (y / a))
else
tmp = x - (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 <= -9.4e+101) {
tmp = x + ((y * t) / a);
} else if (t <= 1.7e+141) {
tmp = x - (z * (y / a));
} else {
tmp = x - (y / (-a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -9.4e+101: tmp = x + ((y * t) / a) elif t <= 1.7e+141: tmp = x - (z * (y / a)) else: tmp = x - (y / (-a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9.4e+101) tmp = Float64(x + Float64(Float64(y * t) / a)); elseif (t <= 1.7e+141) tmp = Float64(x - Float64(z * Float64(y / a))); else tmp = Float64(x - Float64(y / Float64(Float64(-a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -9.4e+101) tmp = x + ((y * t) / a); elseif (t <= 1.7e+141) tmp = x - (z * (y / a)); else tmp = x - (y / (-a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9.4e+101], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e+141], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[((-a) / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.4 \cdot 10^{+101}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+141}:\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{-a}{t}}\\
\end{array}
\end{array}
if t < -9.39999999999999941e101Initial program 97.2%
Taylor expanded in z around 0 91.2%
mul-1-neg91.2%
distribute-lft-neg-out91.2%
*-commutative91.2%
Simplified91.2%
if -9.39999999999999941e101 < t < 1.6999999999999999e141Initial program 91.7%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in z around inf 79.0%
associate-*l/83.7%
*-commutative83.7%
Simplified83.7%
if 1.6999999999999999e141 < t Initial program 95.5%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around 0 90.4%
associate-*r/90.4%
neg-mul-190.4%
Simplified90.4%
Final simplification85.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.4e-67) (not (<= z 2.6e+66))) (* z (/ y (- a))) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.4e-67) || !(z <= 2.6e+66)) {
tmp = z * (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 ((z <= (-6.4d-67)) .or. (.not. (z <= 2.6d+66))) then
tmp = z * (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 ((z <= -6.4e-67) || !(z <= 2.6e+66)) {
tmp = z * (y / -a);
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.4e-67) or not (z <= 2.6e+66): tmp = z * (y / -a) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.4e-67) || !(z <= 2.6e+66)) tmp = Float64(z * Float64(y / Float64(-a))); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.4e-67) || ~((z <= 2.6e+66))) tmp = z * (y / -a); else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.4e-67], N[Not[LessEqual[z, 2.6e+66]], $MachinePrecision]], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{-67} \lor \neg \left(z \leq 2.6 \cdot 10^{+66}\right):\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -6.40000000000000043e-67 or 2.60000000000000012e66 < z Initial program 89.1%
associate-*l/97.1%
Simplified97.1%
Taylor expanded in z around inf 74.5%
associate-*l/82.3%
*-commutative82.3%
Simplified82.3%
clear-num81.7%
div-inv81.7%
Applied egg-rr81.7%
Taylor expanded in x around 0 51.2%
mul-1-neg51.2%
associate-*l/58.6%
distribute-rgt-neg-out58.6%
associate-/r/54.8%
Simplified54.8%
frac-2neg54.8%
remove-double-neg54.8%
associate-/r/58.6%
Applied egg-rr58.6%
if -6.40000000000000043e-67 < z < 2.60000000000000012e66Initial program 96.4%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in z around inf 62.3%
associate-*l/62.4%
*-commutative62.4%
Simplified62.4%
clear-num62.4%
div-inv61.7%
Applied egg-rr61.7%
sub-neg61.7%
+-commutative61.7%
associate-/r/62.3%
distribute-rgt-neg-in62.3%
add-sqr-sqrt39.6%
sqrt-unprod54.9%
sqr-neg54.9%
sqrt-unprod19.1%
add-sqr-sqrt55.3%
associate-/r/57.5%
div-inv58.2%
clear-num58.2%
Applied egg-rr58.2%
Final simplification58.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.6e+95) (not (<= y 4.1e-19))) (* y (/ (- z) a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.6e+95) || !(y <= 4.1e-19)) {
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 ((y <= (-1.6d+95)) .or. (.not. (y <= 4.1d-19))) 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 ((y <= -1.6e+95) || !(y <= 4.1e-19)) {
tmp = y * (-z / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.6e+95) or not (y <= 4.1e-19): tmp = y * (-z / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.6e+95) || !(y <= 4.1e-19)) tmp = Float64(y * Float64(Float64(-z) / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.6e+95) || ~((y <= 4.1e-19))) tmp = y * (-z / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.6e+95], N[Not[LessEqual[y, 4.1e-19]], $MachinePrecision]], N[(y * N[((-z) / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+95} \lor \neg \left(y \leq 4.1 \cdot 10^{-19}\right):\\
\;\;\;\;y \cdot \frac{-z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.6e95 or 4.09999999999999985e-19 < y Initial program 84.7%
associate-*l/95.9%
Simplified95.9%
Taylor expanded in z around inf 57.8%
associate-*l/67.5%
*-commutative67.5%
Simplified67.5%
clear-num67.5%
div-inv66.7%
Applied egg-rr66.7%
Taylor expanded in x around 0 42.1%
mul-1-neg42.1%
associate-*r/50.0%
distribute-rgt-neg-in50.0%
distribute-frac-neg50.0%
Simplified50.0%
if -1.6e95 < y < 4.09999999999999985e-19Initial program 99.9%
associate-*l/96.8%
Simplified96.8%
Taylor expanded in z around inf 76.5%
associate-*l/75.2%
*-commutative75.2%
Simplified75.2%
clear-num74.7%
div-inv74.7%
Applied egg-rr74.7%
Taylor expanded in x around inf 59.6%
Final simplification55.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.2e-67) (not (<= z 4.9e+63))) (* z (/ y (- a))) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e-67) || !(z <= 4.9e+63)) {
tmp = z * (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 ((z <= (-7.2d-67)) .or. (.not. (z <= 4.9d+63))) then
tmp = z * (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 ((z <= -7.2e-67) || !(z <= 4.9e+63)) {
tmp = z * (y / -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.2e-67) or not (z <= 4.9e+63): tmp = z * (y / -a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.2e-67) || !(z <= 4.9e+63)) tmp = Float64(z * Float64(y / Float64(-a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.2e-67) || ~((z <= 4.9e+63))) tmp = z * (y / -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.2e-67], N[Not[LessEqual[z, 4.9e+63]], $MachinePrecision]], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-67} \lor \neg \left(z \leq 4.9 \cdot 10^{+63}\right):\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.19999999999999998e-67 or 4.8999999999999997e63 < z Initial program 89.1%
associate-*l/97.1%
Simplified97.1%
Taylor expanded in z around inf 74.5%
associate-*l/82.3%
*-commutative82.3%
Simplified82.3%
clear-num81.7%
div-inv81.7%
Applied egg-rr81.7%
Taylor expanded in x around 0 51.2%
mul-1-neg51.2%
associate-*l/58.6%
distribute-rgt-neg-out58.6%
associate-/r/54.8%
Simplified54.8%
frac-2neg54.8%
remove-double-neg54.8%
associate-/r/58.6%
Applied egg-rr58.6%
if -7.19999999999999998e-67 < z < 4.8999999999999997e63Initial program 96.4%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in z around inf 62.3%
associate-*l/62.4%
*-commutative62.4%
Simplified62.4%
clear-num62.4%
div-inv61.7%
Applied egg-rr61.7%
Taylor expanded in x around inf 54.5%
Final simplification56.4%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.2e-158) (+ x (* y (/ (- t z) a))) (+ x (* (/ y a) (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.2e-158) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + ((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 (y <= (-2.2d-158)) then
tmp = x + (y * ((t - z) / a))
else
tmp = x + ((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 (y <= -2.2e-158) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + ((y / a) * (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.2e-158: tmp = x + (y * ((t - z) / a)) else: tmp = x + ((y / a) * (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.2e-158) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.2e-158) tmp = x + (y * ((t - z) / a)); else tmp = x + ((y / a) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.2e-158], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-158}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if y < -2.2000000000000001e-158Initial program 91.8%
associate-/l*99.4%
Simplified99.4%
clear-num99.3%
associate-/r/99.0%
clear-num99.1%
Applied egg-rr99.1%
if -2.2000000000000001e-158 < y Initial program 94.0%
associate-*l/97.3%
Simplified97.3%
Final simplification98.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -4.6e-164) (- x (/ y (/ a (- z t)))) (+ x (* (/ y a) (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.6e-164) {
tmp = x - (y / (a / (z - t)));
} else {
tmp = x + ((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 (y <= (-4.6d-164)) then
tmp = x - (y / (a / (z - t)))
else
tmp = x + ((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 (y <= -4.6e-164) {
tmp = x - (y / (a / (z - t)));
} else {
tmp = x + ((y / a) * (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.6e-164: tmp = x - (y / (a / (z - t))) else: tmp = x + ((y / a) * (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.6e-164) tmp = Float64(x - Float64(y / Float64(a / Float64(z - t)))); else tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.6e-164) tmp = x - (y / (a / (z - t))); else tmp = x + ((y / a) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.6e-164], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{-164}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if y < -4.59999999999999971e-164Initial program 91.8%
associate-/l*99.4%
Simplified99.4%
if -4.59999999999999971e-164 < y Initial program 94.0%
associate-*l/97.3%
Simplified97.3%
Final simplification98.2%
(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.0%
associate-*l/96.4%
Simplified96.4%
Final simplification96.4%
(FPCore (x y z t a) :precision binary64 (- x (* z (/ y a))))
double code(double x, double y, double z, double t, double a) {
return x - (z * (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 * (y / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (z * (y / a));
}
def code(x, y, z, t, a): return x - (z * (y / a))
function code(x, y, z, t, a) return Float64(x - Float64(z * Float64(y / a))) end
function tmp = code(x, y, z, t, a) tmp = x - (z * (y / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - z \cdot \frac{y}{a}
\end{array}
Initial program 93.0%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in z around inf 68.0%
associate-*l/71.7%
*-commutative71.7%
Simplified71.7%
Final simplification71.7%
(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.0%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in z around inf 68.0%
associate-*l/71.7%
*-commutative71.7%
Simplified71.7%
clear-num71.4%
div-inv71.1%
Applied egg-rr71.1%
Taylor expanded in x around inf 41.1%
Final simplification41.1%
(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 2024021
(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)))