
(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 (if (<= (* y (- z t)) -2e+267) (+ x (/ y (/ a (- t z)))) (+ x (/ (* y (- t z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y * (z - t)) <= -2e+267) {
tmp = x + (y / (a / (t - z)));
} else {
tmp = x + ((y * (t - z)) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y * (z - t)) <= (-2d+267)) then
tmp = x + (y / (a / (t - z)))
else
tmp = x + ((y * (t - z)) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y * (z - t)) <= -2e+267) {
tmp = x + (y / (a / (t - z)));
} else {
tmp = x + ((y * (t - z)) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y * (z - t)) <= -2e+267: tmp = x + (y / (a / (t - z))) else: tmp = x + ((y * (t - z)) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(y * Float64(z - t)) <= -2e+267) tmp = Float64(x + Float64(y / Float64(a / Float64(t - z)))); else tmp = Float64(x + Float64(Float64(y * Float64(t - z)) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y * (z - t)) <= -2e+267) tmp = x + (y / (a / (t - z))); else tmp = x + ((y * (t - z)) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision], -2e+267], N[(x + N[(y / N[(a / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot \left(z - t\right) \leq -2 \cdot 10^{+267}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t - z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(t - z\right)}{a}\\
\end{array}
\end{array}
if (*.f64 y (-.f64 z t)) < -1.9999999999999999e267Initial program 66.4%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
if -1.9999999999999999e267 < (*.f64 y (-.f64 z t)) Initial program 98.3%
Final simplification98.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.42e-89) x (if (<= a 1.65e-139) (* t (/ y a)) (if (<= a 3e-19) (* (/ y a) (- z)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.42e-89) {
tmp = x;
} else if (a <= 1.65e-139) {
tmp = t * (y / a);
} else if (a <= 3e-19) {
tmp = (y / a) * -z;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.42d-89)) then
tmp = x
else if (a <= 1.65d-139) then
tmp = t * (y / a)
else if (a <= 3d-19) then
tmp = (y / a) * -z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.42e-89) {
tmp = x;
} else if (a <= 1.65e-139) {
tmp = t * (y / a);
} else if (a <= 3e-19) {
tmp = (y / a) * -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.42e-89: tmp = x elif a <= 1.65e-139: tmp = t * (y / a) elif a <= 3e-19: tmp = (y / a) * -z else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.42e-89) tmp = x; elseif (a <= 1.65e-139) tmp = Float64(t * Float64(y / a)); elseif (a <= 3e-19) tmp = Float64(Float64(y / a) * Float64(-z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.42e-89) tmp = x; elseif (a <= 1.65e-139) tmp = t * (y / a); elseif (a <= 3e-19) tmp = (y / a) * -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.42e-89], x, If[LessEqual[a, 1.65e-139], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3e-19], N[(N[(y / a), $MachinePrecision] * (-z)), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.42 \cdot 10^{-89}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{-139}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-19}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.42e-89 or 2.99999999999999993e-19 < a Initial program 91.0%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in x around inf 57.6%
if -1.42e-89 < a < 1.65e-139Initial program 99.8%
associate-/l*79.4%
Simplified79.4%
Taylor expanded in x around 0 82.3%
associate-*r/82.3%
neg-mul-182.3%
*-commutative82.3%
distribute-lft-neg-in82.3%
associate-*r/79.0%
*-commutative79.0%
neg-sub079.0%
sub-neg79.0%
+-commutative79.0%
associate--r+79.0%
neg-sub079.0%
remove-double-neg79.0%
Simplified79.0%
Taylor expanded in t around inf 53.7%
if 1.65e-139 < a < 2.99999999999999993e-19Initial program 99.8%
associate-/l*96.1%
Simplified96.1%
clear-num96.0%
un-div-inv95.9%
Applied egg-rr95.9%
Taylor expanded in z around inf 58.8%
mul-1-neg58.8%
associate-*l/59.0%
distribute-rgt-neg-out59.0%
Simplified59.0%
Final simplification56.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.7e-92) x (if (<= a 6e-134) (* t (/ y a)) (if (<= a 1.28e-18) (* y (/ z (- a))) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.7e-92) {
tmp = x;
} else if (a <= 6e-134) {
tmp = t * (y / a);
} else if (a <= 1.28e-18) {
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 (a <= (-2.7d-92)) then
tmp = x
else if (a <= 6d-134) then
tmp = t * (y / a)
else if (a <= 1.28d-18) 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 (a <= -2.7e-92) {
tmp = x;
} else if (a <= 6e-134) {
tmp = t * (y / a);
} else if (a <= 1.28e-18) {
tmp = y * (z / -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.7e-92: tmp = x elif a <= 6e-134: tmp = t * (y / a) elif a <= 1.28e-18: tmp = y * (z / -a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.7e-92) tmp = x; elseif (a <= 6e-134) tmp = Float64(t * Float64(y / a)); elseif (a <= 1.28e-18) tmp = Float64(y * Float64(z / Float64(-a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.7e-92) tmp = x; elseif (a <= 6e-134) tmp = t * (y / a); elseif (a <= 1.28e-18) tmp = y * (z / -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.7e-92], x, If[LessEqual[a, 6e-134], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.28e-18], N[(y * N[(z / (-a)), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{-92}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-134}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;a \leq 1.28 \cdot 10^{-18}:\\
\;\;\;\;y \cdot \frac{z}{-a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.69999999999999995e-92 or 1.27999999999999993e-18 < a Initial program 91.0%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in x around inf 57.6%
if -2.69999999999999995e-92 < a < 6e-134Initial program 99.8%
associate-/l*79.4%
Simplified79.4%
Taylor expanded in x around 0 82.3%
associate-*r/82.3%
neg-mul-182.3%
*-commutative82.3%
distribute-lft-neg-in82.3%
associate-*r/79.0%
*-commutative79.0%
neg-sub079.0%
sub-neg79.0%
+-commutative79.0%
associate--r+79.0%
neg-sub079.0%
remove-double-neg79.0%
Simplified79.0%
Taylor expanded in t around inf 53.7%
if 6e-134 < a < 1.27999999999999993e-18Initial program 99.8%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in z around inf 58.8%
mul-1-neg58.8%
associate-/l*58.9%
distribute-rgt-neg-in58.9%
distribute-frac-neg258.9%
Simplified58.9%
Final simplification56.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1010000.0) (not (<= z 2e+58))) (- x (/ (* y z) a)) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1010000.0) || !(z <= 2e+58)) {
tmp = x - ((y * z) / 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 <= (-1010000.0d0)) .or. (.not. (z <= 2d+58))) then
tmp = x - ((y * z) / 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 <= -1010000.0) || !(z <= 2e+58)) {
tmp = x - ((y * z) / a);
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1010000.0) or not (z <= 2e+58): tmp = x - ((y * z) / a) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1010000.0) || !(z <= 2e+58)) tmp = Float64(x - Float64(Float64(y * z) / a)); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1010000.0) || ~((z <= 2e+58))) tmp = x - ((y * z) / a); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1010000.0], N[Not[LessEqual[z, 2e+58]], $MachinePrecision]], N[(x - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1010000 \lor \neg \left(z \leq 2 \cdot 10^{+58}\right):\\
\;\;\;\;x - \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.01e6 or 1.99999999999999989e58 < z Initial program 91.1%
associate-/l*88.2%
Simplified88.2%
Taylor expanded in z around inf 86.5%
if -1.01e6 < z < 1.99999999999999989e58Initial program 97.4%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in z around 0 90.4%
associate-*r/90.4%
mul-1-neg90.4%
distribute-lft-neg-out90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in y around 0 90.4%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -98000.0) (not (<= z 2.4e+56))) (- x (/ y (/ a z))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -98000.0) || !(z <= 2.4e+56)) {
tmp = x - (y / (a / z));
} 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 <= (-98000.0d0)) .or. (.not. (z <= 2.4d+56))) then
tmp = x - (y / (a / z))
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 <= -98000.0) || !(z <= 2.4e+56)) {
tmp = x - (y / (a / z));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -98000.0) or not (z <= 2.4e+56): tmp = x - (y / (a / z)) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -98000.0) || !(z <= 2.4e+56)) tmp = Float64(x - Float64(y / Float64(a / z))); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -98000.0) || ~((z <= 2.4e+56))) tmp = x - (y / (a / z)); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -98000.0], N[Not[LessEqual[z, 2.4e+56]], $MachinePrecision]], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -98000 \lor \neg \left(z \leq 2.4 \cdot 10^{+56}\right):\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -98000 or 2.40000000000000013e56 < z Initial program 91.1%
associate-/l*88.2%
Simplified88.2%
clear-num88.1%
un-div-inv88.2%
Applied egg-rr88.2%
Taylor expanded in z around inf 82.8%
if -98000 < z < 2.40000000000000013e56Initial program 97.4%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in z around 0 90.4%
associate-*r/90.4%
mul-1-neg90.4%
distribute-lft-neg-out90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in y around 0 90.4%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.2e+34) (not (<= z 6.6e+96))) (* (/ y a) (- t z)) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e+34) || !(z <= 6.6e+96)) {
tmp = (y / a) * (t - z);
} 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 <= (-7.2d+34)) .or. (.not. (z <= 6.6d+96))) then
tmp = (y / a) * (t - z)
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 <= -7.2e+34) || !(z <= 6.6e+96)) {
tmp = (y / a) * (t - z);
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.2e+34) or not (z <= 6.6e+96): tmp = (y / a) * (t - z) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.2e+34) || !(z <= 6.6e+96)) tmp = Float64(Float64(y / a) * Float64(t - z)); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.2e+34) || ~((z <= 6.6e+96))) tmp = (y / a) * (t - z); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.2e+34], N[Not[LessEqual[z, 6.6e+96]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+34} \lor \neg \left(z \leq 6.6 \cdot 10^{+96}\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -7.2000000000000001e34 or 6.59999999999999969e96 < z Initial program 91.0%
associate-/l*87.9%
Simplified87.9%
Taylor expanded in x around 0 64.6%
associate-*r/64.6%
neg-mul-164.6%
*-commutative64.6%
distribute-lft-neg-in64.6%
associate-*r/70.6%
*-commutative70.6%
neg-sub070.6%
sub-neg70.6%
+-commutative70.6%
associate--r+70.6%
neg-sub070.6%
remove-double-neg70.6%
Simplified70.6%
if -7.2000000000000001e34 < z < 6.59999999999999969e96Initial program 97.0%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in z around 0 88.7%
associate-*r/88.7%
mul-1-neg88.7%
distribute-lft-neg-out88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in y around 0 88.7%
Final simplification82.0%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.2e+72) x (if (<= x 1.5e+32) (* (/ y a) (- t z)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.2e+72) {
tmp = x;
} else if (x <= 1.5e+32) {
tmp = (y / a) * (t - z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-1.2d+72)) then
tmp = x
else if (x <= 1.5d+32) then
tmp = (y / a) * (t - z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.2e+72) {
tmp = x;
} else if (x <= 1.5e+32) {
tmp = (y / a) * (t - z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.2e+72: tmp = x elif x <= 1.5e+32: tmp = (y / a) * (t - z) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.2e+72) tmp = x; elseif (x <= 1.5e+32) tmp = Float64(Float64(y / a) * Float64(t - z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.2e+72) tmp = x; elseif (x <= 1.5e+32) tmp = (y / a) * (t - z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.2e+72], x, If[LessEqual[x, 1.5e+32], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+72}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+32}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.20000000000000005e72 or 1.5e32 < x Initial program 96.3%
associate-/l*91.3%
Simplified91.3%
Taylor expanded in x around inf 67.5%
if -1.20000000000000005e72 < x < 1.5e32Initial program 93.8%
associate-/l*92.8%
Simplified92.8%
Taylor expanded in x around 0 72.4%
associate-*r/72.4%
neg-mul-172.4%
*-commutative72.4%
distribute-lft-neg-in72.4%
associate-*r/71.3%
*-commutative71.3%
neg-sub071.3%
sub-neg71.3%
+-commutative71.3%
associate--r+71.3%
neg-sub071.3%
remove-double-neg71.3%
Simplified71.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -0.0032) (not (<= y 4.4e+72))) (* t (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -0.0032) || !(y <= 4.4e+72)) {
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 ((y <= (-0.0032d0)) .or. (.not. (y <= 4.4d+72))) 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 ((y <= -0.0032) || !(y <= 4.4e+72)) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -0.0032) or not (y <= 4.4e+72): tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -0.0032) || !(y <= 4.4e+72)) 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 ((y <= -0.0032) || ~((y <= 4.4e+72))) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -0.0032], N[Not[LessEqual[y, 4.4e+72]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0032 \lor \neg \left(y \leq 4.4 \cdot 10^{+72}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -0.00320000000000000015 or 4.4e72 < y Initial program 87.3%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in x around 0 71.6%
associate-*r/71.6%
neg-mul-171.6%
*-commutative71.6%
distribute-lft-neg-in71.6%
associate-*r/77.0%
*-commutative77.0%
neg-sub077.0%
sub-neg77.0%
+-commutative77.0%
associate--r+77.0%
neg-sub077.0%
remove-double-neg77.0%
Simplified77.0%
Taylor expanded in t around inf 50.8%
if -0.00320000000000000015 < y < 4.4e72Initial program 99.8%
associate-/l*87.5%
Simplified87.5%
Taylor expanded in x around inf 56.3%
Final simplification54.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -255.0) (not (<= y 4e+80))) (* y (/ t a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -255.0) || !(y <= 4e+80)) {
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 ((y <= (-255.0d0)) .or. (.not. (y <= 4d+80))) 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 ((y <= -255.0) || !(y <= 4e+80)) {
tmp = y * (t / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -255.0) or not (y <= 4e+80): tmp = y * (t / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -255.0) || !(y <= 4e+80)) 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 ((y <= -255.0) || ~((y <= 4e+80))) tmp = y * (t / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -255.0], N[Not[LessEqual[y, 4e+80]], $MachinePrecision]], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -255 \lor \neg \left(y \leq 4 \cdot 10^{+80}\right):\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -255 or 4e80 < y Initial program 87.3%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in t around inf 44.3%
*-commutative44.3%
associate-/l*49.2%
Simplified49.2%
if -255 < y < 4e80Initial program 99.8%
associate-/l*87.5%
Simplified87.5%
Taylor expanded in x around inf 56.3%
Final simplification53.4%
(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 94.8%
associate-/l*92.2%
Simplified92.2%
Final simplification92.2%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 94.8%
associate-/l*92.2%
Simplified92.2%
Taylor expanded in x around inf 40.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ a (- z t))))
(if (< y -1.0761266216389975e-10)
(- x (/ 1.0 (/ t_1 y)))
(if (< y 2.894426862792089e-49)
(- x (/ (* y (- z t)) a))
(- x (/ y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x - (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x - ((y * (z - t)) / a);
} else {
tmp = x - (y / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a / (z - t)
if (y < (-1.0761266216389975d-10)) then
tmp = x - (1.0d0 / (t_1 / y))
else if (y < 2.894426862792089d-49) then
tmp = x - ((y * (z - t)) / a)
else
tmp = x - (y / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x - (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x - ((y * (z - t)) / a);
} else {
tmp = x - (y / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a / (z - t) tmp = 0 if y < -1.0761266216389975e-10: tmp = x - (1.0 / (t_1 / y)) elif y < 2.894426862792089e-49: tmp = x - ((y * (z - t)) / a) else: tmp = x - (y / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(a / Float64(z - t)) tmp = 0.0 if (y < -1.0761266216389975e-10) tmp = Float64(x - Float64(1.0 / Float64(t_1 / y))); elseif (y < 2.894426862792089e-49) tmp = Float64(x - Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x - Float64(y / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a / (z - t); tmp = 0.0; if (y < -1.0761266216389975e-10) tmp = x - (1.0 / (t_1 / y)); elseif (y < 2.894426862792089e-49) tmp = x - ((y * (z - t)) / a); else tmp = x - (y / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -1.0761266216389975e-10], N[(x - N[(1.0 / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[y, 2.894426862792089e-49], N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x - \frac{1}{\frac{t\_1}{y}}\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024180
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
:precision binary64
:alt
(! :herbie-platform default (if (< y -430450648655599/4000000000000000000000000) (- x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t)))))))
(- x (/ (* y (- z t)) a)))