
(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)) a)))
(if (<= t_1 (- INFINITY))
(- x (* y (/ (- z t) a)))
(if (<= t_1 1e+253) (+ x (/ (* y (- t z)) a)) (/ (- t z) (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x - (y * ((z - t) / a));
} else if (t_1 <= 1e+253) {
tmp = x + ((y * (t - z)) / a);
} else {
tmp = (t - z) / (a / y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x - (y * ((z - t) / a));
} else if (t_1 <= 1e+253) {
tmp = x + ((y * (t - z)) / a);
} else {
tmp = (t - z) / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a tmp = 0 if t_1 <= -math.inf: tmp = x - (y * ((z - t) / a)) elif t_1 <= 1e+253: tmp = x + ((y * (t - z)) / a) else: tmp = (t - z) / (a / y) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x - Float64(y * Float64(Float64(z - t) / a))); elseif (t_1 <= 1e+253) tmp = Float64(x + Float64(Float64(y * Float64(t - z)) / a)); else tmp = Float64(Float64(t - z) / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; tmp = 0.0; if (t_1 <= -Inf) tmp = x - (y * ((z - t) / a)); elseif (t_1 <= 1e+253) tmp = x + ((y * (t - z)) / a); else tmp = (t - z) / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x - N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+253], N[(x + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x - y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;t\_1 \leq 10^{+253}:\\
\;\;\;\;x + \frac{y \cdot \left(t - z\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - z}{\frac{a}{y}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -inf.0Initial program 75.6%
associate-/l*99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) a) < 9.9999999999999994e252Initial program 99.1%
if 9.9999999999999994e252 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 90.0%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in x around 0 90.0%
associate-*r/90.0%
neg-mul-190.0%
*-commutative90.0%
distribute-lft-neg-in90.0%
associate-*r/100.0%
*-commutative100.0%
neg-sub0100.0%
sub-neg100.0%
+-commutative100.0%
associate--r+100.0%
neg-sub0100.0%
remove-double-neg100.0%
Simplified100.0%
*-commutative100.0%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Final simplification99.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.9e-246) (not (<= a 4.8e-195))) (+ x (/ y (/ a (- t z)))) (/ (- t z) (/ a y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.9e-246) || !(a <= 4.8e-195)) {
tmp = x + (y / (a / (t - z)));
} else {
tmp = (t - 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 ((a <= (-3.9d-246)) .or. (.not. (a <= 4.8d-195))) then
tmp = x + (y / (a / (t - z)))
else
tmp = (t - 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 ((a <= -3.9e-246) || !(a <= 4.8e-195)) {
tmp = x + (y / (a / (t - z)));
} else {
tmp = (t - z) / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.9e-246) or not (a <= 4.8e-195): tmp = x + (y / (a / (t - z))) else: tmp = (t - z) / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.9e-246) || !(a <= 4.8e-195)) tmp = Float64(x + Float64(y / Float64(a / Float64(t - z)))); else tmp = Float64(Float64(t - z) / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.9e-246) || ~((a <= 4.8e-195))) tmp = x + (y / (a / (t - z))); else tmp = (t - z) / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.9e-246], N[Not[LessEqual[a, 4.8e-195]], $MachinePrecision]], N[(x + N[(y / N[(a / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.9 \cdot 10^{-246} \lor \neg \left(a \leq 4.8 \cdot 10^{-195}\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{t - z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - z}{\frac{a}{y}}\\
\end{array}
\end{array}
if a < -3.89999999999999979e-246 or 4.8e-195 < a Initial program 91.7%
associate-/l*97.4%
Simplified97.4%
clear-num97.4%
un-div-inv98.2%
Applied egg-rr98.2%
if -3.89999999999999979e-246 < a < 4.8e-195Initial program 97.9%
associate-/l*74.6%
Simplified74.6%
Taylor expanded in x around 0 88.9%
associate-*r/88.9%
neg-mul-188.9%
*-commutative88.9%
distribute-lft-neg-in88.9%
associate-*r/90.3%
*-commutative90.3%
neg-sub090.3%
sub-neg90.3%
+-commutative90.3%
associate--r+90.3%
neg-sub090.3%
remove-double-neg90.3%
Simplified90.3%
*-commutative90.3%
clear-num90.3%
un-div-inv90.4%
Applied egg-rr90.4%
Final simplification96.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.9e-244) (not (<= a 6.6e-195))) (+ x (* y (/ (- t z) a))) (/ (- t z) (/ a y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.9e-244) || !(a <= 6.6e-195)) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = (t - 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 ((a <= (-1.9d-244)) .or. (.not. (a <= 6.6d-195))) then
tmp = x + (y * ((t - z) / a))
else
tmp = (t - 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 ((a <= -1.9e-244) || !(a <= 6.6e-195)) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = (t - z) / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.9e-244) or not (a <= 6.6e-195): tmp = x + (y * ((t - z) / a)) else: tmp = (t - z) / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.9e-244) || !(a <= 6.6e-195)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(Float64(t - z) / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.9e-244) || ~((a <= 6.6e-195))) tmp = x + (y * ((t - z) / a)); else tmp = (t - z) / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.9e-244], N[Not[LessEqual[a, 6.6e-195]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-244} \lor \neg \left(a \leq 6.6 \cdot 10^{-195}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - z}{\frac{a}{y}}\\
\end{array}
\end{array}
if a < -1.9e-244 or 6.6e-195 < a Initial program 91.7%
associate-/l*97.4%
Simplified97.4%
if -1.9e-244 < a < 6.6e-195Initial program 97.9%
associate-/l*74.6%
Simplified74.6%
Taylor expanded in x around 0 88.9%
associate-*r/88.9%
neg-mul-188.9%
*-commutative88.9%
distribute-lft-neg-in88.9%
associate-*r/90.3%
*-commutative90.3%
neg-sub090.3%
sub-neg90.3%
+-commutative90.3%
associate--r+90.3%
neg-sub090.3%
remove-double-neg90.3%
Simplified90.3%
*-commutative90.3%
clear-num90.3%
un-div-inv90.4%
Applied egg-rr90.4%
Final simplification95.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.85e+32) (not (<= z 3.3e+92))) (- x (/ y (/ a z))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.85e+32) || !(z <= 3.3e+92)) {
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 <= (-2.85d+32)) .or. (.not. (z <= 3.3d+92))) 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 <= -2.85e+32) || !(z <= 3.3e+92)) {
tmp = x - (y / (a / z));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.85e+32) or not (z <= 3.3e+92): 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 <= -2.85e+32) || !(z <= 3.3e+92)) 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 <= -2.85e+32) || ~((z <= 3.3e+92))) 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, -2.85e+32], N[Not[LessEqual[z, 3.3e+92]], $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 -2.85 \cdot 10^{+32} \lor \neg \left(z \leq 3.3 \cdot 10^{+92}\right):\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -2.85e32 or 3.29999999999999974e92 < z Initial program 89.7%
associate-/l*93.9%
Simplified93.9%
clear-num93.9%
un-div-inv95.3%
Applied egg-rr95.3%
Taylor expanded in z around inf 85.5%
if -2.85e32 < z < 3.29999999999999974e92Initial program 95.9%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in z around 0 83.0%
neg-mul-183.0%
Simplified83.0%
Taylor expanded in y around 0 87.1%
Final simplification86.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.8e+33) (not (<= z 1.85e+92))) (- x (* y (/ z a))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.8e+33) || !(z <= 1.85e+92)) {
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 <= (-6.8d+33)) .or. (.not. (z <= 1.85d+92))) 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 <= -6.8e+33) || !(z <= 1.85e+92)) {
tmp = x - (y * (z / a));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.8e+33) or not (z <= 1.85e+92): 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 <= -6.8e+33) || !(z <= 1.85e+92)) tmp = Float64(x - Float64(y * Float64(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 <= -6.8e+33) || ~((z <= 1.85e+92))) 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, -6.8e+33], N[Not[LessEqual[z, 1.85e+92]], $MachinePrecision]], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+33} \lor \neg \left(z \leq 1.85 \cdot 10^{+92}\right):\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -6.7999999999999999e33 or 1.84999999999999999e92 < z Initial program 89.7%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in z around inf 80.6%
associate-/l*85.4%
Simplified85.4%
if -6.7999999999999999e33 < z < 1.84999999999999999e92Initial program 95.9%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in z around 0 83.0%
neg-mul-183.0%
Simplified83.0%
Taylor expanded in y around 0 87.1%
Final simplification86.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -3.15e-46) (not (<= y 5e-70))) (* (/ y a) (- t z)) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.15e-46) || !(y <= 5e-70)) {
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 ((y <= (-3.15d-46)) .or. (.not. (y <= 5d-70))) 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 ((y <= -3.15e-46) || !(y <= 5e-70)) {
tmp = (y / a) * (t - z);
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3.15e-46) or not (y <= 5e-70): tmp = (y / a) * (t - z) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3.15e-46) || !(y <= 5e-70)) 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 ((y <= -3.15e-46) || ~((y <= 5e-70))) 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[y, -3.15e-46], N[Not[LessEqual[y, 5e-70]], $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}\;y \leq -3.15 \cdot 10^{-46} \lor \neg \left(y \leq 5 \cdot 10^{-70}\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if y < -3.15e-46 or 4.9999999999999998e-70 < y Initial program 88.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around 0 74.5%
associate-*r/74.5%
neg-mul-174.5%
*-commutative74.5%
distribute-lft-neg-in74.5%
associate-*r/85.2%
*-commutative85.2%
neg-sub085.2%
sub-neg85.2%
+-commutative85.2%
associate--r+85.2%
neg-sub085.2%
remove-double-neg85.2%
Simplified85.2%
if -3.15e-46 < y < 4.9999999999999998e-70Initial program 98.8%
associate-/l*81.9%
Simplified81.9%
Taylor expanded in z around 0 69.6%
neg-mul-169.6%
Simplified69.6%
Taylor expanded in y around 0 81.2%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -5.5e-187) (not (<= y 6.6e-105))) (* (/ y a) (- t z)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -5.5e-187) || !(y <= 6.6e-105)) {
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 ((y <= (-5.5d-187)) .or. (.not. (y <= 6.6d-105))) 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 ((y <= -5.5e-187) || !(y <= 6.6e-105)) {
tmp = (y / a) * (t - z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -5.5e-187) or not (y <= 6.6e-105): tmp = (y / a) * (t - z) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -5.5e-187) || !(y <= 6.6e-105)) 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 ((y <= -5.5e-187) || ~((y <= 6.6e-105))) tmp = (y / a) * (t - z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -5.5e-187], N[Not[LessEqual[y, 6.6e-105]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{-187} \lor \neg \left(y \leq 6.6 \cdot 10^{-105}\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -5.50000000000000033e-187 or 6.5999999999999997e-105 < y Initial program 91.5%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in x around 0 73.1%
associate-*r/73.1%
neg-mul-173.1%
*-commutative73.1%
distribute-lft-neg-in73.1%
associate-*r/80.2%
*-commutative80.2%
neg-sub080.2%
sub-neg80.2%
+-commutative80.2%
associate--r+80.2%
neg-sub080.2%
remove-double-neg80.2%
Simplified80.2%
if -5.50000000000000033e-187 < y < 6.5999999999999997e-105Initial program 98.1%
associate-/l*80.8%
Simplified80.8%
Taylor expanded in x around inf 68.2%
Final simplification77.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.6e+25) (not (<= z 1.7e+26))) (* z (/ (- y) a)) (* t (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.6e+25) || !(z <= 1.7e+26)) {
tmp = 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 ((z <= (-1.6d+25)) .or. (.not. (z <= 1.7d+26))) then
tmp = 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 ((z <= -1.6e+25) || !(z <= 1.7e+26)) {
tmp = z * (-y / a);
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.6e+25) or not (z <= 1.7e+26): tmp = z * (-y / a) else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.6e+25) || !(z <= 1.7e+26)) tmp = Float64(z * Float64(Float64(-y) / a)); else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.6e+25) || ~((z <= 1.7e+26))) tmp = z * (-y / a); else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.6e+25], N[Not[LessEqual[z, 1.7e+26]], $MachinePrecision]], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+25} \lor \neg \left(z \leq 1.7 \cdot 10^{+26}\right):\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.6e25 or 1.7000000000000001e26 < z Initial program 90.3%
associate-/l*91.0%
Simplified91.0%
Taylor expanded in x around 0 64.3%
associate-*r/64.3%
neg-mul-164.3%
*-commutative64.3%
distribute-lft-neg-in64.3%
associate-*r/72.7%
*-commutative72.7%
neg-sub072.7%
sub-neg72.7%
+-commutative72.7%
associate--r+72.7%
neg-sub072.7%
remove-double-neg72.7%
Simplified72.7%
Taylor expanded in t around 0 59.6%
neg-mul-159.6%
Simplified59.6%
if -1.6e25 < z < 1.7000000000000001e26Initial program 96.1%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in x around 0 60.0%
associate-*r/60.0%
neg-mul-160.0%
*-commutative60.0%
distribute-lft-neg-in60.0%
associate-*r/62.1%
*-commutative62.1%
neg-sub062.1%
sub-neg62.1%
+-commutative62.1%
associate--r+62.1%
neg-sub062.1%
remove-double-neg62.1%
Simplified62.1%
Taylor expanded in t around inf 56.3%
Final simplification58.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.75e+25) (not (<= z 1.45e+93))) (* y (/ (- z) a)) (* t (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.75e+25) || !(z <= 1.45e+93)) {
tmp = 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 ((z <= (-2.75d+25)) .or. (.not. (z <= 1.45d+93))) then
tmp = 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 ((z <= -2.75e+25) || !(z <= 1.45e+93)) {
tmp = y * (-z / a);
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.75e+25) or not (z <= 1.45e+93): tmp = y * (-z / a) else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.75e+25) || !(z <= 1.45e+93)) tmp = Float64(y * Float64(Float64(-z) / a)); else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.75e+25) || ~((z <= 1.45e+93))) tmp = y * (-z / a); else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.75e+25], N[Not[LessEqual[z, 1.45e+93]], $MachinePrecision]], N[(y * N[((-z) / a), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{+25} \lor \neg \left(z \leq 1.45 \cdot 10^{+93}\right):\\
\;\;\;\;y \cdot \frac{-z}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.75000000000000009e25 or 1.4499999999999999e93 < z Initial program 89.8%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in z around inf 56.1%
mul-1-neg56.1%
associate-/l*60.6%
distribute-rgt-neg-in60.6%
distribute-frac-neg260.6%
Simplified60.6%
if -2.75000000000000009e25 < z < 1.4499999999999999e93Initial program 95.8%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in x around 0 59.8%
associate-*r/59.8%
neg-mul-159.8%
*-commutative59.8%
distribute-lft-neg-in59.8%
associate-*r/62.3%
*-commutative62.3%
neg-sub062.3%
sub-neg62.3%
+-commutative62.3%
associate--r+62.3%
neg-sub062.3%
remove-double-neg62.3%
Simplified62.3%
Taylor expanded in t around inf 53.2%
Final simplification56.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.2e-68) (not (<= t 7.2e-26))) (* y (/ t a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.2e-68) || !(t <= 7.2e-26)) {
tmp = y * (t / a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-5.2d-68)) .or. (.not. (t <= 7.2d-26))) then
tmp = y * (t / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.2e-68) || !(t <= 7.2e-26)) {
tmp = y * (t / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.2e-68) or not (t <= 7.2e-26): tmp = y * (t / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.2e-68) || !(t <= 7.2e-26)) tmp = Float64(y * Float64(t / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.2e-68) || ~((t <= 7.2e-26))) tmp = y * (t / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.2e-68], N[Not[LessEqual[t, 7.2e-26]], $MachinePrecision]], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{-68} \lor \neg \left(t \leq 7.2 \cdot 10^{-26}\right):\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -5.1999999999999996e-68 or 7.2000000000000003e-26 < t Initial program 92.1%
associate-/l*89.3%
Simplified89.3%
Taylor expanded in t around inf 56.6%
*-commutative56.6%
associate-/l*53.5%
Simplified53.5%
if -5.1999999999999996e-68 < t < 7.2000000000000003e-26Initial program 94.5%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in x around inf 48.6%
Final simplification51.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.9e-13) x (if (<= a 1.7e+61) (* t (/ y a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.9e-13) {
tmp = x;
} else if (a <= 1.7e+61) {
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 (a <= (-1.9d-13)) then
tmp = x
else if (a <= 1.7d+61) 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 (a <= -1.9e-13) {
tmp = x;
} else if (a <= 1.7e+61) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.9e-13: tmp = x elif a <= 1.7e+61: tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.9e-13) tmp = x; elseif (a <= 1.7e+61) 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 (a <= -1.9e-13) tmp = x; elseif (a <= 1.7e+61) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.9e-13], x, If[LessEqual[a, 1.7e+61], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-13}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{+61}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.9e-13 or 1.70000000000000013e61 < a Initial program 85.7%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 57.9%
if -1.9e-13 < a < 1.70000000000000013e61Initial program 98.0%
associate-/l*87.1%
Simplified87.1%
Taylor expanded in x around 0 83.5%
associate-*r/83.5%
neg-mul-183.5%
*-commutative83.5%
distribute-lft-neg-in83.5%
associate-*r/85.2%
*-commutative85.2%
neg-sub085.2%
sub-neg85.2%
+-commutative85.2%
associate--r+85.2%
neg-sub085.2%
remove-double-neg85.2%
Simplified85.2%
Taylor expanded in t around inf 54.6%
Final simplification55.9%
(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*92.1%
Simplified92.1%
Taylor expanded in x around inf 32.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 2024146
(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)))