
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
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) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\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) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
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) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* y (/ z t)) (- (* a (/ y t)) x)))
(t_2 (/ (* y (- z t)) (- a t)))
(t_3 (- (+ x y) t_2))
(t_4 (+ y (- x t_2))))
(if (<= t_3 (- INFINITY))
t_1
(if (<= t_3 -1e-125)
t_4
(if (<= t_3 2e-274)
(+ x (/ (- (* y z) (* y a)) t))
(if (<= t_3 4e+296) t_4 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z / t)) - ((a * (y / t)) - x);
double t_2 = (y * (z - t)) / (a - t);
double t_3 = (x + y) - t_2;
double t_4 = y + (x - t_2);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_3 <= -1e-125) {
tmp = t_4;
} else if (t_3 <= 2e-274) {
tmp = x + (((y * z) - (y * a)) / t);
} else if (t_3 <= 4e+296) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z / t)) - ((a * (y / t)) - x);
double t_2 = (y * (z - t)) / (a - t);
double t_3 = (x + y) - t_2;
double t_4 = y + (x - t_2);
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_3 <= -1e-125) {
tmp = t_4;
} else if (t_3 <= 2e-274) {
tmp = x + (((y * z) - (y * a)) / t);
} else if (t_3 <= 4e+296) {
tmp = t_4;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z / t)) - ((a * (y / t)) - x) t_2 = (y * (z - t)) / (a - t) t_3 = (x + y) - t_2 t_4 = y + (x - t_2) tmp = 0 if t_3 <= -math.inf: tmp = t_1 elif t_3 <= -1e-125: tmp = t_4 elif t_3 <= 2e-274: tmp = x + (((y * z) - (y * a)) / t) elif t_3 <= 4e+296: tmp = t_4 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z / t)) - Float64(Float64(a * Float64(y / t)) - x)) t_2 = Float64(Float64(y * Float64(z - t)) / Float64(a - t)) t_3 = Float64(Float64(x + y) - t_2) t_4 = Float64(y + Float64(x - t_2)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_1; elseif (t_3 <= -1e-125) tmp = t_4; elseif (t_3 <= 2e-274) tmp = Float64(x + Float64(Float64(Float64(y * z) - Float64(y * a)) / t)); elseif (t_3 <= 4e+296) tmp = t_4; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z / t)) - ((a * (y / t)) - x); t_2 = (y * (z - t)) / (a - t); t_3 = (x + y) - t_2; t_4 = y + (x - t_2); tmp = 0.0; if (t_3 <= -Inf) tmp = t_1; elseif (t_3 <= -1e-125) tmp = t_4; elseif (t_3 <= 2e-274) tmp = x + (((y * z) - (y * a)) / t); elseif (t_3 <= 4e+296) tmp = t_4; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision] - N[(N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + y), $MachinePrecision] - t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(y + N[(x - t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$1, If[LessEqual[t$95$3, -1e-125], t$95$4, If[LessEqual[t$95$3, 2e-274], N[(x + N[(N[(N[(y * z), $MachinePrecision] - N[(y * a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 4e+296], t$95$4, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{t} - \left(a \cdot \frac{y}{t} - x\right)\\
t_2 := \frac{y \cdot \left(z - t\right)}{a - t}\\
t_3 := \left(x + y\right) - t\_2\\
t_4 := y + \left(x - t\_2\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-125}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-274}:\\
\;\;\;\;x + \frac{y \cdot z - y \cdot a}{t}\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+296}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0 or 3.99999999999999993e296 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 44.4%
+-commutative44.4%
associate--l+44.4%
*-commutative44.4%
Simplified44.4%
Taylor expanded in t around inf 57.0%
sub-neg57.0%
mul-1-neg57.0%
unsub-neg57.0%
associate-/l*60.5%
mul-1-neg60.5%
remove-double-neg60.5%
associate-/l*77.6%
Simplified77.6%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1.00000000000000001e-125 or 1.99999999999999993e-274 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 3.99999999999999993e296Initial program 98.6%
+-commutative98.6%
associate--l+98.6%
*-commutative98.6%
Simplified98.6%
if -1.00000000000000001e-125 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.99999999999999993e-274Initial program 21.8%
+-commutative21.8%
associate--l+21.8%
*-commutative21.8%
Simplified21.8%
Taylor expanded in t around -inf 99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
Simplified99.9%
Final simplification94.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- a t))) (t_2 (- (+ x y) t_1)))
(if (<= t_2 (- INFINITY))
(- (* y (/ z t)) (- (* a (/ y t)) x))
(if (<= t_2 -1e-125)
(+ y (- x t_1))
(if (<= t_2 2e-274)
(+ x (/ (- (* y z) (* y a)) t))
(fma (- z t) (/ y (- t a)) (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (a - t);
double t_2 = (x + y) - t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (y * (z / t)) - ((a * (y / t)) - x);
} else if (t_2 <= -1e-125) {
tmp = y + (x - t_1);
} else if (t_2 <= 2e-274) {
tmp = x + (((y * z) - (y * a)) / t);
} else {
tmp = fma((z - t), (y / (t - a)), (x + y));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(a - t)) t_2 = Float64(Float64(x + y) - t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(y * Float64(z / t)) - Float64(Float64(a * Float64(y / t)) - x)); elseif (t_2 <= -1e-125) tmp = Float64(y + Float64(x - t_1)); elseif (t_2 <= 2e-274) tmp = Float64(x + Float64(Float64(Float64(y * z) - Float64(y * a)) / t)); else tmp = fma(Float64(z - t), Float64(y / Float64(t - a)), Float64(x + y)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision] - N[(N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1e-125], N[(y + N[(x - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e-274], N[(x + N[(N[(N[(y * z), $MachinePrecision] - N[(y * a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a - t}\\
t_2 := \left(x + y\right) - t\_1\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;y \cdot \frac{z}{t} - \left(a \cdot \frac{y}{t} - x\right)\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-125}:\\
\;\;\;\;y + \left(x - t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-274}:\\
\;\;\;\;x + \frac{y \cdot z - y \cdot a}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{t - a}, x + y\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0Initial program 45.6%
+-commutative45.6%
associate--l+45.6%
*-commutative45.6%
Simplified45.6%
Taylor expanded in t around inf 57.2%
sub-neg57.2%
mul-1-neg57.2%
unsub-neg57.2%
associate-/l*57.2%
mul-1-neg57.2%
remove-double-neg57.2%
associate-/l*75.5%
Simplified75.5%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1.00000000000000001e-125Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
*-commutative99.3%
Simplified99.3%
if -1.00000000000000001e-125 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.99999999999999993e-274Initial program 21.8%
+-commutative21.8%
associate--l+21.8%
*-commutative21.8%
Simplified21.8%
Taylor expanded in t around -inf 99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
Simplified99.9%
if 1.99999999999999993e-274 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 87.7%
sub-neg87.7%
+-commutative87.7%
distribute-frac-neg87.7%
distribute-rgt-neg-out87.7%
associate-/l*92.8%
fma-define92.7%
distribute-frac-neg92.7%
distribute-neg-frac292.7%
sub-neg92.7%
distribute-neg-in92.7%
remove-double-neg92.7%
+-commutative92.7%
sub-neg92.7%
Simplified92.7%
Final simplification93.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z t))))
(if (<= a -37000.0)
(+ x y)
(if (<= a -5.5e-268)
x
(if (<= a 1e-276)
t_1
(if (<= a 5.1e-241) x (if (<= a 9.5e-158) t_1 (+ x y))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / t);
double tmp;
if (a <= -37000.0) {
tmp = x + y;
} else if (a <= -5.5e-268) {
tmp = x;
} else if (a <= 1e-276) {
tmp = t_1;
} else if (a <= 5.1e-241) {
tmp = x;
} else if (a <= 9.5e-158) {
tmp = t_1;
} else {
tmp = x + 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) :: t_1
real(8) :: tmp
t_1 = y * (z / t)
if (a <= (-37000.0d0)) then
tmp = x + y
else if (a <= (-5.5d-268)) then
tmp = x
else if (a <= 1d-276) then
tmp = t_1
else if (a <= 5.1d-241) then
tmp = x
else if (a <= 9.5d-158) then
tmp = t_1
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / t);
double tmp;
if (a <= -37000.0) {
tmp = x + y;
} else if (a <= -5.5e-268) {
tmp = x;
} else if (a <= 1e-276) {
tmp = t_1;
} else if (a <= 5.1e-241) {
tmp = x;
} else if (a <= 9.5e-158) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / t) tmp = 0 if a <= -37000.0: tmp = x + y elif a <= -5.5e-268: tmp = x elif a <= 1e-276: tmp = t_1 elif a <= 5.1e-241: tmp = x elif a <= 9.5e-158: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / t)) tmp = 0.0 if (a <= -37000.0) tmp = Float64(x + y); elseif (a <= -5.5e-268) tmp = x; elseif (a <= 1e-276) tmp = t_1; elseif (a <= 5.1e-241) tmp = x; elseif (a <= 9.5e-158) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / t); tmp = 0.0; if (a <= -37000.0) tmp = x + y; elseif (a <= -5.5e-268) tmp = x; elseif (a <= 1e-276) tmp = t_1; elseif (a <= 5.1e-241) tmp = x; elseif (a <= 9.5e-158) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -37000.0], N[(x + y), $MachinePrecision], If[LessEqual[a, -5.5e-268], x, If[LessEqual[a, 1e-276], t$95$1, If[LessEqual[a, 5.1e-241], x, If[LessEqual[a, 9.5e-158], t$95$1, N[(x + y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{t}\\
\mathbf{if}\;a \leq -37000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -5.5 \cdot 10^{-268}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 10^{-276}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.1 \cdot 10^{-241}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-158}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -37000 or 9.50000000000000051e-158 < a Initial program 83.8%
sub-neg83.8%
+-commutative83.8%
distribute-frac-neg83.8%
distribute-rgt-neg-out83.8%
associate-/l*88.9%
fma-define89.0%
distribute-frac-neg89.0%
distribute-neg-frac289.0%
sub-neg89.0%
distribute-neg-in89.0%
remove-double-neg89.0%
+-commutative89.0%
sub-neg89.0%
Simplified89.0%
Taylor expanded in a around inf 69.3%
+-commutative69.3%
Simplified69.3%
if -37000 < a < -5.4999999999999997e-268 or 1e-276 < a < 5.0999999999999998e-241Initial program 71.4%
sub-neg71.4%
+-commutative71.4%
distribute-frac-neg71.4%
distribute-rgt-neg-out71.4%
associate-/l*73.8%
fma-define74.0%
distribute-frac-neg74.0%
distribute-neg-frac274.0%
sub-neg74.0%
distribute-neg-in74.0%
remove-double-neg74.0%
+-commutative74.0%
sub-neg74.0%
Simplified74.0%
Taylor expanded in y around 0 64.4%
if -5.4999999999999997e-268 < a < 1e-276 or 5.0999999999999998e-241 < a < 9.50000000000000051e-158Initial program 73.8%
sub-neg73.8%
+-commutative73.8%
distribute-frac-neg73.8%
distribute-rgt-neg-out73.8%
associate-/l*71.6%
fma-define71.7%
distribute-frac-neg71.7%
distribute-neg-frac271.7%
sub-neg71.7%
distribute-neg-in71.7%
remove-double-neg71.7%
+-commutative71.7%
sub-neg71.7%
Simplified71.7%
Taylor expanded in z around inf 60.8%
Taylor expanded in t around inf 60.8%
associate-/l*66.4%
Simplified66.4%
Final simplification67.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.5e-71)
(+ x y)
(if (<= a 1.65e-96)
(* z (+ (/ y t) (/ x z)))
(if (<= a 2.7e-39) (* z (/ y (- t a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.5e-71) {
tmp = x + y;
} else if (a <= 1.65e-96) {
tmp = z * ((y / t) + (x / z));
} else if (a <= 2.7e-39) {
tmp = z * (y / (t - a));
} else {
tmp = x + 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.5d-71)) then
tmp = x + y
else if (a <= 1.65d-96) then
tmp = z * ((y / t) + (x / z))
else if (a <= 2.7d-39) then
tmp = z * (y / (t - a))
else
tmp = x + 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.5e-71) {
tmp = x + y;
} else if (a <= 1.65e-96) {
tmp = z * ((y / t) + (x / z));
} else if (a <= 2.7e-39) {
tmp = z * (y / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.5e-71: tmp = x + y elif a <= 1.65e-96: tmp = z * ((y / t) + (x / z)) elif a <= 2.7e-39: tmp = z * (y / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.5e-71) tmp = Float64(x + y); elseif (a <= 1.65e-96) tmp = Float64(z * Float64(Float64(y / t) + Float64(x / z))); elseif (a <= 2.7e-39) tmp = Float64(z * Float64(y / Float64(t - a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.5e-71) tmp = x + y; elseif (a <= 1.65e-96) tmp = z * ((y / t) + (x / z)); elseif (a <= 2.7e-39) tmp = z * (y / (t - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.5e-71], N[(x + y), $MachinePrecision], If[LessEqual[a, 1.65e-96], N[(z * N[(N[(y / t), $MachinePrecision] + N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.7e-39], N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{-71}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{-96}:\\
\;\;\;\;z \cdot \left(\frac{y}{t} + \frac{x}{z}\right)\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{-39}:\\
\;\;\;\;z \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -3.4999999999999999e-71 or 2.7000000000000001e-39 < a Initial program 82.1%
sub-neg82.1%
+-commutative82.1%
distribute-frac-neg82.1%
distribute-rgt-neg-out82.1%
associate-/l*87.4%
fma-define87.4%
distribute-frac-neg87.4%
distribute-neg-frac287.4%
sub-neg87.4%
distribute-neg-in87.4%
remove-double-neg87.4%
+-commutative87.4%
sub-neg87.4%
Simplified87.4%
Taylor expanded in a around inf 72.3%
+-commutative72.3%
Simplified72.3%
if -3.4999999999999999e-71 < a < 1.64999999999999995e-96Initial program 73.3%
sub-neg73.3%
+-commutative73.3%
distribute-frac-neg73.3%
distribute-rgt-neg-out73.3%
associate-/l*73.8%
fma-define73.9%
distribute-frac-neg73.9%
distribute-neg-frac273.9%
sub-neg73.9%
distribute-neg-in73.9%
remove-double-neg73.9%
+-commutative73.9%
sub-neg73.9%
Simplified73.9%
Taylor expanded in z around inf 62.0%
+-commutative62.0%
mul-1-neg62.0%
unsub-neg62.0%
associate-/r*64.8%
associate-/l*64.7%
*-lft-identity64.7%
times-frac64.6%
/-rgt-identity64.6%
Simplified64.6%
Taylor expanded in a around 0 79.7%
if 1.64999999999999995e-96 < a < 2.7000000000000001e-39Initial program 91.0%
sub-neg91.0%
+-commutative91.0%
distribute-frac-neg91.0%
distribute-rgt-neg-out91.0%
associate-/l*91.1%
fma-define91.6%
distribute-frac-neg91.6%
distribute-neg-frac291.6%
sub-neg91.6%
distribute-neg-in91.6%
remove-double-neg91.6%
+-commutative91.6%
sub-neg91.6%
Simplified91.6%
Taylor expanded in z around inf 82.0%
*-commutative82.0%
*-lft-identity82.0%
times-frac82.2%
/-rgt-identity82.2%
Simplified82.2%
Final simplification75.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.6e+184) (not (<= t 6.5e+206))) (- x (* a (/ y t))) (+ y (+ x (* y (/ z (- t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.6e+184) || !(t <= 6.5e+206)) {
tmp = x - (a * (y / t));
} else {
tmp = y + (x + (y * (z / (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 ((t <= (-1.6d+184)) .or. (.not. (t <= 6.5d+206))) then
tmp = x - (a * (y / t))
else
tmp = y + (x + (y * (z / (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 ((t <= -1.6e+184) || !(t <= 6.5e+206)) {
tmp = x - (a * (y / t));
} else {
tmp = y + (x + (y * (z / (t - a))));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.6e+184) or not (t <= 6.5e+206): tmp = x - (a * (y / t)) else: tmp = y + (x + (y * (z / (t - a)))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.6e+184) || !(t <= 6.5e+206)) tmp = Float64(x - Float64(a * Float64(y / t))); else tmp = Float64(y + Float64(x + Float64(y * Float64(z / Float64(t - a))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.6e+184) || ~((t <= 6.5e+206))) tmp = x - (a * (y / t)); else tmp = y + (x + (y * (z / (t - a)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.6e+184], N[Not[LessEqual[t, 6.5e+206]], $MachinePrecision]], N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(x + N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{+184} \lor \neg \left(t \leq 6.5 \cdot 10^{+206}\right):\\
\;\;\;\;x - a \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;y + \left(x + y \cdot \frac{z}{t - a}\right)\\
\end{array}
\end{array}
if t < -1.59999999999999991e184 or 6.4999999999999995e206 < t Initial program 48.6%
sub-neg48.6%
+-commutative48.6%
distribute-frac-neg48.6%
distribute-rgt-neg-out48.6%
associate-/l*51.7%
fma-define52.1%
distribute-frac-neg52.1%
distribute-neg-frac252.1%
sub-neg52.1%
distribute-neg-in52.1%
remove-double-neg52.1%
+-commutative52.1%
sub-neg52.1%
Simplified52.1%
Taylor expanded in z around inf 39.9%
+-commutative39.9%
mul-1-neg39.9%
unsub-neg39.9%
associate-/r*34.4%
associate-/l*34.3%
*-lft-identity34.3%
times-frac40.9%
/-rgt-identity40.9%
Simplified40.9%
Taylor expanded in z around 0 41.0%
Taylor expanded in t around inf 76.6%
mul-1-neg76.6%
unsub-neg76.6%
associate-/l*81.9%
Simplified81.9%
if -1.59999999999999991e184 < t < 6.4999999999999995e206Initial program 86.3%
+-commutative86.3%
associate--l+86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in z around inf 84.8%
associate-/l*88.1%
Simplified88.1%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.8e-71) (not (<= a 3e-140))) (- (+ x y) (* y (/ z a))) (* z (+ (/ y t) (/ x z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.8e-71) || !(a <= 3e-140)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = z * ((y / t) + (x / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2.8d-71)) .or. (.not. (a <= 3d-140))) then
tmp = (x + y) - (y * (z / a))
else
tmp = z * ((y / t) + (x / z))
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.8e-71) || !(a <= 3e-140)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = z * ((y / t) + (x / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.8e-71) or not (a <= 3e-140): tmp = (x + y) - (y * (z / a)) else: tmp = z * ((y / t) + (x / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.8e-71) || !(a <= 3e-140)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(z * Float64(Float64(y / t) + Float64(x / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.8e-71) || ~((a <= 3e-140))) tmp = (x + y) - (y * (z / a)); else tmp = z * ((y / t) + (x / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.8e-71], N[Not[LessEqual[a, 3e-140]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y / t), $MachinePrecision] + N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.8 \cdot 10^{-71} \lor \neg \left(a \leq 3 \cdot 10^{-140}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{y}{t} + \frac{x}{z}\right)\\
\end{array}
\end{array}
if a < -2.8e-71 or 3.00000000000000018e-140 < a Initial program 83.3%
sub-neg83.3%
+-commutative83.3%
distribute-frac-neg83.3%
distribute-rgt-neg-out83.3%
associate-/l*88.1%
fma-define88.1%
distribute-frac-neg88.1%
distribute-neg-frac288.1%
sub-neg88.1%
distribute-neg-in88.1%
remove-double-neg88.1%
+-commutative88.1%
sub-neg88.1%
Simplified88.1%
Taylor expanded in t around 0 78.6%
mul-1-neg78.6%
associate-+r+78.6%
sub-neg78.6%
+-commutative78.6%
associate-/l*81.6%
Simplified81.6%
if -2.8e-71 < a < 3.00000000000000018e-140Initial program 71.5%
sub-neg71.5%
+-commutative71.5%
distribute-frac-neg71.5%
distribute-rgt-neg-out71.5%
associate-/l*72.0%
fma-define72.2%
distribute-frac-neg72.2%
distribute-neg-frac272.2%
sub-neg72.2%
distribute-neg-in72.2%
remove-double-neg72.2%
+-commutative72.2%
sub-neg72.2%
Simplified72.2%
Taylor expanded in z around inf 60.6%
+-commutative60.6%
mul-1-neg60.6%
unsub-neg60.6%
associate-/r*63.5%
associate-/l*63.4%
*-lft-identity63.4%
times-frac63.3%
/-rgt-identity63.3%
Simplified63.3%
Taylor expanded in a around 0 80.4%
Final simplification81.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.5e+42) (not (<= z 1.85e+133))) (* z (/ y (- t a))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.5e+42) || !(z <= 1.85e+133)) {
tmp = z * (y / (t - a));
} else {
tmp = x + 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 ((z <= (-7.5d+42)) .or. (.not. (z <= 1.85d+133))) then
tmp = z * (y / (t - a))
else
tmp = x + y
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.5e+42) || !(z <= 1.85e+133)) {
tmp = z * (y / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.5e+42) or not (z <= 1.85e+133): tmp = z * (y / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.5e+42) || !(z <= 1.85e+133)) tmp = Float64(z * Float64(y / Float64(t - a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.5e+42) || ~((z <= 1.85e+133))) tmp = z * (y / (t - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.5e+42], N[Not[LessEqual[z, 1.85e+133]], $MachinePrecision]], N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+42} \lor \neg \left(z \leq 1.85 \cdot 10^{+133}\right):\\
\;\;\;\;z \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -7.50000000000000041e42 or 1.85000000000000012e133 < z Initial program 80.7%
sub-neg80.7%
+-commutative80.7%
distribute-frac-neg80.7%
distribute-rgt-neg-out80.7%
associate-/l*90.0%
fma-define90.2%
distribute-frac-neg90.2%
distribute-neg-frac290.2%
sub-neg90.2%
distribute-neg-in90.2%
remove-double-neg90.2%
+-commutative90.2%
sub-neg90.2%
Simplified90.2%
Taylor expanded in z around inf 52.0%
*-commutative52.0%
*-lft-identity52.0%
times-frac63.3%
/-rgt-identity63.3%
Simplified63.3%
if -7.50000000000000041e42 < z < 1.85000000000000012e133Initial program 78.5%
sub-neg78.5%
+-commutative78.5%
distribute-frac-neg78.5%
distribute-rgt-neg-out78.5%
associate-/l*78.5%
fma-define78.6%
distribute-frac-neg78.6%
distribute-neg-frac278.6%
sub-neg78.6%
distribute-neg-in78.6%
remove-double-neg78.6%
+-commutative78.6%
sub-neg78.6%
Simplified78.6%
Taylor expanded in a around inf 69.3%
+-commutative69.3%
Simplified69.3%
Final simplification67.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6e+42) (not (<= z 1.2e+131))) (* y (/ z (- t a))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6e+42) || !(z <= 1.2e+131)) {
tmp = y * (z / (t - a));
} else {
tmp = x + 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 ((z <= (-6d+42)) .or. (.not. (z <= 1.2d+131))) then
tmp = y * (z / (t - a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6e+42) || !(z <= 1.2e+131)) {
tmp = y * (z / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6e+42) or not (z <= 1.2e+131): tmp = y * (z / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6e+42) || !(z <= 1.2e+131)) tmp = Float64(y * Float64(z / Float64(t - a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6e+42) || ~((z <= 1.2e+131))) tmp = y * (z / (t - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6e+42], N[Not[LessEqual[z, 1.2e+131]], $MachinePrecision]], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+42} \lor \neg \left(z \leq 1.2 \cdot 10^{+131}\right):\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -6.00000000000000058e42 or 1.2e131 < z Initial program 80.7%
sub-neg80.7%
+-commutative80.7%
distribute-frac-neg80.7%
distribute-rgt-neg-out80.7%
associate-/l*90.0%
fma-define90.2%
distribute-frac-neg90.2%
distribute-neg-frac290.2%
sub-neg90.2%
distribute-neg-in90.2%
remove-double-neg90.2%
+-commutative90.2%
sub-neg90.2%
Simplified90.2%
clear-num90.4%
inv-pow90.4%
Applied egg-rr90.4%
unpow-190.4%
Simplified90.4%
Taylor expanded in z around inf 52.0%
associate-*r/61.1%
Simplified61.1%
if -6.00000000000000058e42 < z < 1.2e131Initial program 78.5%
sub-neg78.5%
+-commutative78.5%
distribute-frac-neg78.5%
distribute-rgt-neg-out78.5%
associate-/l*78.5%
fma-define78.6%
distribute-frac-neg78.6%
distribute-neg-frac278.6%
sub-neg78.6%
distribute-neg-in78.6%
remove-double-neg78.6%
+-commutative78.6%
sub-neg78.6%
Simplified78.6%
Taylor expanded in a around inf 69.3%
+-commutative69.3%
Simplified69.3%
Final simplification66.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4400.0) (not (<= a 1.5e-187))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4400.0) || !(a <= 1.5e-187)) {
tmp = x + y;
} 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 <= (-4400.0d0)) .or. (.not. (a <= 1.5d-187))) then
tmp = x + y
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 <= -4400.0) || !(a <= 1.5e-187)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4400.0) or not (a <= 1.5e-187): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4400.0) || !(a <= 1.5e-187)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -4400.0) || ~((a <= 1.5e-187))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4400.0], N[Not[LessEqual[a, 1.5e-187]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4400 \lor \neg \left(a \leq 1.5 \cdot 10^{-187}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4400 or 1.50000000000000002e-187 < a Initial program 84.0%
sub-neg84.0%
+-commutative84.0%
distribute-frac-neg84.0%
distribute-rgt-neg-out84.0%
associate-/l*88.9%
fma-define88.9%
distribute-frac-neg88.9%
distribute-neg-frac288.9%
sub-neg88.9%
distribute-neg-in88.9%
remove-double-neg88.9%
+-commutative88.9%
sub-neg88.9%
Simplified88.9%
Taylor expanded in a around inf 67.3%
+-commutative67.3%
Simplified67.3%
if -4400 < a < 1.50000000000000002e-187Initial program 71.0%
sub-neg71.0%
+-commutative71.0%
distribute-frac-neg71.0%
distribute-rgt-neg-out71.0%
associate-/l*71.7%
fma-define71.8%
distribute-frac-neg71.8%
distribute-neg-frac271.8%
sub-neg71.8%
distribute-neg-in71.8%
remove-double-neg71.8%
+-commutative71.8%
sub-neg71.8%
Simplified71.8%
Taylor expanded in y around 0 53.3%
Final simplification62.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.2e+96) y (if (<= y 2.45e+80) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.2e+96) {
tmp = y;
} else if (y <= 2.45e+80) {
tmp = x;
} else {
tmp = 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 (y <= (-1.2d+96)) then
tmp = y
else if (y <= 2.45d+80) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.2e+96) {
tmp = y;
} else if (y <= 2.45e+80) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.2e+96: tmp = y elif y <= 2.45e+80: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.2e+96) tmp = y; elseif (y <= 2.45e+80) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.2e+96) tmp = y; elseif (y <= 2.45e+80) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.2e+96], y, If[LessEqual[y, 2.45e+80], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+96}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{+80}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -1.19999999999999996e96 or 2.4499999999999998e80 < y Initial program 59.3%
sub-neg59.3%
+-commutative59.3%
distribute-frac-neg59.3%
distribute-rgt-neg-out59.3%
associate-/l*69.5%
fma-define69.6%
distribute-frac-neg69.6%
distribute-neg-frac269.6%
sub-neg69.6%
distribute-neg-in69.6%
remove-double-neg69.6%
+-commutative69.6%
sub-neg69.6%
Simplified69.6%
Taylor expanded in a around inf 38.6%
+-commutative38.6%
Simplified38.6%
Taylor expanded in y around inf 31.9%
if -1.19999999999999996e96 < y < 2.4499999999999998e80Initial program 90.0%
sub-neg90.0%
+-commutative90.0%
distribute-frac-neg90.0%
distribute-rgt-neg-out90.0%
associate-/l*89.7%
fma-define89.7%
distribute-frac-neg89.7%
distribute-neg-frac289.7%
sub-neg89.7%
distribute-neg-in89.7%
remove-double-neg89.7%
+-commutative89.7%
sub-neg89.7%
Simplified89.7%
Taylor expanded in y around 0 67.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 79.2%
sub-neg79.2%
+-commutative79.2%
distribute-frac-neg79.2%
distribute-rgt-neg-out79.2%
associate-/l*82.6%
fma-define82.7%
distribute-frac-neg82.7%
distribute-neg-frac282.7%
sub-neg82.7%
distribute-neg-in82.7%
remove-double-neg82.7%
+-commutative82.7%
sub-neg82.7%
Simplified82.7%
Taylor expanded in y around 0 49.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (< t_2 -1.3664970889390727e-7)
t_1
(if (< t_2 1.4754293444577233e-239)
(/ (- (* y (- a z)) (* x t)) (- a t))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y + x) - (((z - t) * (1.0d0 / (a - t))) * y)
t_2 = (x + y) - (((z - t) * y) / (a - t))
if (t_2 < (-1.3664970889390727d-7)) then
tmp = t_1
else if (t_2 < 1.4754293444577233d-239) then
tmp = ((y * (a - z)) - (x * t)) / (a - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 < -1.3664970889390727e-7: tmp = t_1 elif t_2 < 1.4754293444577233e-239: tmp = ((y * (a - z)) - (x * t)) / (a - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) - Float64(Float64(Float64(z - t) * Float64(1.0 / Float64(a - t))) * y)) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = Float64(Float64(Float64(y * Float64(a - z)) - Float64(x * t)) / Float64(a - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = ((y * (a - z)) - (x * t)) / (a - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -1.3664970889390727e-7], t$95$1, If[Less[t$95$2, 1.4754293444577233e-239], N[(N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_2 < -1.3664970889390727 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 < 1.4754293444577233 \cdot 10^{-239}:\\
\;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024165
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -13664970889390727/100000000000000000000000) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 14754293444577233/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)))))
(- (+ x y) (/ (* (- z t) y) (- a t))))