
(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 13 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)) a) -5e+262) (- x (/ (- z t) (/ a y))) (+ x (/ (* y (- t z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((y * (z - t)) / a) <= -5e+262) {
tmp = x - ((z - t) / (a / y));
} 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)) / a) <= (-5d+262)) then
tmp = x - ((z - t) / (a / y))
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)) / a) <= -5e+262) {
tmp = x - ((z - t) / (a / y));
} else {
tmp = x + ((y * (t - z)) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((y * (z - t)) / a) <= -5e+262: tmp = x - ((z - t) / (a / y)) else: tmp = x + ((y * (t - z)) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(Float64(y * Float64(z - t)) / a) <= -5e+262) tmp = Float64(x - Float64(Float64(z - t) / Float64(a / y))); 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)) / a) <= -5e+262) tmp = x - ((z - t) / (a / y)); else tmp = x + ((y * (t - z)) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], -5e+262], N[(x - N[(N[(z - t), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a} \leq -5 \cdot 10^{+262}:\\
\;\;\;\;x - \frac{z - t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(t - z\right)}{a}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -5.00000000000000008e262Initial program 84.7%
associate-/l*89.9%
Simplified89.9%
Taylor expanded in y around 0 84.7%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
if -5.00000000000000008e262 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 99.0%
Final simplification99.1%
(FPCore (x y z t a) :precision binary64 (if (<= (* y (- z t)) -5e+248) (- x (* y (/ (- z t) a))) (+ x (/ (* y (- t z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y * (z - t)) <= -5e+248) {
tmp = x - (y * ((z - t) / a));
} 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)) <= (-5d+248)) then
tmp = x - (y * ((z - t) / a))
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)) <= -5e+248) {
tmp = x - (y * ((z - t) / a));
} else {
tmp = x + ((y * (t - z)) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y * (z - t)) <= -5e+248: tmp = x - (y * ((z - t) / a)) 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)) <= -5e+248) tmp = Float64(x - Float64(y * Float64(Float64(z - t) / 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) tmp = 0.0; if ((y * (z - t)) <= -5e+248) tmp = x - (y * ((z - t) / a)); 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], -5e+248], N[(x - N[(y * N[(N[(z - t), $MachinePrecision] / a), $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 -5 \cdot 10^{+248}:\\
\;\;\;\;x - y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(t - z\right)}{a}\\
\end{array}
\end{array}
if (*.f64 y (-.f64 z t)) < -4.9999999999999996e248Initial program 80.5%
associate-/l*99.9%
Simplified99.9%
if -4.9999999999999996e248 < (*.f64 y (-.f64 z t)) Initial program 99.0%
Final simplification99.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.7e+26) (not (<= z 9.5e-16))) (- x (/ z (/ a y))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.7e+26) || !(z <= 9.5e-16)) {
tmp = x - (z / (a / y));
} 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 <= (-5.7d+26)) .or. (.not. (z <= 9.5d-16))) then
tmp = x - (z / (a / y))
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 <= -5.7e+26) || !(z <= 9.5e-16)) {
tmp = x - (z / (a / y));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.7e+26) or not (z <= 9.5e-16): tmp = x - (z / (a / y)) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.7e+26) || !(z <= 9.5e-16)) tmp = Float64(x - Float64(z / Float64(a / y))); 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 <= -5.7e+26) || ~((z <= 9.5e-16))) tmp = x - (z / (a / y)); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.7e+26], N[Not[LessEqual[z, 9.5e-16]], $MachinePrecision]], N[(x - N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.7 \cdot 10^{+26} \lor \neg \left(z \leq 9.5 \cdot 10^{-16}\right):\\
\;\;\;\;x - \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -5.7000000000000003e26 or 9.5000000000000005e-16 < z Initial program 96.1%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in y around 0 96.1%
associate-*l/98.3%
*-commutative98.3%
Simplified98.3%
clear-num98.2%
un-div-inv98.3%
Applied egg-rr98.3%
Taylor expanded in z around inf 87.0%
if -5.7000000000000003e26 < z < 9.5000000000000005e-16Initial program 97.7%
sub-neg97.7%
distribute-frac-neg297.7%
+-commutative97.7%
associate-/l*92.9%
fma-define92.9%
distribute-frac-neg292.9%
distribute-neg-frac92.9%
sub-neg92.9%
distribute-neg-in92.9%
remove-double-neg92.9%
+-commutative92.9%
sub-neg92.9%
Simplified92.9%
Taylor expanded in z around 0 89.4%
Final simplification88.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.6e+31) (- x (/ z (/ a y))) (if (<= z 1.05e-13) (+ x (/ (* y t) a)) (- x (/ (* y z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e+31) {
tmp = x - (z / (a / y));
} else if (z <= 1.05e-13) {
tmp = x + ((y * t) / a);
} else {
tmp = x - ((y * 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 (z <= (-1.6d+31)) then
tmp = x - (z / (a / y))
else if (z <= 1.05d-13) then
tmp = x + ((y * t) / a)
else
tmp = x - ((y * 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 (z <= -1.6e+31) {
tmp = x - (z / (a / y));
} else if (z <= 1.05e-13) {
tmp = x + ((y * t) / a);
} else {
tmp = x - ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.6e+31: tmp = x - (z / (a / y)) elif z <= 1.05e-13: tmp = x + ((y * t) / a) else: tmp = x - ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e+31) tmp = Float64(x - Float64(z / Float64(a / y))); elseif (z <= 1.05e-13) tmp = Float64(x + Float64(Float64(y * t) / a)); else tmp = Float64(x - Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.6e+31) tmp = x - (z / (a / y)); elseif (z <= 1.05e-13) tmp = x + ((y * t) / a); else tmp = x - ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e+31], N[(x - N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-13], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+31}:\\
\;\;\;\;x - \frac{z}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-13}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if z < -1.6e31Initial program 94.2%
associate-/l*85.6%
Simplified85.6%
Taylor expanded in y around 0 94.2%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
clear-num99.7%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 83.4%
if -1.6e31 < z < 1.04999999999999994e-13Initial program 97.7%
sub-neg97.7%
distribute-frac-neg297.7%
+-commutative97.7%
associate-/l*92.9%
fma-define92.9%
distribute-frac-neg292.9%
distribute-neg-frac92.9%
sub-neg92.9%
distribute-neg-in92.9%
remove-double-neg92.9%
+-commutative92.9%
sub-neg92.9%
Simplified92.9%
Taylor expanded in z around 0 89.4%
if 1.04999999999999994e-13 < z Initial program 98.3%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in z around inf 92.9%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.95e+70) (* z (/ y (- a))) (if (<= z 4.2e+107) (+ x (/ (* y t) a)) (/ (* y (- z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.95e+70) {
tmp = z * (y / -a);
} else if (z <= 4.2e+107) {
tmp = x + ((y * t) / a);
} else {
tmp = (y * -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 (z <= (-1.95d+70)) then
tmp = z * (y / -a)
else if (z <= 4.2d+107) then
tmp = x + ((y * t) / a)
else
tmp = (y * -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 (z <= -1.95e+70) {
tmp = z * (y / -a);
} else if (z <= 4.2e+107) {
tmp = x + ((y * t) / a);
} else {
tmp = (y * -z) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.95e+70: tmp = z * (y / -a) elif z <= 4.2e+107: tmp = x + ((y * t) / a) else: tmp = (y * -z) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.95e+70) tmp = Float64(z * Float64(y / Float64(-a))); elseif (z <= 4.2e+107) tmp = Float64(x + Float64(Float64(y * t) / a)); else tmp = Float64(Float64(y * Float64(-z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.95e+70) tmp = z * (y / -a); elseif (z <= 4.2e+107) tmp = x + ((y * t) / a); else tmp = (y * -z) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.95e+70], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e+107], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(y * (-z)), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+70}:\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+107}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(-z\right)}{a}\\
\end{array}
\end{array}
if z < -1.94999999999999987e70Initial program 94.8%
associate-/l*84.5%
Simplified84.5%
Taylor expanded in z around inf 66.1%
mul-1-neg66.1%
associate-/l*55.9%
distribute-rgt-neg-in55.9%
distribute-neg-frac255.9%
Simplified55.9%
associate-*r/66.1%
distribute-frac-neg266.1%
div-inv66.0%
*-commutative66.0%
associate-*l*69.4%
div-inv69.5%
Applied egg-rr69.5%
if -1.94999999999999987e70 < z < 4.1999999999999999e107Initial program 97.1%
sub-neg97.1%
distribute-frac-neg297.1%
+-commutative97.1%
associate-/l*93.8%
fma-define93.8%
distribute-frac-neg293.8%
distribute-neg-frac93.8%
sub-neg93.8%
distribute-neg-in93.8%
remove-double-neg93.8%
+-commutative93.8%
sub-neg93.8%
Simplified93.8%
Taylor expanded in z around 0 84.1%
if 4.1999999999999999e107 < z Initial program 100.0%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in z around inf 76.0%
mul-1-neg76.0%
associate-/l*73.1%
distribute-rgt-neg-in73.1%
distribute-neg-frac273.1%
Simplified73.1%
associate-*r/76.0%
frac-2neg76.0%
remove-double-neg76.0%
*-commutative76.0%
distribute-rgt-neg-in76.0%
Applied egg-rr76.0%
Final simplification80.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5e+45) (not (<= z 1.95e+105))) (* z (/ y (- a))) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e+45) || !(z <= 1.95e+105)) {
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 <= (-4.5d+45)) .or. (.not. (z <= 1.95d+105))) 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 <= -4.5e+45) || !(z <= 1.95e+105)) {
tmp = z * (y / -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e+45) or not (z <= 1.95e+105): tmp = z * (y / -a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e+45) || !(z <= 1.95e+105)) 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 <= -4.5e+45) || ~((z <= 1.95e+105))) tmp = z * (y / -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e+45], N[Not[LessEqual[z, 1.95e+105]], $MachinePrecision]], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+45} \lor \neg \left(z \leq 1.95 \cdot 10^{+105}\right):\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.4999999999999998e45 or 1.94999999999999989e105 < z Initial program 95.8%
associate-/l*88.6%
Simplified88.6%
Taylor expanded in z around inf 68.2%
mul-1-neg68.2%
associate-/l*61.1%
distribute-rgt-neg-in61.1%
distribute-neg-frac261.1%
Simplified61.1%
associate-*r/68.2%
distribute-frac-neg268.2%
div-inv68.1%
*-commutative68.1%
associate-*l*68.1%
div-inv68.1%
Applied egg-rr68.1%
if -4.4999999999999998e45 < z < 1.94999999999999989e105Initial program 97.6%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in x around inf 49.5%
Final simplification56.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.7e+45) (* z (/ y (- a))) (if (<= z 3.3e+105) x (/ (* y (- z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.7e+45) {
tmp = z * (y / -a);
} else if (z <= 3.3e+105) {
tmp = x;
} else {
tmp = (y * -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 (z <= (-5.7d+45)) then
tmp = z * (y / -a)
else if (z <= 3.3d+105) then
tmp = x
else
tmp = (y * -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 (z <= -5.7e+45) {
tmp = z * (y / -a);
} else if (z <= 3.3e+105) {
tmp = x;
} else {
tmp = (y * -z) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.7e+45: tmp = z * (y / -a) elif z <= 3.3e+105: tmp = x else: tmp = (y * -z) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.7e+45) tmp = Float64(z * Float64(y / Float64(-a))); elseif (z <= 3.3e+105) tmp = x; else tmp = Float64(Float64(y * Float64(-z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.7e+45) tmp = z * (y / -a); elseif (z <= 3.3e+105) tmp = x; else tmp = (y * -z) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.7e+45], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e+105], x, N[(N[(y * (-z)), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.7 \cdot 10^{+45}:\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+105}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(-z\right)}{a}\\
\end{array}
\end{array}
if z < -5.70000000000000027e45Initial program 93.6%
associate-/l*85.8%
Simplified85.8%
Taylor expanded in z around inf 64.0%
mul-1-neg64.0%
associate-/l*54.7%
distribute-rgt-neg-in54.7%
distribute-neg-frac254.7%
Simplified54.7%
associate-*r/64.0%
distribute-frac-neg264.0%
div-inv63.9%
*-commutative63.9%
associate-*l*67.1%
div-inv67.2%
Applied egg-rr67.2%
if -5.70000000000000027e45 < z < 3.29999999999999997e105Initial program 97.6%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in x around inf 49.5%
if 3.29999999999999997e105 < z Initial program 100.0%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in z around inf 76.0%
mul-1-neg76.0%
associate-/l*73.1%
distribute-rgt-neg-in73.1%
distribute-neg-frac273.1%
Simplified73.1%
associate-*r/76.0%
frac-2neg76.0%
remove-double-neg76.0%
*-commutative76.0%
distribute-rgt-neg-in76.0%
Applied egg-rr76.0%
Final simplification57.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -5e+45) (* z (/ y (- a))) (if (<= z 6.8e+105) x (* y (/ z (- a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e+45) {
tmp = z * (y / -a);
} else if (z <= 6.8e+105) {
tmp = x;
} else {
tmp = y * (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 (z <= (-5d+45)) then
tmp = z * (y / -a)
else if (z <= 6.8d+105) then
tmp = x
else
tmp = y * (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 (z <= -5e+45) {
tmp = z * (y / -a);
} else if (z <= 6.8e+105) {
tmp = x;
} else {
tmp = y * (z / -a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5e+45: tmp = z * (y / -a) elif z <= 6.8e+105: tmp = x else: tmp = y * (z / -a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5e+45) tmp = Float64(z * Float64(y / Float64(-a))); elseif (z <= 6.8e+105) tmp = x; else tmp = Float64(y * Float64(z / Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5e+45) tmp = z * (y / -a); elseif (z <= 6.8e+105) tmp = x; else tmp = y * (z / -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e+45], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e+105], x, N[(y * N[(z / (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+45}:\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+105}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{-a}\\
\end{array}
\end{array}
if z < -5e45Initial program 93.6%
associate-/l*85.8%
Simplified85.8%
Taylor expanded in z around inf 64.0%
mul-1-neg64.0%
associate-/l*54.7%
distribute-rgt-neg-in54.7%
distribute-neg-frac254.7%
Simplified54.7%
associate-*r/64.0%
distribute-frac-neg264.0%
div-inv63.9%
*-commutative63.9%
associate-*l*67.1%
div-inv67.2%
Applied egg-rr67.2%
if -5e45 < z < 6.7999999999999999e105Initial program 97.6%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in x around inf 49.5%
if 6.7999999999999999e105 < z Initial program 100.0%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in z around inf 76.0%
mul-1-neg76.0%
associate-/l*73.1%
distribute-rgt-neg-in73.1%
distribute-neg-frac273.1%
Simplified73.1%
Final simplification56.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4.8e+139) (not (<= y 1.15e+69))) (* t (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.8e+139) || !(y <= 1.15e+69)) {
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 <= (-4.8d+139)) .or. (.not. (y <= 1.15d+69))) 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 <= -4.8e+139) || !(y <= 1.15e+69)) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4.8e+139) or not (y <= 1.15e+69): tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4.8e+139) || !(y <= 1.15e+69)) 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 <= -4.8e+139) || ~((y <= 1.15e+69))) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4.8e+139], N[Not[LessEqual[y, 1.15e+69]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+139} \lor \neg \left(y \leq 1.15 \cdot 10^{+69}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.80000000000000016e139 or 1.15000000000000008e69 < y Initial program 91.7%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in t around inf 46.2%
associate-/l*49.7%
Simplified49.7%
if -4.80000000000000016e139 < y < 1.15000000000000008e69Initial program 99.3%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in x around inf 50.9%
Final simplification50.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -4.5e+139) (* y (/ t a)) (if (<= y 6.7e+72) x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.5e+139) {
tmp = y * (t / a);
} else if (y <= 6.7e+72) {
tmp = x;
} 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 (y <= (-4.5d+139)) then
tmp = y * (t / a)
else if (y <= 6.7d+72) then
tmp = x
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 (y <= -4.5e+139) {
tmp = y * (t / a);
} else if (y <= 6.7e+72) {
tmp = x;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.5e+139: tmp = y * (t / a) elif y <= 6.7e+72: tmp = x else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.5e+139) tmp = Float64(y * Float64(t / a)); elseif (y <= 6.7e+72) tmp = x; else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.5e+139) tmp = y * (t / a); elseif (y <= 6.7e+72) tmp = x; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.5e+139], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.7e+72], x, N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+139}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{elif}\;y \leq 6.7 \cdot 10^{+72}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -4.4999999999999999e139Initial program 90.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 53.4%
*-commutative53.4%
associate-/l*56.6%
Simplified56.6%
if -4.4999999999999999e139 < y < 6.6999999999999998e72Initial program 99.3%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in x around inf 50.9%
if 6.6999999999999998e72 < y Initial program 92.6%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in t around inf 42.2%
associate-/l*47.7%
Simplified47.7%
(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 96.9%
associate-/l*91.8%
Simplified91.8%
Taylor expanded in y around 0 96.9%
associate-*l/97.2%
*-commutative97.2%
Simplified97.2%
Final simplification97.2%
(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 96.9%
associate-/l*91.8%
Simplified91.8%
Final simplification91.8%
(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 96.9%
associate-/l*91.8%
Simplified91.8%
Taylor expanded in x around inf 38.7%
(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 2024165
(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)))