
(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 15 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 (- (+ x y) (/ (* y (- z t)) (- a t)))) (t_2 (/ y (- t a))))
(if (<= t_1 (- INFINITY))
(* z (- (fma -1.0 (/ (- y (- (* t t_2) x)) z) (/ y (- a t)))))
(if (<= t_1 -4e-284)
t_1
(if (<= t_1 1e-244)
(- x (/ (* y (- a z)) t))
(fma (- z t) t_2 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((y * (z - t)) / (a - t));
double t_2 = y / (t - a);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = z * -fma(-1.0, ((y - ((t * t_2) - x)) / z), (y / (a - t)));
} else if (t_1 <= -4e-284) {
tmp = t_1;
} else if (t_1 <= 1e-244) {
tmp = x - ((y * (a - z)) / t);
} else {
tmp = fma((z - t), t_2, (x + y));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(y * Float64(z - t)) / Float64(a - t))) t_2 = Float64(y / Float64(t - a)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(z * Float64(-fma(-1.0, Float64(Float64(y - Float64(Float64(t * t_2) - x)) / z), Float64(y / Float64(a - t))))); elseif (t_1 <= -4e-284) tmp = t_1; elseif (t_1 <= 1e-244) tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); else tmp = fma(Float64(z - t), t_2, Float64(x + y)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z * (-N[(-1.0 * N[(N[(y - N[(N[(t * t$95$2), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[t$95$1, -4e-284], t$95$1, If[LessEqual[t$95$1, 1e-244], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * t$95$2 + N[(x + y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{y \cdot \left(z - t\right)}{a - t}\\
t_2 := \frac{y}{t - a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;z \cdot \left(-\mathsf{fma}\left(-1, \frac{y - \left(t \cdot t\_2 - x\right)}{z}, \frac{y}{a - t}\right)\right)\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{-284}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 10^{-244}:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, t\_2, x + y\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -inf.0Initial program 37.3%
Taylor expanded in z around -inf 53.2%
mul-1-neg53.2%
distribute-rgt-neg-in53.2%
fma-neg53.2%
Simplified95.1%
if -inf.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -4.00000000000000015e-284Initial program 96.2%
if -4.00000000000000015e-284 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 9.9999999999999993e-245Initial program 7.7%
Taylor expanded in t around inf 99.6%
associate--l+99.6%
distribute-lft-out--99.6%
div-sub99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
distribute-lft-out--99.6%
Simplified99.6%
if 9.9999999999999993e-245 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 83.4%
sub-neg83.4%
+-commutative83.4%
distribute-frac-neg83.4%
distribute-rgt-neg-out83.4%
associate-/l*92.2%
fma-define92.3%
distribute-frac-neg92.3%
distribute-neg-frac292.3%
sub-neg92.3%
distribute-neg-in92.3%
remove-double-neg92.3%
+-commutative92.3%
sub-neg92.3%
Simplified92.3%
Final simplification94.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- t a))) (t_2 (- (+ x y) (/ (* y (- z t)) (- a t)))))
(if (<= t_2 -4e-284)
(+ (+ x y) (* (- z t) t_1))
(if (<= t_2 1e-244)
(- x (/ (* y (- a z)) t))
(fma (- z t) t_1 (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (t - a);
double t_2 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if (t_2 <= -4e-284) {
tmp = (x + y) + ((z - t) * t_1);
} else if (t_2 <= 1e-244) {
tmp = x - ((y * (a - z)) / t);
} else {
tmp = fma((z - t), t_1, (x + y));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y / Float64(t - a)) t_2 = Float64(Float64(x + y) - Float64(Float64(y * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -4e-284) tmp = Float64(Float64(x + y) + Float64(Float64(z - t) * t_1)); elseif (t_2 <= 1e-244) tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); else tmp = fma(Float64(z - t), t_1, Float64(x + y)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-284], N[(N[(x + y), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e-244], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * t$95$1 + N[(x + y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{t - a}\\
t_2 := \left(x + y\right) - \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-284}:\\
\;\;\;\;\left(x + y\right) + \left(z - t\right) \cdot t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-244}:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, t\_1, x + y\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -4.00000000000000015e-284Initial program 81.8%
Taylor expanded in y around 0 81.8%
associate-*l/92.1%
Simplified92.1%
if -4.00000000000000015e-284 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 9.9999999999999993e-245Initial program 7.7%
Taylor expanded in t around inf 99.6%
associate--l+99.6%
distribute-lft-out--99.6%
div-sub99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
distribute-lft-out--99.6%
Simplified99.6%
if 9.9999999999999993e-245 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 83.4%
sub-neg83.4%
+-commutative83.4%
distribute-frac-neg83.4%
distribute-rgt-neg-out83.4%
associate-/l*92.2%
fma-define92.3%
distribute-frac-neg92.3%
distribute-neg-frac292.3%
sub-neg92.3%
distribute-neg-in92.3%
remove-double-neg92.3%
+-commutative92.3%
sub-neg92.3%
Simplified92.3%
Final simplification92.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ x y) (/ (* y (- z t)) (- a t)))))
(if (or (<= t_1 -4e-284) (not (<= t_1 1e-244)))
(+ (+ x y) (* (- z t) (/ y (- t a))))
(- x (/ (* y (- a z)) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if ((t_1 <= -4e-284) || !(t_1 <= 1e-244)) {
tmp = (x + y) + ((z - t) * (y / (t - a)));
} else {
tmp = x - ((y * (a - z)) / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (x + y) - ((y * (z - t)) / (a - t))
if ((t_1 <= (-4d-284)) .or. (.not. (t_1 <= 1d-244))) then
tmp = (x + y) + ((z - t) * (y / (t - a)))
else
tmp = x - ((y * (a - z)) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) - ((y * (z - t)) / (a - t));
double tmp;
if ((t_1 <= -4e-284) || !(t_1 <= 1e-244)) {
tmp = (x + y) + ((z - t) * (y / (t - a)));
} else {
tmp = x - ((y * (a - z)) / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) - ((y * (z - t)) / (a - t)) tmp = 0 if (t_1 <= -4e-284) or not (t_1 <= 1e-244): tmp = (x + y) + ((z - t) * (y / (t - a))) else: tmp = x - ((y * (a - z)) / t) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) - Float64(Float64(y * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -4e-284) || !(t_1 <= 1e-244)) tmp = Float64(Float64(x + y) + Float64(Float64(z - t) * Float64(y / Float64(t - a)))); else tmp = Float64(x - Float64(Float64(y * Float64(a - z)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) - ((y * (z - t)) / (a - t)); tmp = 0.0; if ((t_1 <= -4e-284) || ~((t_1 <= 1e-244))) tmp = (x + y) + ((z - t) * (y / (t - a))); else tmp = x - ((y * (a - z)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e-284], N[Not[LessEqual[t$95$1, 1e-244]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) - \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-284} \lor \neg \left(t\_1 \leq 10^{-244}\right):\\
\;\;\;\;\left(x + y\right) + \left(z - t\right) \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -4.00000000000000015e-284 or 9.9999999999999993e-245 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 82.6%
Taylor expanded in y around 0 82.6%
associate-*l/92.1%
Simplified92.1%
if -4.00000000000000015e-284 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 9.9999999999999993e-245Initial program 7.7%
Taylor expanded in t around inf 99.6%
associate--l+99.6%
distribute-lft-out--99.6%
div-sub99.6%
mul-1-neg99.6%
unsub-neg99.6%
*-commutative99.6%
distribute-lft-out--99.6%
Simplified99.6%
Final simplification92.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.6e+18) (not (<= a 2.6e-75))) (+ x y) (+ x (* (/ y t) (+ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.6e+18) || !(a <= 2.6e-75)) {
tmp = x + 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 ((a <= (-3.6d+18)) .or. (.not. (a <= 2.6d-75))) then
tmp = x + 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 ((a <= -3.6e+18) || !(a <= 2.6e-75)) {
tmp = x + y;
} else {
tmp = x + ((y / t) * (z + a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.6e+18) or not (a <= 2.6e-75): tmp = x + y else: tmp = x + ((y / t) * (z + a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.6e+18) || !(a <= 2.6e-75)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y / t) * Float64(z + a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.6e+18) || ~((a <= 2.6e-75))) tmp = x + y; else tmp = x + ((y / t) * (z + a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.6e+18], N[Not[LessEqual[a, 2.6e-75]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y / t), $MachinePrecision] * N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.6 \cdot 10^{+18} \lor \neg \left(a \leq 2.6 \cdot 10^{-75}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z + a\right)\\
\end{array}
\end{array}
if a < -3.6e18 or 2.6e-75 < a Initial program 77.9%
Taylor expanded in a around inf 73.7%
+-commutative73.7%
Simplified73.7%
if -3.6e18 < a < 2.6e-75Initial program 77.8%
Taylor expanded in t around inf 82.9%
associate--l+82.9%
mul-1-neg82.9%
associate-/l*78.5%
mul-1-neg78.5%
associate-/l*79.7%
Simplified79.7%
sub-neg79.7%
add-sqr-sqrt64.3%
sqrt-unprod79.9%
sqr-neg79.9%
sqrt-unprod43.3%
add-sqr-sqrt80.9%
remove-double-neg80.9%
clear-num80.5%
un-div-inv80.5%
Applied egg-rr80.5%
*-commutative80.5%
associate-/r/83.2%
distribute-lft-out86.0%
Simplified86.0%
Final simplification78.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2e-86) (not (<= a 2e-98))) (- (+ x y) (* y (/ z a))) (+ x (* (/ y t) (+ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2e-86) || !(a <= 2e-98)) {
tmp = (x + y) - (y * (z / 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 ((a <= (-2d-86)) .or. (.not. (a <= 2d-98))) then
tmp = (x + y) - (y * (z / 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 ((a <= -2e-86) || !(a <= 2e-98)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + ((y / t) * (z + a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2e-86) or not (a <= 2e-98): tmp = (x + y) - (y * (z / a)) else: tmp = x + ((y / t) * (z + a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2e-86) || !(a <= 2e-98)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(Float64(y / t) * Float64(z + a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2e-86) || ~((a <= 2e-98))) tmp = (x + y) - (y * (z / a)); else tmp = x + ((y / t) * (z + a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2e-86], N[Not[LessEqual[a, 2e-98]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / t), $MachinePrecision] * N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{-86} \lor \neg \left(a \leq 2 \cdot 10^{-98}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z + a\right)\\
\end{array}
\end{array}
if a < -2.00000000000000017e-86 or 1.99999999999999988e-98 < a Initial program 78.2%
Taylor expanded in t around 0 77.9%
+-commutative77.9%
associate-/l*85.7%
Simplified85.7%
if -2.00000000000000017e-86 < a < 1.99999999999999988e-98Initial program 77.4%
Taylor expanded in t around inf 88.8%
associate--l+88.8%
mul-1-neg88.8%
associate-/l*83.5%
mul-1-neg83.5%
associate-/l*84.6%
Simplified84.6%
sub-neg84.6%
add-sqr-sqrt67.5%
sqrt-unprod83.8%
sqr-neg83.8%
sqrt-unprod46.4%
add-sqr-sqrt84.9%
remove-double-neg84.9%
clear-num84.8%
un-div-inv84.8%
Applied egg-rr84.8%
*-commutative84.8%
associate-/r/87.0%
distribute-lft-out90.4%
Simplified90.4%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.26e-87) (not (<= a 8.5e-98))) (- (+ x y) (/ y (/ a z))) (+ x (* (/ y t) (+ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.26e-87) || !(a <= 8.5e-98)) {
tmp = (x + y) - (y / (a / z));
} else {
tmp = x + ((y / t) * (z + a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.26d-87)) .or. (.not. (a <= 8.5d-98))) then
tmp = (x + y) - (y / (a / z))
else
tmp = x + ((y / t) * (z + a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.26e-87) || !(a <= 8.5e-98)) {
tmp = (x + y) - (y / (a / z));
} else {
tmp = x + ((y / t) * (z + a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.26e-87) or not (a <= 8.5e-98): tmp = (x + y) - (y / (a / z)) else: tmp = x + ((y / t) * (z + a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.26e-87) || !(a <= 8.5e-98)) tmp = Float64(Float64(x + y) - Float64(y / Float64(a / z))); else tmp = Float64(x + Float64(Float64(y / t) * Float64(z + a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.26e-87) || ~((a <= 8.5e-98))) tmp = (x + y) - (y / (a / z)); else tmp = x + ((y / t) * (z + a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.26e-87], N[Not[LessEqual[a, 8.5e-98]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / t), $MachinePrecision] * N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.26 \cdot 10^{-87} \lor \neg \left(a \leq 8.5 \cdot 10^{-98}\right):\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z + a\right)\\
\end{array}
\end{array}
if a < -1.26000000000000009e-87 or 8.4999999999999997e-98 < a Initial program 78.2%
Taylor expanded in t around 0 77.9%
+-commutative77.9%
associate-/l*85.7%
Simplified85.7%
clear-num85.7%
un-div-inv85.7%
Applied egg-rr85.7%
if -1.26000000000000009e-87 < a < 8.4999999999999997e-98Initial program 77.4%
Taylor expanded in t around inf 88.8%
associate--l+88.8%
mul-1-neg88.8%
associate-/l*83.5%
mul-1-neg83.5%
associate-/l*84.6%
Simplified84.6%
sub-neg84.6%
add-sqr-sqrt67.5%
sqrt-unprod83.8%
sqr-neg83.8%
sqrt-unprod46.4%
add-sqr-sqrt84.9%
remove-double-neg84.9%
clear-num84.8%
un-div-inv84.8%
Applied egg-rr84.8%
*-commutative84.8%
associate-/r/87.0%
distribute-lft-out90.4%
Simplified90.4%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+135) (not (<= z 2.9e+203))) (* y (- 1.0 (/ z a))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+135) || !(z <= 2.9e+203)) {
tmp = y * (1.0 - (z / 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 <= (-1.1d+135)) .or. (.not. (z <= 2.9d+203))) then
tmp = y * (1.0d0 - (z / 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 <= -1.1e+135) || !(z <= 2.9e+203)) {
tmp = y * (1.0 - (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e+135) or not (z <= 2.9e+203): tmp = y * (1.0 - (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e+135) || !(z <= 2.9e+203)) tmp = Float64(y * Float64(1.0 - Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.1e+135) || ~((z <= 2.9e+203))) tmp = y * (1.0 - (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e+135], N[Not[LessEqual[z, 2.9e+203]], $MachinePrecision]], N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+135} \lor \neg \left(z \leq 2.9 \cdot 10^{+203}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{z}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.1e135 or 2.90000000000000011e203 < z Initial program 69.8%
Taylor expanded in x around 0 55.1%
sub-neg55.1%
*-rgt-identity55.1%
associate-*r/73.6%
distribute-rgt-neg-in73.6%
mul-1-neg73.6%
distribute-lft-in73.6%
mul-1-neg73.6%
unsub-neg73.6%
Simplified73.6%
Taylor expanded in t around 0 51.7%
if -1.1e135 < z < 2.90000000000000011e203Initial program 80.0%
Taylor expanded in a around inf 72.8%
+-commutative72.8%
Simplified72.8%
Final simplification68.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.7e+107) (not (<= z 1.1e+203))) (* y (/ z (- t a))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.7e+107) || !(z <= 1.1e+203)) {
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 <= (-3.7d+107)) .or. (.not. (z <= 1.1d+203))) 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 <= -3.7e+107) || !(z <= 1.1e+203)) {
tmp = y * (z / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.7e+107) or not (z <= 1.1e+203): tmp = y * (z / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.7e+107) || !(z <= 1.1e+203)) 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 <= -3.7e+107) || ~((z <= 1.1e+203))) tmp = y * (z / (t - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.7e+107], N[Not[LessEqual[z, 1.1e+203]], $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 -3.7 \cdot 10^{+107} \lor \neg \left(z \leq 1.1 \cdot 10^{+203}\right):\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.7e107 or 1.10000000000000002e203 < z Initial program 72.8%
sub-neg72.8%
+-commutative72.8%
distribute-frac-neg72.8%
distribute-rgt-neg-out72.8%
associate-/l*98.1%
fma-define98.1%
distribute-frac-neg98.1%
distribute-neg-frac298.1%
sub-neg98.1%
distribute-neg-in98.1%
remove-double-neg98.1%
+-commutative98.1%
sub-neg98.1%
Simplified98.1%
Taylor expanded in z around inf 54.9%
associate-/l*66.0%
Simplified66.0%
if -3.7e107 < z < 1.10000000000000002e203Initial program 79.4%
Taylor expanded in a around inf 73.5%
+-commutative73.5%
Simplified73.5%
Final simplification71.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.1e+106) (not (<= z 2.1e+225))) (* z (/ y (- t a))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.1e+106) || !(z <= 2.1e+225)) {
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 <= (-3.1d+106)) .or. (.not. (z <= 2.1d+225))) 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 <= -3.1e+106) || !(z <= 2.1e+225)) {
tmp = z * (y / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.1e+106) or not (z <= 2.1e+225): tmp = z * (y / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.1e+106) || !(z <= 2.1e+225)) 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 <= -3.1e+106) || ~((z <= 2.1e+225))) tmp = z * (y / (t - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.1e+106], N[Not[LessEqual[z, 2.1e+225]], $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 -3.1 \cdot 10^{+106} \lor \neg \left(z \leq 2.1 \cdot 10^{+225}\right):\\
\;\;\;\;z \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.0999999999999999e106 or 2.1e225 < z Initial program 75.9%
sub-neg75.9%
+-commutative75.9%
distribute-frac-neg75.9%
distribute-rgt-neg-out75.9%
associate-/l*99.8%
fma-define99.7%
distribute-frac-neg99.7%
distribute-neg-frac299.7%
sub-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
+-commutative99.7%
sub-neg99.7%
Simplified99.7%
Taylor expanded in z around inf 54.7%
*-commutative54.7%
*-un-lft-identity54.7%
times-frac70.3%
Applied egg-rr70.3%
Taylor expanded in z around 0 54.7%
*-commutative54.7%
associate-/l*70.3%
Simplified70.3%
if -3.0999999999999999e106 < z < 2.1e225Initial program 78.4%
Taylor expanded in a around inf 72.6%
+-commutative72.6%
Simplified72.6%
Final simplification72.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.2e+15) (not (<= a 4.1e-75))) (+ x y) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.2e+15) || !(a <= 4.1e-75)) {
tmp = x + y;
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-6.2d+15)) .or. (.not. (a <= 4.1d-75))) then
tmp = x + y
else
tmp = x + (y * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.2e+15) || !(a <= 4.1e-75)) {
tmp = x + y;
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6.2e+15) or not (a <= 4.1e-75): tmp = x + y else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6.2e+15) || !(a <= 4.1e-75)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -6.2e+15) || ~((a <= 4.1e-75))) tmp = x + y; else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.2e+15], N[Not[LessEqual[a, 4.1e-75]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{+15} \lor \neg \left(a \leq 4.1 \cdot 10^{-75}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if a < -6.2e15 or 4.10000000000000002e-75 < a Initial program 77.9%
Taylor expanded in a around inf 73.7%
+-commutative73.7%
Simplified73.7%
if -6.2e15 < a < 4.10000000000000002e-75Initial program 77.8%
Taylor expanded in t around inf 82.9%
associate--l+82.9%
mul-1-neg82.9%
associate-/l*78.5%
mul-1-neg78.5%
associate-/l*79.7%
Simplified79.7%
Taylor expanded in z around 0 82.9%
Taylor expanded in z around inf 82.6%
associate-*r/83.8%
Simplified83.8%
Final simplification77.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+135) (not (<= z 1.12e+227))) (* z (/ (- y) a)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+135) || !(z <= 1.12e+227)) {
tmp = z * (-y / 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 <= (-1.1d+135)) .or. (.not. (z <= 1.12d+227))) then
tmp = z * (-y / 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 <= -1.1e+135) || !(z <= 1.12e+227)) {
tmp = z * (-y / a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e+135) or not (z <= 1.12e+227): tmp = z * (-y / a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e+135) || !(z <= 1.12e+227)) tmp = Float64(z * Float64(Float64(-y) / a)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.1e+135) || ~((z <= 1.12e+227))) tmp = z * (-y / a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e+135], N[Not[LessEqual[z, 1.12e+227]], $MachinePrecision]], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+135} \lor \neg \left(z \leq 1.12 \cdot 10^{+227}\right):\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.1e135 or 1.1200000000000001e227 < z Initial program 72.5%
sub-neg72.5%
+-commutative72.5%
distribute-frac-neg72.5%
distribute-rgt-neg-out72.5%
associate-/l*99.7%
fma-define99.7%
distribute-frac-neg99.7%
distribute-neg-frac299.7%
sub-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
+-commutative99.7%
sub-neg99.7%
Simplified99.7%
Taylor expanded in z around inf 54.2%
Taylor expanded in t around 0 37.8%
associate-*r/37.8%
associate-*r*37.8%
neg-mul-137.8%
*-commutative37.8%
Simplified37.8%
frac-2neg37.8%
distribute-frac-neg37.8%
add-sqr-sqrt14.1%
sqrt-unprod19.3%
sqr-neg19.3%
sqrt-unprod5.1%
add-sqr-sqrt8.2%
*-commutative8.2%
distribute-frac-neg28.2%
distribute-frac-neg8.2%
*-commutative8.2%
distribute-rgt-neg-out8.2%
associate-/l*8.2%
add-sqr-sqrt3.1%
sqrt-unprod24.9%
sqr-neg24.9%
sqrt-unprod24.0%
add-sqr-sqrt46.9%
Applied egg-rr46.9%
if -1.1e135 < z < 1.1200000000000001e227Initial program 79.2%
Taylor expanded in a around inf 71.7%
+-commutative71.7%
Simplified71.7%
Final simplification67.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.1e+135) (* (/ z a) (- y)) (if (<= z 9.8e+226) (+ x y) (* z (/ (- y) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+135) {
tmp = (z / a) * -y;
} else if (z <= 9.8e+226) {
tmp = x + y;
} else {
tmp = z * (-y / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.1d+135)) then
tmp = (z / a) * -y
else if (z <= 9.8d+226) then
tmp = x + y
else
tmp = z * (-y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+135) {
tmp = (z / a) * -y;
} else if (z <= 9.8e+226) {
tmp = x + y;
} else {
tmp = z * (-y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e+135: tmp = (z / a) * -y elif z <= 9.8e+226: tmp = x + y else: tmp = z * (-y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e+135) tmp = Float64(Float64(z / a) * Float64(-y)); elseif (z <= 9.8e+226) tmp = Float64(x + y); else tmp = Float64(z * Float64(Float64(-y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.1e+135) tmp = (z / a) * -y; elseif (z <= 9.8e+226) tmp = x + y; else tmp = z * (-y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e+135], N[(N[(z / a), $MachinePrecision] * (-y)), $MachinePrecision], If[LessEqual[z, 9.8e+226], N[(x + y), $MachinePrecision], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+135}:\\
\;\;\;\;\frac{z}{a} \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+226}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\end{array}
\end{array}
if z < -1.1e135Initial program 73.7%
Taylor expanded in t around 0 46.1%
+-commutative46.1%
associate-/l*65.1%
Simplified65.1%
Taylor expanded in z around inf 34.0%
associate-*r/34.0%
neg-mul-134.0%
distribute-rgt-neg-in34.0%
associate-*r/47.0%
Simplified47.0%
if -1.1e135 < z < 9.8000000000000009e226Initial program 79.2%
Taylor expanded in a around inf 71.7%
+-commutative71.7%
Simplified71.7%
if 9.8000000000000009e226 < z Initial program 70.0%
sub-neg70.0%
+-commutative70.0%
distribute-frac-neg70.0%
distribute-rgt-neg-out70.0%
associate-/l*99.8%
fma-define99.7%
distribute-frac-neg99.7%
distribute-neg-frac299.7%
sub-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
+-commutative99.7%
sub-neg99.7%
Simplified99.7%
Taylor expanded in z around inf 63.9%
Taylor expanded in t around 0 45.5%
associate-*r/45.5%
associate-*r*45.5%
neg-mul-145.5%
*-commutative45.5%
Simplified45.5%
frac-2neg45.5%
distribute-frac-neg45.5%
add-sqr-sqrt13.5%
sqrt-unprod20.6%
sqr-neg20.6%
sqrt-unprod6.8%
add-sqr-sqrt8.2%
*-commutative8.2%
distribute-frac-neg28.2%
distribute-frac-neg8.2%
*-commutative8.2%
distribute-rgt-neg-out8.2%
associate-/l*8.1%
add-sqr-sqrt1.2%
sqrt-unprod27.3%
sqr-neg27.3%
sqrt-unprod32.5%
add-sqr-sqrt46.8%
Applied egg-rr46.8%
Final simplification67.0%
(FPCore (x y z t a) :precision binary64 (if (<= y 3.1e+139) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 3.1e+139) {
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 <= 3.1d+139) 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 <= 3.1e+139) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 3.1e+139: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 3.1e+139) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 3.1e+139) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 3.1e+139], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{+139}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 3.1e139Initial program 80.1%
Taylor expanded in x around inf 59.0%
if 3.1e139 < y Initial program 64.2%
Taylor expanded in x around 0 64.2%
sub-neg64.2%
*-rgt-identity64.2%
associate-*r/76.5%
distribute-rgt-neg-in76.5%
mul-1-neg76.5%
distribute-lft-in76.2%
mul-1-neg76.2%
unsub-neg76.2%
Simplified76.2%
Taylor expanded in t around 0 57.9%
Taylor expanded in z around 0 33.8%
Final simplification55.4%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + y;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 77.9%
Taylor expanded in a around inf 63.6%
+-commutative63.6%
Simplified63.6%
Final simplification63.6%
(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 77.9%
Taylor expanded in x around inf 52.2%
Final simplification52.2%
(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 2024059
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:alt
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))