
(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 13 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 (- t z)) (- a t)))))
(if (<= t_1 -2e-271)
(fma (/ (- t z) (- a t)) y (+ x y))
(if (<= t_1 0.0)
(+ x (/ (- (* y z) (* y a)) t))
(if (<= t_1 1.5e+172) t_1 (+ (+ x y) (/ (- t z) (/ (- a t) y))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if (t_1 <= -2e-271) {
tmp = fma(((t - z) / (a - t)), y, (x + y));
} else if (t_1 <= 0.0) {
tmp = x + (((y * z) - (y * a)) / t);
} else if (t_1 <= 1.5e+172) {
tmp = t_1;
} else {
tmp = (x + y) + ((t - z) / ((a - t) / y));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if (t_1 <= -2e-271) tmp = fma(Float64(Float64(t - z) / Float64(a - t)), y, Float64(x + y)); elseif (t_1 <= 0.0) tmp = Float64(x + Float64(Float64(Float64(y * z) - Float64(y * a)) / t)); elseif (t_1 <= 1.5e+172) tmp = t_1; else tmp = Float64(Float64(x + y) + Float64(Float64(t - z) / Float64(Float64(a - t) / y))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-271], N[(N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y + N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(x + N[(N[(N[(y * z), $MachinePrecision] - N[(y * a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.5e+172], t$95$1, N[(N[(x + y), $MachinePrecision] + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-271}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{a - t}, y, x + y\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;x + \frac{y \cdot z - y \cdot a}{t}\\
\mathbf{elif}\;t\_1 \leq 1.5 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \frac{t - z}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1.99999999999999993e-271Initial program 87.5%
sub-neg87.5%
distribute-frac-neg87.5%
distribute-rgt-neg-out87.5%
+-commutative87.5%
associate-*l/90.0%
distribute-rgt-neg-in90.0%
distribute-lft-neg-in90.0%
distribute-frac-neg90.0%
fma-def90.0%
sub-neg90.0%
distribute-neg-in90.0%
remove-double-neg90.0%
+-commutative90.0%
sub-neg90.0%
Simplified90.0%
if -1.99999999999999993e-271 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 4.9%
associate-*l/4.9%
Simplified4.9%
Taylor expanded in t around -inf 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
Simplified100.0%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.5e172Initial program 99.5%
if 1.5e172 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 70.8%
associate-*l/82.3%
Simplified82.3%
associate-/r/87.2%
Applied egg-rr87.2%
Final simplification92.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (- t z) (- a t))))
(t_2 (+ (+ x y) (/ (* y (- t z)) (- a t)))))
(if (<= t_2 -2e-271)
(+ (+ x y) t_1)
(if (<= t_2 0.0)
(+ x (/ (- (* y z) (* y a)) t))
(if (<= t_2 2e+304) t_2 (+ y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((t - z) / (a - t));
double t_2 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if (t_2 <= -2e-271) {
tmp = (x + y) + t_1;
} else if (t_2 <= 0.0) {
tmp = x + (((y * z) - (y * a)) / t);
} else if (t_2 <= 2e+304) {
tmp = t_2;
} else {
tmp = 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) :: t_2
real(8) :: tmp
t_1 = y * ((t - z) / (a - t))
t_2 = (x + y) + ((y * (t - z)) / (a - t))
if (t_2 <= (-2d-271)) then
tmp = (x + y) + t_1
else if (t_2 <= 0.0d0) then
tmp = x + (((y * z) - (y * a)) / t)
else if (t_2 <= 2d+304) then
tmp = t_2
else
tmp = 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 = y * ((t - z) / (a - t));
double t_2 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if (t_2 <= -2e-271) {
tmp = (x + y) + t_1;
} else if (t_2 <= 0.0) {
tmp = x + (((y * z) - (y * a)) / t);
} else if (t_2 <= 2e+304) {
tmp = t_2;
} else {
tmp = y + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((t - z) / (a - t)) t_2 = (x + y) + ((y * (t - z)) / (a - t)) tmp = 0 if t_2 <= -2e-271: tmp = (x + y) + t_1 elif t_2 <= 0.0: tmp = x + (((y * z) - (y * a)) / t) elif t_2 <= 2e+304: tmp = t_2 else: tmp = y + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(t - z) / Float64(a - t))) t_2 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -2e-271) tmp = Float64(Float64(x + y) + t_1); elseif (t_2 <= 0.0) tmp = Float64(x + Float64(Float64(Float64(y * z) - Float64(y * a)) / t)); elseif (t_2 <= 2e+304) tmp = t_2; else tmp = Float64(y + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((t - z) / (a - t)); t_2 = (x + y) + ((y * (t - z)) / (a - t)); tmp = 0.0; if (t_2 <= -2e-271) tmp = (x + y) + t_1; elseif (t_2 <= 0.0) tmp = x + (((y * z) - (y * a)) / t); elseif (t_2 <= 2e+304) tmp = t_2; else tmp = y + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-271], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(x + N[(N[(N[(y * z), $MachinePrecision] - N[(y * a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+304], t$95$2, N[(y + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{t - z}{a - t}\\
t_2 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-271}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;x + \frac{y \cdot z - y \cdot a}{t}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1.99999999999999993e-271Initial program 87.5%
associate-*l/90.0%
Simplified90.0%
if -1.99999999999999993e-271 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 4.9%
associate-*l/4.9%
Simplified4.9%
Taylor expanded in t around -inf 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
Simplified100.0%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.9999999999999999e304Initial program 99.5%
if 1.9999999999999999e304 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 35.2%
associate-*l/72.0%
Simplified72.0%
associate-/r/72.0%
Applied egg-rr72.0%
Taylor expanded in x around 0 35.2%
associate-*r/72.0%
Simplified72.0%
Final simplification92.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (+ x y) (/ (* y (- t z)) (- a t)))))
(if (<= t_1 -2e-271)
(+ (+ x y) (* y (/ (- t z) (- a t))))
(if (<= t_1 0.0)
(+ x (/ (- (* y z) (* y a)) t))
(if (<= t_1 1.5e+172) t_1 (+ (+ x y) (/ (- t z) (/ (- a t) y))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if (t_1 <= -2e-271) {
tmp = (x + y) + (y * ((t - z) / (a - t)));
} else if (t_1 <= 0.0) {
tmp = x + (((y * z) - (y * a)) / t);
} else if (t_1 <= 1.5e+172) {
tmp = t_1;
} else {
tmp = (x + y) + ((t - z) / ((a - t) / 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 = (x + y) + ((y * (t - z)) / (a - t))
if (t_1 <= (-2d-271)) then
tmp = (x + y) + (y * ((t - z) / (a - t)))
else if (t_1 <= 0.0d0) then
tmp = x + (((y * z) - (y * a)) / t)
else if (t_1 <= 1.5d+172) then
tmp = t_1
else
tmp = (x + y) + ((t - z) / ((a - t) / y))
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 * (t - z)) / (a - t));
double tmp;
if (t_1 <= -2e-271) {
tmp = (x + y) + (y * ((t - z) / (a - t)));
} else if (t_1 <= 0.0) {
tmp = x + (((y * z) - (y * a)) / t);
} else if (t_1 <= 1.5e+172) {
tmp = t_1;
} else {
tmp = (x + y) + ((t - z) / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) + ((y * (t - z)) / (a - t)) tmp = 0 if t_1 <= -2e-271: tmp = (x + y) + (y * ((t - z) / (a - t))) elif t_1 <= 0.0: tmp = x + (((y * z) - (y * a)) / t) elif t_1 <= 1.5e+172: tmp = t_1 else: tmp = (x + y) + ((t - z) / ((a - t) / y)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if (t_1 <= -2e-271) tmp = Float64(Float64(x + y) + Float64(y * Float64(Float64(t - z) / Float64(a - t)))); elseif (t_1 <= 0.0) tmp = Float64(x + Float64(Float64(Float64(y * z) - Float64(y * a)) / t)); elseif (t_1 <= 1.5e+172) tmp = t_1; else tmp = Float64(Float64(x + y) + Float64(Float64(t - z) / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) + ((y * (t - z)) / (a - t)); tmp = 0.0; if (t_1 <= -2e-271) tmp = (x + y) + (y * ((t - z) / (a - t))); elseif (t_1 <= 0.0) tmp = x + (((y * z) - (y * a)) / t); elseif (t_1 <= 1.5e+172) tmp = t_1; else tmp = (x + y) + ((t - z) / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-271], N[(N[(x + y), $MachinePrecision] + N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(x + N[(N[(N[(y * z), $MachinePrecision] - N[(y * a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.5e+172], t$95$1, N[(N[(x + y), $MachinePrecision] + N[(N[(t - z), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-271}:\\
\;\;\;\;\left(x + y\right) + y \cdot \frac{t - z}{a - t}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;x + \frac{y \cdot z - y \cdot a}{t}\\
\mathbf{elif}\;t\_1 \leq 1.5 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \frac{t - z}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -1.99999999999999993e-271Initial program 87.5%
associate-*l/90.0%
Simplified90.0%
if -1.99999999999999993e-271 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 0.0Initial program 4.9%
associate-*l/4.9%
Simplified4.9%
Taylor expanded in t around -inf 100.0%
mul-1-neg100.0%
unsub-neg100.0%
*-commutative100.0%
Simplified100.0%
if 0.0 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.5e172Initial program 99.5%
if 1.5e172 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 70.8%
associate-*l/82.3%
Simplified82.3%
associate-/r/87.2%
Applied egg-rr87.2%
Final simplification92.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.05e+21)
(+ x y)
(if (<= a 3e-190)
(+ x (/ y (/ t z)))
(if (<= a 8.5e-125)
(- x (/ a (/ t y)))
(if (or (<= a 8.2e-15) (not (<= a 2.5e+47)))
(+ x y)
(* y (- 1.0 (/ z a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.05e+21) {
tmp = x + y;
} else if (a <= 3e-190) {
tmp = x + (y / (t / z));
} else if (a <= 8.5e-125) {
tmp = x - (a / (t / y));
} else if ((a <= 8.2e-15) || !(a <= 2.5e+47)) {
tmp = x + y;
} else {
tmp = y * (1.0 - (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 <= (-2.05d+21)) then
tmp = x + y
else if (a <= 3d-190) then
tmp = x + (y / (t / z))
else if (a <= 8.5d-125) then
tmp = x - (a / (t / y))
else if ((a <= 8.2d-15) .or. (.not. (a <= 2.5d+47))) then
tmp = x + y
else
tmp = y * (1.0d0 - (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 <= -2.05e+21) {
tmp = x + y;
} else if (a <= 3e-190) {
tmp = x + (y / (t / z));
} else if (a <= 8.5e-125) {
tmp = x - (a / (t / y));
} else if ((a <= 8.2e-15) || !(a <= 2.5e+47)) {
tmp = x + y;
} else {
tmp = y * (1.0 - (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.05e+21: tmp = x + y elif a <= 3e-190: tmp = x + (y / (t / z)) elif a <= 8.5e-125: tmp = x - (a / (t / y)) elif (a <= 8.2e-15) or not (a <= 2.5e+47): tmp = x + y else: tmp = y * (1.0 - (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.05e+21) tmp = Float64(x + y); elseif (a <= 3e-190) tmp = Float64(x + Float64(y / Float64(t / z))); elseif (a <= 8.5e-125) tmp = Float64(x - Float64(a / Float64(t / y))); elseif ((a <= 8.2e-15) || !(a <= 2.5e+47)) tmp = Float64(x + y); else tmp = Float64(y * Float64(1.0 - Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.05e+21) tmp = x + y; elseif (a <= 3e-190) tmp = x + (y / (t / z)); elseif (a <= 8.5e-125) tmp = x - (a / (t / y)); elseif ((a <= 8.2e-15) || ~((a <= 2.5e+47))) tmp = x + y; else tmp = y * (1.0 - (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.05e+21], N[(x + y), $MachinePrecision], If[LessEqual[a, 3e-190], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.5e-125], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 8.2e-15], N[Not[LessEqual[a, 2.5e+47]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.05 \cdot 10^{+21}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-190}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{-125}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{-15} \lor \neg \left(a \leq 2.5 \cdot 10^{+47}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{a}\right)\\
\end{array}
\end{array}
if a < -2.05e21 or 8.5000000000000002e-125 < a < 8.20000000000000072e-15 or 2.50000000000000011e47 < a Initial program 85.4%
associate-*l/92.3%
Simplified92.3%
Taylor expanded in a around inf 80.1%
+-commutative80.1%
Simplified80.1%
if -2.05e21 < a < 2.9999999999999998e-190Initial program 74.6%
sub-neg74.6%
distribute-frac-neg74.6%
distribute-rgt-neg-out74.6%
+-commutative74.6%
associate-*l/72.9%
distribute-rgt-neg-in72.9%
distribute-lft-neg-in72.9%
distribute-frac-neg72.9%
fma-def72.9%
sub-neg72.9%
distribute-neg-in72.9%
remove-double-neg72.9%
+-commutative72.9%
sub-neg72.9%
Simplified72.9%
Taylor expanded in t around inf 74.2%
associate-+r+82.6%
distribute-rgt1-in82.6%
metadata-eval82.6%
mul0-lft82.6%
associate-/l*85.4%
Simplified85.4%
Taylor expanded in z around inf 81.2%
if 2.9999999999999998e-190 < a < 8.5000000000000002e-125Initial program 75.8%
sub-neg75.8%
distribute-frac-neg75.8%
distribute-rgt-neg-out75.8%
+-commutative75.8%
associate-*l/59.8%
distribute-rgt-neg-in59.8%
distribute-lft-neg-in59.8%
distribute-frac-neg59.8%
fma-def59.8%
sub-neg59.8%
distribute-neg-in59.8%
remove-double-neg59.8%
+-commutative59.8%
sub-neg59.8%
Simplified59.8%
Taylor expanded in t around inf 39.4%
associate-+r+52.1%
distribute-rgt1-in52.1%
metadata-eval52.1%
mul0-lft52.1%
associate-/l*36.4%
Simplified36.4%
clear-num36.5%
inv-pow36.5%
Applied egg-rr36.5%
Taylor expanded in z around 0 64.6%
mul-1-neg64.6%
unsub-neg64.6%
associate-/l*71.8%
Simplified71.8%
if 8.20000000000000072e-15 < a < 2.50000000000000011e47Initial program 74.0%
associate-*l/86.8%
Simplified86.8%
Taylor expanded in t around 0 74.6%
Taylor expanded in y around inf 59.1%
Final simplification78.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.05e+21)
(- (+ x y) (* y (/ z a)))
(if (<= a -1.6e-267)
(+ x (* (- z a) (/ y t)))
(if (<= a 3e-190)
(+ x (/ y (/ t z)))
(if (<= a 1.2e-73) (- x (/ a (/ t y))) (- (+ x y) (/ y (/ a z))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.05e+21) {
tmp = (x + y) - (y * (z / a));
} else if (a <= -1.6e-267) {
tmp = x + ((z - a) * (y / t));
} else if (a <= 3e-190) {
tmp = x + (y / (t / z));
} else if (a <= 1.2e-73) {
tmp = x - (a / (t / y));
} else {
tmp = (x + y) - (y / (a / 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.05d+21)) then
tmp = (x + y) - (y * (z / a))
else if (a <= (-1.6d-267)) then
tmp = x + ((z - a) * (y / t))
else if (a <= 3d-190) then
tmp = x + (y / (t / z))
else if (a <= 1.2d-73) then
tmp = x - (a / (t / y))
else
tmp = (x + y) - (y / (a / 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.05e+21) {
tmp = (x + y) - (y * (z / a));
} else if (a <= -1.6e-267) {
tmp = x + ((z - a) * (y / t));
} else if (a <= 3e-190) {
tmp = x + (y / (t / z));
} else if (a <= 1.2e-73) {
tmp = x - (a / (t / y));
} else {
tmp = (x + y) - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.05e+21: tmp = (x + y) - (y * (z / a)) elif a <= -1.6e-267: tmp = x + ((z - a) * (y / t)) elif a <= 3e-190: tmp = x + (y / (t / z)) elif a <= 1.2e-73: tmp = x - (a / (t / y)) else: tmp = (x + y) - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.05e+21) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); elseif (a <= -1.6e-267) tmp = Float64(x + Float64(Float64(z - a) * Float64(y / t))); elseif (a <= 3e-190) tmp = Float64(x + Float64(y / Float64(t / z))); elseif (a <= 1.2e-73) tmp = Float64(x - Float64(a / Float64(t / y))); else tmp = Float64(Float64(x + y) - Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.05e+21) tmp = (x + y) - (y * (z / a)); elseif (a <= -1.6e-267) tmp = x + ((z - a) * (y / t)); elseif (a <= 3e-190) tmp = x + (y / (t / z)); elseif (a <= 1.2e-73) tmp = x - (a / (t / y)); else tmp = (x + y) - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.05e+21], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.6e-267], N[(x + N[(N[(z - a), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3e-190], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e-73], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.05 \cdot 10^{+21}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq -1.6 \cdot 10^{-267}:\\
\;\;\;\;x + \left(z - a\right) \cdot \frac{y}{t}\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-190}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{-73}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if a < -2.05e21Initial program 91.2%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in t around 0 92.8%
if -2.05e21 < a < -1.59999999999999993e-267Initial program 75.0%
sub-neg75.0%
distribute-frac-neg75.0%
distribute-rgt-neg-out75.0%
+-commutative75.0%
associate-*l/73.1%
distribute-rgt-neg-in73.1%
distribute-lft-neg-in73.1%
distribute-frac-neg73.1%
fma-def73.0%
sub-neg73.0%
distribute-neg-in73.0%
remove-double-neg73.0%
+-commutative73.0%
sub-neg73.0%
Simplified73.0%
Taylor expanded in t around inf 71.2%
associate-+r+77.8%
distribute-rgt1-in77.8%
metadata-eval77.8%
mul0-lft77.8%
associate-/l*80.6%
Simplified80.6%
associate-/r/83.5%
Applied egg-rr83.5%
if -1.59999999999999993e-267 < a < 2.9999999999999998e-190Initial program 73.8%
sub-neg73.8%
distribute-frac-neg73.8%
distribute-rgt-neg-out73.8%
+-commutative73.8%
associate-*l/72.5%
distribute-rgt-neg-in72.5%
distribute-lft-neg-in72.5%
distribute-frac-neg72.5%
fma-def72.5%
sub-neg72.5%
distribute-neg-in72.5%
remove-double-neg72.5%
+-commutative72.5%
sub-neg72.5%
Simplified72.5%
Taylor expanded in t around inf 79.7%
associate-+r+91.4%
distribute-rgt1-in91.4%
metadata-eval91.4%
mul0-lft91.4%
associate-/l*94.1%
Simplified94.1%
Taylor expanded in z around inf 94.1%
if 2.9999999999999998e-190 < a < 1.20000000000000003e-73Initial program 69.5%
sub-neg69.5%
distribute-frac-neg69.5%
distribute-rgt-neg-out69.5%
+-commutative69.5%
associate-*l/64.9%
distribute-rgt-neg-in64.9%
distribute-lft-neg-in64.9%
distribute-frac-neg64.9%
fma-def64.9%
sub-neg64.9%
distribute-neg-in64.9%
remove-double-neg64.9%
+-commutative64.9%
sub-neg64.9%
Simplified64.9%
Taylor expanded in t around inf 45.4%
associate-+r+61.1%
distribute-rgt1-in61.1%
metadata-eval61.1%
mul0-lft61.1%
associate-/l*56.7%
Simplified56.7%
clear-num56.7%
inv-pow56.7%
Applied egg-rr56.7%
Taylor expanded in z around 0 63.0%
mul-1-neg63.0%
unsub-neg63.0%
associate-/l*67.0%
Simplified67.0%
if 1.20000000000000003e-73 < a Initial program 82.3%
associate-*l/91.2%
Simplified91.2%
Taylor expanded in t around 0 82.5%
associate-/l*87.8%
Simplified87.8%
Final simplification86.8%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2e+21)
(- (+ x y) (* y (/ z a)))
(if (<= a 3e-190)
(+ x (/ y (/ t (- z a))))
(if (<= a 3.3e-125)
(- x (/ a (/ t y)))
(if (<= a 1.2e-73)
(+ x (* (- z a) (/ y t)))
(- (+ x y) (/ y (/ a z))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2e+21) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 3e-190) {
tmp = x + (y / (t / (z - a)));
} else if (a <= 3.3e-125) {
tmp = x - (a / (t / y));
} else if (a <= 1.2e-73) {
tmp = x + ((z - a) * (y / t));
} else {
tmp = (x + y) - (y / (a / 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 <= (-2d+21)) then
tmp = (x + y) - (y * (z / a))
else if (a <= 3d-190) then
tmp = x + (y / (t / (z - a)))
else if (a <= 3.3d-125) then
tmp = x - (a / (t / y))
else if (a <= 1.2d-73) then
tmp = x + ((z - a) * (y / t))
else
tmp = (x + y) - (y / (a / 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 <= -2e+21) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 3e-190) {
tmp = x + (y / (t / (z - a)));
} else if (a <= 3.3e-125) {
tmp = x - (a / (t / y));
} else if (a <= 1.2e-73) {
tmp = x + ((z - a) * (y / t));
} else {
tmp = (x + y) - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2e+21: tmp = (x + y) - (y * (z / a)) elif a <= 3e-190: tmp = x + (y / (t / (z - a))) elif a <= 3.3e-125: tmp = x - (a / (t / y)) elif a <= 1.2e-73: tmp = x + ((z - a) * (y / t)) else: tmp = (x + y) - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2e+21) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); elseif (a <= 3e-190) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); elseif (a <= 3.3e-125) tmp = Float64(x - Float64(a / Float64(t / y))); elseif (a <= 1.2e-73) tmp = Float64(x + Float64(Float64(z - a) * Float64(y / t))); else tmp = Float64(Float64(x + y) - Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2e+21) tmp = (x + y) - (y * (z / a)); elseif (a <= 3e-190) tmp = x + (y / (t / (z - a))); elseif (a <= 3.3e-125) tmp = x - (a / (t / y)); elseif (a <= 1.2e-73) tmp = x + ((z - a) * (y / t)); else tmp = (x + y) - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2e+21], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3e-190], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.3e-125], N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e-73], N[(x + N[(N[(z - a), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+21}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 3 \cdot 10^{-190}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{-125}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{-73}:\\
\;\;\;\;x + \left(z - a\right) \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if a < -2e21Initial program 91.2%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in t around 0 92.8%
if -2e21 < a < 2.9999999999999998e-190Initial program 74.6%
sub-neg74.6%
distribute-frac-neg74.6%
distribute-rgt-neg-out74.6%
+-commutative74.6%
associate-*l/72.9%
distribute-rgt-neg-in72.9%
distribute-lft-neg-in72.9%
distribute-frac-neg72.9%
fma-def72.9%
sub-neg72.9%
distribute-neg-in72.9%
remove-double-neg72.9%
+-commutative72.9%
sub-neg72.9%
Simplified72.9%
Taylor expanded in t around inf 74.2%
associate-+r+82.6%
distribute-rgt1-in82.6%
metadata-eval82.6%
mul0-lft82.6%
associate-/l*85.4%
Simplified85.4%
if 2.9999999999999998e-190 < a < 3.3000000000000001e-125Initial program 75.8%
sub-neg75.8%
distribute-frac-neg75.8%
distribute-rgt-neg-out75.8%
+-commutative75.8%
associate-*l/59.8%
distribute-rgt-neg-in59.8%
distribute-lft-neg-in59.8%
distribute-frac-neg59.8%
fma-def59.8%
sub-neg59.8%
distribute-neg-in59.8%
remove-double-neg59.8%
+-commutative59.8%
sub-neg59.8%
Simplified59.8%
Taylor expanded in t around inf 39.4%
associate-+r+52.1%
distribute-rgt1-in52.1%
metadata-eval52.1%
mul0-lft52.1%
associate-/l*36.4%
Simplified36.4%
clear-num36.5%
inv-pow36.5%
Applied egg-rr36.5%
Taylor expanded in z around 0 64.6%
mul-1-neg64.6%
unsub-neg64.6%
associate-/l*71.8%
Simplified71.8%
if 3.3000000000000001e-125 < a < 1.20000000000000003e-73Initial program 62.0%
sub-neg62.0%
distribute-frac-neg62.0%
distribute-rgt-neg-out62.0%
+-commutative62.0%
associate-*l/71.1%
distribute-rgt-neg-in71.1%
distribute-lft-neg-in71.1%
distribute-frac-neg71.1%
fma-def71.1%
sub-neg71.1%
distribute-neg-in71.1%
remove-double-neg71.1%
+-commutative71.1%
sub-neg71.1%
Simplified71.1%
Taylor expanded in t around inf 52.5%
associate-+r+71.9%
distribute-rgt1-in71.9%
metadata-eval71.9%
mul0-lft71.9%
associate-/l*81.0%
Simplified81.0%
associate-/r/81.0%
Applied egg-rr81.0%
if 1.20000000000000003e-73 < a Initial program 82.3%
associate-*l/91.2%
Simplified91.2%
Taylor expanded in t around 0 82.5%
associate-/l*87.8%
Simplified87.8%
Final simplification86.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.2e+175)
(+ x (/ y (/ t (- z a))))
(if (<= t 1.25e+194)
(+ (+ x y) (* y (/ (- t z) (- a t))))
(+ x (/ y (/ t z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.2e+175) {
tmp = x + (y / (t / (z - a)));
} else if (t <= 1.25e+194) {
tmp = (x + y) + (y * ((t - z) / (a - t)));
} else {
tmp = x + (y / (t / 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 (t <= (-4.2d+175)) then
tmp = x + (y / (t / (z - a)))
else if (t <= 1.25d+194) then
tmp = (x + y) + (y * ((t - z) / (a - t)))
else
tmp = x + (y / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.2e+175) {
tmp = x + (y / (t / (z - a)));
} else if (t <= 1.25e+194) {
tmp = (x + y) + (y * ((t - z) / (a - t)));
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.2e+175: tmp = x + (y / (t / (z - a))) elif t <= 1.25e+194: tmp = (x + y) + (y * ((t - z) / (a - t))) else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.2e+175) tmp = Float64(x + Float64(y / Float64(t / Float64(z - a)))); elseif (t <= 1.25e+194) tmp = Float64(Float64(x + y) + Float64(y * Float64(Float64(t - z) / Float64(a - t)))); else tmp = Float64(x + Float64(y / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.2e+175) tmp = x + (y / (t / (z - a))); elseif (t <= 1.25e+194) tmp = (x + y) + (y * ((t - z) / (a - t))); else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.2e+175], N[(x + N[(y / N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e+194], N[(N[(x + y), $MachinePrecision] + N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+175}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+194}:\\
\;\;\;\;\left(x + y\right) + y \cdot \frac{t - z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if t < -4.1999999999999998e175Initial program 32.0%
sub-neg32.0%
distribute-frac-neg32.0%
distribute-rgt-neg-out32.0%
+-commutative32.0%
associate-*l/39.9%
distribute-rgt-neg-in39.9%
distribute-lft-neg-in39.9%
distribute-frac-neg39.9%
fma-def39.9%
sub-neg39.9%
distribute-neg-in39.9%
remove-double-neg39.9%
+-commutative39.9%
sub-neg39.9%
Simplified39.9%
Taylor expanded in t around inf 70.4%
associate-+r+85.8%
distribute-rgt1-in85.8%
metadata-eval85.8%
mul0-lft85.8%
associate-/l*95.0%
Simplified95.0%
if -4.1999999999999998e175 < t < 1.24999999999999997e194Initial program 88.1%
associate-*l/90.3%
Simplified90.3%
if 1.24999999999999997e194 < t Initial program 63.4%
sub-neg63.4%
distribute-frac-neg63.4%
distribute-rgt-neg-out63.4%
+-commutative63.4%
associate-*l/66.6%
distribute-rgt-neg-in66.6%
distribute-lft-neg-in66.6%
distribute-frac-neg66.6%
fma-def66.4%
sub-neg66.4%
distribute-neg-in66.4%
remove-double-neg66.4%
+-commutative66.4%
sub-neg66.4%
Simplified66.4%
Taylor expanded in t around inf 84.6%
associate-+r+91.4%
distribute-rgt1-in91.4%
metadata-eval91.4%
mul0-lft91.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.2e-62) (not (<= a 1.25e-73))) (- (+ x y) (* y (/ z a))) (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.2e-62) || !(a <= 1.25e-73)) {
tmp = (x + y) - (y * (z / a));
} 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-62)) .or. (.not. (a <= 1.25d-73))) then
tmp = (x + y) - (y * (z / a))
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-62) || !(a <= 1.25e-73)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6.2e-62) or not (a <= 1.25e-73): tmp = (x + y) - (y * (z / a)) else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6.2e-62) || !(a <= 1.25e-73)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -6.2e-62) || ~((a <= 1.25e-73))) tmp = (x + y) - (y * (z / a)); else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.2e-62], N[Not[LessEqual[a, 1.25e-73]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{-62} \lor \neg \left(a \leq 1.25 \cdot 10^{-73}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if a < -6.1999999999999999e-62 or 1.25e-73 < a Initial program 83.1%
associate-*l/90.5%
Simplified90.5%
Taylor expanded in t around 0 86.1%
if -6.1999999999999999e-62 < a < 1.25e-73Initial program 75.6%
sub-neg75.6%
distribute-frac-neg75.6%
distribute-rgt-neg-out75.6%
+-commutative75.6%
associate-*l/71.5%
distribute-rgt-neg-in71.5%
distribute-lft-neg-in71.5%
distribute-frac-neg71.5%
fma-def71.5%
sub-neg71.5%
distribute-neg-in71.5%
remove-double-neg71.5%
+-commutative71.5%
sub-neg71.5%
Simplified71.5%
Taylor expanded in t around inf 72.8%
associate-+r+82.3%
distribute-rgt1-in82.3%
metadata-eval82.3%
mul0-lft82.3%
associate-/l*82.2%
Simplified82.2%
Taylor expanded in a around 0 78.9%
Final simplification83.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -3e-68) (- (+ x y) (* y (/ z a))) (if (<= a 1.25e-73) (+ x (/ (* y z) t)) (- (+ x y) (/ y (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3e-68) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 1.25e-73) {
tmp = x + ((y * z) / t);
} else {
tmp = (x + y) - (y / (a / 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 <= (-3d-68)) then
tmp = (x + y) - (y * (z / a))
else if (a <= 1.25d-73) then
tmp = x + ((y * z) / t)
else
tmp = (x + y) - (y / (a / 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 <= -3e-68) {
tmp = (x + y) - (y * (z / a));
} else if (a <= 1.25e-73) {
tmp = x + ((y * z) / t);
} else {
tmp = (x + y) - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3e-68: tmp = (x + y) - (y * (z / a)) elif a <= 1.25e-73: tmp = x + ((y * z) / t) else: tmp = (x + y) - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3e-68) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); elseif (a <= 1.25e-73) tmp = Float64(x + Float64(Float64(y * z) / t)); else tmp = Float64(Float64(x + y) - Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3e-68) tmp = (x + y) - (y * (z / a)); elseif (a <= 1.25e-73) tmp = x + ((y * z) / t); else tmp = (x + y) - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3e-68], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.25e-73], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{-68}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-73}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if a < -3e-68Initial program 83.9%
associate-*l/89.9%
Simplified89.9%
Taylor expanded in t around 0 84.2%
if -3e-68 < a < 1.25e-73Initial program 75.6%
sub-neg75.6%
distribute-frac-neg75.6%
distribute-rgt-neg-out75.6%
+-commutative75.6%
associate-*l/71.5%
distribute-rgt-neg-in71.5%
distribute-lft-neg-in71.5%
distribute-frac-neg71.5%
fma-def71.5%
sub-neg71.5%
distribute-neg-in71.5%
remove-double-neg71.5%
+-commutative71.5%
sub-neg71.5%
Simplified71.5%
Taylor expanded in t around inf 72.8%
associate-+r+82.3%
distribute-rgt1-in82.3%
metadata-eval82.3%
mul0-lft82.3%
associate-/l*82.2%
Simplified82.2%
Taylor expanded in a around 0 78.9%
if 1.25e-73 < a Initial program 82.3%
associate-*l/91.2%
Simplified91.2%
Taylor expanded in t around 0 82.5%
associate-/l*87.8%
Simplified87.8%
Final simplification83.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2e+21) (not (<= a 2.8e-170))) (+ x y) (+ x (* z (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2e+21) || !(a <= 2.8e-170)) {
tmp = x + y;
} else {
tmp = x + (z * (y / 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 <= (-2d+21)) .or. (.not. (a <= 2.8d-170))) then
tmp = x + y
else
tmp = x + (z * (y / 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 <= -2e+21) || !(a <= 2.8e-170)) {
tmp = x + y;
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2e+21) or not (a <= 2.8e-170): tmp = x + y else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2e+21) || !(a <= 2.8e-170)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2e+21) || ~((a <= 2.8e-170))) tmp = x + y; else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2e+21], N[Not[LessEqual[a, 2.8e-170]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+21} \lor \neg \left(a \leq 2.8 \cdot 10^{-170}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if a < -2e21 or 2.79999999999999995e-170 < a Initial program 83.7%
associate-*l/90.2%
Simplified90.2%
Taylor expanded in a around inf 75.2%
+-commutative75.2%
Simplified75.2%
if -2e21 < a < 2.79999999999999995e-170Initial program 74.7%
sub-neg74.7%
distribute-frac-neg74.7%
distribute-rgt-neg-out74.7%
+-commutative74.7%
associate-*l/72.1%
distribute-rgt-neg-in72.1%
distribute-lft-neg-in72.1%
distribute-frac-neg72.1%
fma-def72.1%
sub-neg72.1%
distribute-neg-in72.1%
remove-double-neg72.1%
+-commutative72.1%
sub-neg72.1%
Simplified72.1%
Taylor expanded in t around inf 73.4%
associate-+r+81.5%
distribute-rgt1-in81.5%
metadata-eval81.5%
mul0-lft81.5%
associate-/l*83.3%
Simplified83.3%
Taylor expanded in a around 0 77.5%
associate-*l/76.4%
*-commutative76.4%
Simplified76.4%
Final simplification75.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2e+21) (not (<= a 8.5e-83))) (+ x y) (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2e+21) || !(a <= 8.5e-83)) {
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 <= (-2d+21)) .or. (.not. (a <= 8.5d-83))) 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 <= -2e+21) || !(a <= 8.5e-83)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2e+21) or not (a <= 8.5e-83): tmp = x + y else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2e+21) || !(a <= 8.5e-83)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2e+21) || ~((a <= 8.5e-83))) tmp = x + y; else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2e+21], N[Not[LessEqual[a, 8.5e-83]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+21} \lor \neg \left(a \leq 8.5 \cdot 10^{-83}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if a < -2e21 or 8.49999999999999938e-83 < a Initial program 85.3%
associate-*l/92.7%
Simplified92.7%
Taylor expanded in a around inf 77.6%
+-commutative77.6%
Simplified77.6%
if -2e21 < a < 8.49999999999999938e-83Initial program 74.0%
sub-neg74.0%
distribute-frac-neg74.0%
distribute-rgt-neg-out74.0%
+-commutative74.0%
associate-*l/71.8%
distribute-rgt-neg-in71.8%
distribute-lft-neg-in71.8%
distribute-frac-neg71.8%
fma-def71.7%
sub-neg71.7%
distribute-neg-in71.7%
remove-double-neg71.7%
+-commutative71.7%
sub-neg71.7%
Simplified71.7%
Taylor expanded in t around inf 69.2%
associate-+r+79.2%
distribute-rgt1-in79.2%
metadata-eval79.2%
mul0-lft79.2%
associate-/l*80.7%
Simplified80.7%
Taylor expanded in a around 0 74.4%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.8e+176) x (if (<= t 1.25e+152) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.8e+176) {
tmp = x;
} else if (t <= 1.25e+152) {
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 (t <= (-2.8d+176)) then
tmp = x
else if (t <= 1.25d+152) 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 (t <= -2.8e+176) {
tmp = x;
} else if (t <= 1.25e+152) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.8e+176: tmp = x elif t <= 1.25e+152: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.8e+176) tmp = x; elseif (t <= 1.25e+152) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.8e+176) tmp = x; elseif (t <= 1.25e+152) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.8e+176], x, If[LessEqual[t, 1.25e+152], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+176}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+152}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.8000000000000002e176 or 1.25e152 < t Initial program 47.7%
associate-*l/54.6%
Simplified54.6%
Taylor expanded in x around inf 65.7%
if -2.8000000000000002e176 < t < 1.25e152Initial program 88.7%
associate-*l/90.5%
Simplified90.5%
Taylor expanded in a around inf 66.6%
+-commutative66.6%
Simplified66.6%
Final simplification66.4%
(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 80.1%
associate-*l/82.9%
Simplified82.9%
Taylor expanded in x around inf 49.4%
Final simplification49.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 2024031
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(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))))