
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (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) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (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) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- z t) (- a t)))) (if (<= t_1 5e+54) (+ x (* t_1 y)) (fma (- t z) (/ y (- t a)) x))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double tmp;
if (t_1 <= 5e+54) {
tmp = x + (t_1 * y);
} else {
tmp = fma((t - z), (y / (t - a)), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) tmp = 0.0 if (t_1 <= 5e+54) tmp = Float64(x + Float64(t_1 * y)); else tmp = fma(Float64(t - z), Float64(y / Float64(t - a)), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+54], N[(x + N[(t$95$1 * y), $MachinePrecision]), $MachinePrecision], N[(N[(t - z), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+54}:\\
\;\;\;\;x + t_1 \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - z, \frac{y}{t - a}, x\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < 5.00000000000000005e54Initial program 99.4%
if 5.00000000000000005e54 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 83.7%
+-commutative83.7%
*-commutative83.7%
associate-*l/96.7%
sub-neg96.7%
+-commutative96.7%
neg-sub096.7%
associate-+l-96.7%
sub0-neg96.7%
neg-mul-196.7%
times-frac99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
/-rgt-identity99.9%
Simplified99.9%
Final simplification99.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) a)))))
(if (<= t -2.15e+24)
(+ x y)
(if (<= t -9e-10)
(* (- t z) (/ y (- t a)))
(if (<= t 1e-80)
t_1
(if (<= t 6e-39)
(- x (* z (/ y t)))
(if (<= t 3.1e+103) t_1 (+ x y))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / a));
double tmp;
if (t <= -2.15e+24) {
tmp = x + y;
} else if (t <= -9e-10) {
tmp = (t - z) * (y / (t - a));
} else if (t <= 1e-80) {
tmp = t_1;
} else if (t <= 6e-39) {
tmp = x - (z * (y / t));
} else if (t <= 3.1e+103) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y * ((z - t) / a))
if (t <= (-2.15d+24)) then
tmp = x + y
else if (t <= (-9d-10)) then
tmp = (t - z) * (y / (t - a))
else if (t <= 1d-80) then
tmp = t_1
else if (t <= 6d-39) then
tmp = x - (z * (y / t))
else if (t <= 3.1d+103) then
tmp = t_1
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / a));
double tmp;
if (t <= -2.15e+24) {
tmp = x + y;
} else if (t <= -9e-10) {
tmp = (t - z) * (y / (t - a));
} else if (t <= 1e-80) {
tmp = t_1;
} else if (t <= 6e-39) {
tmp = x - (z * (y / t));
} else if (t <= 3.1e+103) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / a)) tmp = 0 if t <= -2.15e+24: tmp = x + y elif t <= -9e-10: tmp = (t - z) * (y / (t - a)) elif t <= 1e-80: tmp = t_1 elif t <= 6e-39: tmp = x - (z * (y / t)) elif t <= 3.1e+103: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / a))) tmp = 0.0 if (t <= -2.15e+24) tmp = Float64(x + y); elseif (t <= -9e-10) tmp = Float64(Float64(t - z) * Float64(y / Float64(t - a))); elseif (t <= 1e-80) tmp = t_1; elseif (t <= 6e-39) tmp = Float64(x - Float64(z * Float64(y / t))); elseif (t <= 3.1e+103) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / a)); tmp = 0.0; if (t <= -2.15e+24) tmp = x + y; elseif (t <= -9e-10) tmp = (t - z) * (y / (t - a)); elseif (t <= 1e-80) tmp = t_1; elseif (t <= 6e-39) tmp = x - (z * (y / t)); elseif (t <= 3.1e+103) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.15e+24], N[(x + y), $MachinePrecision], If[LessEqual[t, -9e-10], N[(N[(t - z), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-80], t$95$1, If[LessEqual[t, 6e-39], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1e+103], t$95$1, N[(x + y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a}\\
\mathbf{if}\;t \leq -2.15 \cdot 10^{+24}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-10}:\\
\;\;\;\;\left(t - z\right) \cdot \frac{y}{t - a}\\
\mathbf{elif}\;t \leq 10^{-80}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-39}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+103}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.14999999999999994e24 or 3.1000000000000002e103 < t Initial program 100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l/76.7%
sub-neg76.7%
+-commutative76.7%
neg-sub076.7%
associate-+l-76.7%
sub0-neg76.7%
neg-mul-176.7%
times-frac89.3%
fma-def89.3%
sub-neg89.3%
+-commutative89.3%
neg-sub089.3%
associate-+l-89.3%
sub0-neg89.3%
neg-mul-189.3%
*-commutative89.3%
associate-/l*89.3%
metadata-eval89.3%
/-rgt-identity89.3%
Simplified89.3%
Taylor expanded in t around inf 84.7%
if -2.14999999999999994e24 < t < -8.9999999999999999e-10Initial program 99.3%
+-commutative99.3%
*-commutative99.3%
associate-*l/89.5%
sub-neg89.5%
+-commutative89.5%
neg-sub089.5%
associate-+l-89.5%
sub0-neg89.5%
neg-mul-189.5%
times-frac99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
metadata-eval99.7%
/-rgt-identity99.7%
Simplified99.7%
Taylor expanded in y around -inf 89.5%
*-commutative89.5%
associate-*r/99.7%
Simplified99.7%
if -8.9999999999999999e-10 < t < 9.99999999999999961e-81 or 6.00000000000000055e-39 < t < 3.1000000000000002e103Initial program 96.9%
Taylor expanded in a around inf 84.1%
if 9.99999999999999961e-81 < t < 6.00000000000000055e-39Initial program 81.2%
+-commutative81.2%
*-commutative81.2%
associate-*l/99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac100.0%
fma-def100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
Simplified100.0%
Taylor expanded in a around 0 90.0%
+-commutative90.0%
associate-/l*61.9%
Simplified61.9%
Taylor expanded in t around 0 90.0%
associate-*r/90.0%
mul-1-neg90.0%
Simplified90.0%
div-inv90.0%
distribute-lft-neg-in90.0%
associate-*l*71.2%
div-inv71.3%
neg-mul-171.3%
associate-*l*71.3%
metadata-eval71.3%
add-sqr-sqrt50.2%
sqrt-unprod50.9%
sqr-neg50.9%
sqrt-unprod10.1%
add-sqr-sqrt40.7%
div-inv40.7%
associate-*l*40.7%
distribute-lft-neg-in40.7%
div-inv40.7%
cancel-sign-sub-inv40.7%
*-un-lft-identity40.7%
div-inv40.7%
Applied egg-rr90.1%
Final simplification85.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- z t) (- a t)))) (if (<= t_1 2e+245) (+ x (* t_1 y)) (/ (* z (- y)) (- t a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double tmp;
if (t_1 <= 2e+245) {
tmp = x + (t_1 * y);
} else {
tmp = (z * -y) / (t - a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (z - t) / (a - t)
if (t_1 <= 2d+245) then
tmp = x + (t_1 * y)
else
tmp = (z * -y) / (t - a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double tmp;
if (t_1 <= 2e+245) {
tmp = x + (t_1 * y);
} else {
tmp = (z * -y) / (t - a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (a - t) tmp = 0 if t_1 <= 2e+245: tmp = x + (t_1 * y) else: tmp = (z * -y) / (t - a) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) tmp = 0.0 if (t_1 <= 2e+245) tmp = Float64(x + Float64(t_1 * y)); else tmp = Float64(Float64(z * Float64(-y)) / Float64(t - a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (a - t); tmp = 0.0; if (t_1 <= 2e+245) tmp = x + (t_1 * y); else tmp = (z * -y) / (t - a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+245], N[(x + N[(t$95$1 * y), $MachinePrecision]), $MachinePrecision], N[(N[(z * (-y)), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+245}:\\
\;\;\;\;x + t_1 \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(-y\right)}{t - a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < 2.00000000000000009e245Initial program 99.4%
if 2.00000000000000009e245 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 41.7%
+-commutative41.7%
*-commutative41.7%
associate-*l/100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
times-frac99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
metadata-eval99.8%
/-rgt-identity99.8%
Simplified99.8%
Taylor expanded in z around inf 98.7%
associate-*r/98.7%
associate-*r*98.7%
neg-mul-198.7%
Simplified98.7%
Final simplification99.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- z t) (- a t)))) (if (<= t_1 2e+78) (+ x (* t_1 y)) (+ x (/ (* (- z t) y) (- a t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double tmp;
if (t_1 <= 2e+78) {
tmp = x + (t_1 * y);
} else {
tmp = x + (((z - t) * y) / (a - 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 = (z - t) / (a - t)
if (t_1 <= 2d+78) then
tmp = x + (t_1 * y)
else
tmp = x + (((z - t) * y) / (a - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (a - t);
double tmp;
if (t_1 <= 2e+78) {
tmp = x + (t_1 * y);
} else {
tmp = x + (((z - t) * y) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (a - t) tmp = 0 if t_1 <= 2e+78: tmp = x + (t_1 * y) else: tmp = x + (((z - t) * y) / (a - t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(a - t)) tmp = 0.0 if (t_1 <= 2e+78) tmp = Float64(x + Float64(t_1 * y)); else tmp = Float64(x + Float64(Float64(Float64(z - t) * y) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (a - t); tmp = 0.0; if (t_1 <= 2e+78) tmp = x + (t_1 * y); else tmp = x + (((z - t) * y) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+78], N[(x + N[(t$95$1 * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+78}:\\
\;\;\;\;x + t_1 \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a - t}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < 2.00000000000000002e78Initial program 99.3%
if 2.00000000000000002e78 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 81.3%
associate-*r/99.9%
Simplified99.9%
Final simplification99.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) a)))) (t_2 (+ x (/ y (/ t (- t z))))))
(if (<= t -3.6e-44)
t_2
(if (<= t 8.5e-81)
t_1
(if (<= t 2.05e-41)
(- x (* z (/ y t)))
(if (<= t 1.95e+100) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / a));
double t_2 = x + (y / (t / (t - z)));
double tmp;
if (t <= -3.6e-44) {
tmp = t_2;
} else if (t <= 8.5e-81) {
tmp = t_1;
} else if (t <= 2.05e-41) {
tmp = x - (z * (y / t));
} else if (t <= 1.95e+100) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = x + (y * ((z - t) / a))
t_2 = x + (y / (t / (t - z)))
if (t <= (-3.6d-44)) then
tmp = t_2
else if (t <= 8.5d-81) then
tmp = t_1
else if (t <= 2.05d-41) then
tmp = x - (z * (y / t))
else if (t <= 1.95d+100) then
tmp = t_1
else
tmp = t_2
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 * ((z - t) / a));
double t_2 = x + (y / (t / (t - z)));
double tmp;
if (t <= -3.6e-44) {
tmp = t_2;
} else if (t <= 8.5e-81) {
tmp = t_1;
} else if (t <= 2.05e-41) {
tmp = x - (z * (y / t));
} else if (t <= 1.95e+100) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / a)) t_2 = x + (y / (t / (t - z))) tmp = 0 if t <= -3.6e-44: tmp = t_2 elif t <= 8.5e-81: tmp = t_1 elif t <= 2.05e-41: tmp = x - (z * (y / t)) elif t <= 1.95e+100: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / a))) t_2 = Float64(x + Float64(y / Float64(t / Float64(t - z)))) tmp = 0.0 if (t <= -3.6e-44) tmp = t_2; elseif (t <= 8.5e-81) tmp = t_1; elseif (t <= 2.05e-41) tmp = Float64(x - Float64(z * Float64(y / t))); elseif (t <= 1.95e+100) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / a)); t_2 = x + (y / (t / (t - z))); tmp = 0.0; if (t <= -3.6e-44) tmp = t_2; elseif (t <= 8.5e-81) tmp = t_1; elseif (t <= 2.05e-41) tmp = x - (z * (y / t)); elseif (t <= 1.95e+100) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y / N[(t / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.6e-44], t$95$2, If[LessEqual[t, 8.5e-81], t$95$1, If[LessEqual[t, 2.05e-41], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.95e+100], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a}\\
t_2 := x + \frac{y}{\frac{t}{t - z}}\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{-44}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-81}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{-41}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -3.5999999999999999e-44 or 1.95e100 < t Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l/79.5%
sub-neg79.5%
+-commutative79.5%
neg-sub079.5%
associate-+l-79.5%
sub0-neg79.5%
neg-mul-179.5%
times-frac90.1%
fma-def90.1%
sub-neg90.1%
+-commutative90.1%
neg-sub090.1%
associate-+l-90.1%
sub0-neg90.1%
neg-mul-190.1%
*-commutative90.1%
associate-/l*90.1%
metadata-eval90.1%
/-rgt-identity90.1%
Simplified90.1%
Taylor expanded in a around 0 72.1%
+-commutative72.1%
associate-/l*91.8%
Simplified91.8%
if -3.5999999999999999e-44 < t < 8.5000000000000001e-81 or 2.05000000000000007e-41 < t < 1.95e100Initial program 96.7%
Taylor expanded in a around inf 86.1%
if 8.5000000000000001e-81 < t < 2.05000000000000007e-41Initial program 81.2%
+-commutative81.2%
*-commutative81.2%
associate-*l/99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac100.0%
fma-def100.0%
sub-neg100.0%
+-commutative100.0%
neg-sub0100.0%
associate-+l-100.0%
sub0-neg100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
/-rgt-identity100.0%
Simplified100.0%
Taylor expanded in a around 0 90.0%
+-commutative90.0%
associate-/l*61.9%
Simplified61.9%
Taylor expanded in t around 0 90.0%
associate-*r/90.0%
mul-1-neg90.0%
Simplified90.0%
div-inv90.0%
distribute-lft-neg-in90.0%
associate-*l*71.2%
div-inv71.3%
neg-mul-171.3%
associate-*l*71.3%
metadata-eval71.3%
add-sqr-sqrt50.2%
sqrt-unprod50.9%
sqr-neg50.9%
sqrt-unprod10.1%
add-sqr-sqrt40.7%
div-inv40.7%
associate-*l*40.7%
distribute-lft-neg-in40.7%
div-inv40.7%
cancel-sign-sub-inv40.7%
*-un-lft-identity40.7%
div-inv40.7%
Applied egg-rr90.1%
Final simplification88.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.2e+24)
(+ x y)
(if (<= t -5.4e-11)
(* (- t z) (/ y (- t a)))
(if (<= t 5e-81)
(+ x (/ y (/ a z)))
(if (<= t 5e+41) (- x (* z (/ y t))) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.2e+24) {
tmp = x + y;
} else if (t <= -5.4e-11) {
tmp = (t - z) * (y / (t - a));
} else if (t <= 5e-81) {
tmp = x + (y / (a / z));
} else if (t <= 5e+41) {
tmp = x - (z * (y / t));
} 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 (t <= (-1.2d+24)) then
tmp = x + y
else if (t <= (-5.4d-11)) then
tmp = (t - z) * (y / (t - a))
else if (t <= 5d-81) then
tmp = x + (y / (a / z))
else if (t <= 5d+41) then
tmp = x - (z * (y / t))
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 (t <= -1.2e+24) {
tmp = x + y;
} else if (t <= -5.4e-11) {
tmp = (t - z) * (y / (t - a));
} else if (t <= 5e-81) {
tmp = x + (y / (a / z));
} else if (t <= 5e+41) {
tmp = x - (z * (y / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.2e+24: tmp = x + y elif t <= -5.4e-11: tmp = (t - z) * (y / (t - a)) elif t <= 5e-81: tmp = x + (y / (a / z)) elif t <= 5e+41: tmp = x - (z * (y / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.2e+24) tmp = Float64(x + y); elseif (t <= -5.4e-11) tmp = Float64(Float64(t - z) * Float64(y / Float64(t - a))); elseif (t <= 5e-81) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 5e+41) tmp = Float64(x - Float64(z * Float64(y / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.2e+24) tmp = x + y; elseif (t <= -5.4e-11) tmp = (t - z) * (y / (t - a)); elseif (t <= 5e-81) tmp = x + (y / (a / z)); elseif (t <= 5e+41) tmp = x - (z * (y / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.2e+24], N[(x + y), $MachinePrecision], If[LessEqual[t, -5.4e-11], N[(N[(t - z), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e-81], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e+41], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+24}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -5.4 \cdot 10^{-11}:\\
\;\;\;\;\left(t - z\right) \cdot \frac{y}{t - a}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-81}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+41}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.2e24 or 5.00000000000000022e41 < t Initial program 100.0%
+-commutative100.0%
*-commutative100.0%
associate-*l/78.2%
sub-neg78.2%
+-commutative78.2%
neg-sub078.2%
associate-+l-78.2%
sub0-neg78.2%
neg-mul-178.2%
times-frac90.3%
fma-def90.3%
sub-neg90.3%
+-commutative90.3%
neg-sub090.3%
associate-+l-90.3%
sub0-neg90.3%
neg-mul-190.3%
*-commutative90.3%
associate-/l*90.3%
metadata-eval90.3%
/-rgt-identity90.3%
Simplified90.3%
Taylor expanded in t around inf 82.7%
if -1.2e24 < t < -5.40000000000000009e-11Initial program 99.3%
+-commutative99.3%
*-commutative99.3%
associate-*l/89.5%
sub-neg89.5%
+-commutative89.5%
neg-sub089.5%
associate-+l-89.5%
sub0-neg89.5%
neg-mul-189.5%
times-frac99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
*-commutative99.7%
associate-/l*99.7%
metadata-eval99.7%
/-rgt-identity99.7%
Simplified99.7%
Taylor expanded in y around -inf 89.5%
*-commutative89.5%
associate-*r/99.7%
Simplified99.7%
if -5.40000000000000009e-11 < t < 4.99999999999999981e-81Initial program 96.3%
+-commutative96.3%
*-commutative96.3%
associate-*l/97.4%
sub-neg97.4%
+-commutative97.4%
neg-sub097.4%
associate-+l-97.4%
sub0-neg97.4%
neg-mul-197.4%
times-frac96.6%
fma-def96.6%
sub-neg96.6%
+-commutative96.6%
neg-sub096.6%
associate-+l-96.6%
sub0-neg96.6%
neg-mul-196.6%
*-commutative96.6%
associate-/l*96.6%
metadata-eval96.6%
/-rgt-identity96.6%
Simplified96.6%
Taylor expanded in t around 0 81.2%
associate-/l*82.8%
Simplified82.8%
if 4.99999999999999981e-81 < t < 5.00000000000000022e41Initial program 90.6%
+-commutative90.6%
*-commutative90.6%
associate-*l/99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
metadata-eval99.8%
/-rgt-identity99.8%
Simplified99.8%
Taylor expanded in a around 0 75.4%
+-commutative75.4%
associate-/l*61.3%
Simplified61.3%
Taylor expanded in t around 0 75.6%
associate-*r/75.6%
mul-1-neg75.6%
Simplified75.6%
div-inv75.6%
distribute-lft-neg-in75.6%
associate-*l*66.2%
div-inv66.3%
neg-mul-166.3%
associate-*l*66.3%
metadata-eval66.3%
add-sqr-sqrt45.2%
sqrt-unprod50.5%
sqr-neg50.5%
sqrt-unprod10.1%
add-sqr-sqrt45.7%
div-inv45.7%
associate-*l*45.7%
distribute-lft-neg-in45.7%
div-inv45.7%
cancel-sign-sub-inv45.7%
*-un-lft-identity45.7%
div-inv45.7%
Applied egg-rr75.7%
Final simplification82.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -8.5e-40)
(+ x y)
(if (<= t 6.5e-81)
(+ x (/ y (/ a z)))
(if (<= t 2.15e+39) (- x (* z (/ y t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.5e-40) {
tmp = x + y;
} else if (t <= 6.5e-81) {
tmp = x + (y / (a / z));
} else if (t <= 2.15e+39) {
tmp = x - (z * (y / t));
} 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 (t <= (-8.5d-40)) then
tmp = x + y
else if (t <= 6.5d-81) then
tmp = x + (y / (a / z))
else if (t <= 2.15d+39) then
tmp = x - (z * (y / t))
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 (t <= -8.5e-40) {
tmp = x + y;
} else if (t <= 6.5e-81) {
tmp = x + (y / (a / z));
} else if (t <= 2.15e+39) {
tmp = x - (z * (y / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.5e-40: tmp = x + y elif t <= 6.5e-81: tmp = x + (y / (a / z)) elif t <= 2.15e+39: tmp = x - (z * (y / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.5e-40) tmp = Float64(x + y); elseif (t <= 6.5e-81) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 2.15e+39) tmp = Float64(x - Float64(z * Float64(y / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.5e-40) tmp = x + y; elseif (t <= 6.5e-81) tmp = x + (y / (a / z)); elseif (t <= 2.15e+39) tmp = x - (z * (y / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.5e-40], N[(x + y), $MachinePrecision], If[LessEqual[t, 6.5e-81], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.15e+39], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-40}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-81}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{+39}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -8.4999999999999998e-40 or 2.15e39 < t Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l/80.3%
sub-neg80.3%
+-commutative80.3%
neg-sub080.3%
associate-+l-80.3%
sub0-neg80.3%
neg-mul-180.3%
times-frac90.8%
fma-def90.8%
sub-neg90.8%
+-commutative90.8%
neg-sub090.8%
associate-+l-90.8%
sub0-neg90.8%
neg-mul-190.8%
*-commutative90.8%
associate-/l*90.8%
metadata-eval90.8%
/-rgt-identity90.8%
Simplified90.8%
Taylor expanded in t around inf 78.5%
if -8.4999999999999998e-40 < t < 6.5000000000000002e-81Initial program 96.1%
+-commutative96.1%
*-commutative96.1%
associate-*l/97.3%
sub-neg97.3%
+-commutative97.3%
neg-sub097.3%
associate-+l-97.3%
sub0-neg97.3%
neg-mul-197.3%
times-frac97.2%
fma-def97.2%
sub-neg97.2%
+-commutative97.2%
neg-sub097.2%
associate-+l-97.2%
sub0-neg97.2%
neg-mul-197.2%
*-commutative97.2%
associate-/l*97.2%
metadata-eval97.2%
/-rgt-identity97.2%
Simplified97.2%
Taylor expanded in t around 0 83.4%
associate-/l*85.2%
Simplified85.2%
if 6.5000000000000002e-81 < t < 2.15e39Initial program 90.6%
+-commutative90.6%
*-commutative90.6%
associate-*l/99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
times-frac99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
metadata-eval99.8%
/-rgt-identity99.8%
Simplified99.8%
Taylor expanded in a around 0 75.4%
+-commutative75.4%
associate-/l*61.3%
Simplified61.3%
Taylor expanded in t around 0 75.6%
associate-*r/75.6%
mul-1-neg75.6%
Simplified75.6%
div-inv75.6%
distribute-lft-neg-in75.6%
associate-*l*66.2%
div-inv66.3%
neg-mul-166.3%
associate-*l*66.3%
metadata-eval66.3%
add-sqr-sqrt45.2%
sqrt-unprod50.5%
sqr-neg50.5%
sqrt-unprod10.1%
add-sqr-sqrt45.7%
div-inv45.7%
associate-*l*45.7%
distribute-lft-neg-in45.7%
div-inv45.7%
cancel-sign-sub-inv45.7%
*-un-lft-identity45.7%
div-inv45.7%
Applied egg-rr75.7%
Final simplification81.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.5e-40) (not (<= t 150.0))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.5e-40) || !(t <= 150.0)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.5d-40)) .or. (.not. (t <= 150.0d0))) then
tmp = x + y
else
tmp = x + (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.5e-40) || !(t <= 150.0)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.5e-40) or not (t <= 150.0): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.5e-40) || !(t <= 150.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.5e-40) || ~((t <= 150.0))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.5e-40], N[Not[LessEqual[t, 150.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{-40} \lor \neg \left(t \leq 150\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.5000000000000001e-40 or 150 < t Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l/81.2%
sub-neg81.2%
+-commutative81.2%
neg-sub081.2%
associate-+l-81.2%
sub0-neg81.2%
neg-mul-181.2%
times-frac91.2%
fma-def91.2%
sub-neg91.2%
+-commutative91.2%
neg-sub091.2%
associate-+l-91.2%
sub0-neg91.2%
neg-mul-191.2%
*-commutative91.2%
associate-/l*91.2%
metadata-eval91.2%
/-rgt-identity91.2%
Simplified91.2%
Taylor expanded in t around inf 77.3%
if -1.5000000000000001e-40 < t < 150Initial program 95.0%
Taylor expanded in t around 0 81.3%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.5e-41) (not (<= t 820.0))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.5e-41) || !(t <= 820.0)) {
tmp = x + y;
} else {
tmp = x + (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 ((t <= (-7.5d-41)) .or. (.not. (t <= 820.0d0))) then
tmp = x + y
else
tmp = x + (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 ((t <= -7.5e-41) || !(t <= 820.0)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.5e-41) or not (t <= 820.0): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.5e-41) || !(t <= 820.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.5e-41) || ~((t <= 820.0))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.5e-41], N[Not[LessEqual[t, 820.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-41} \lor \neg \left(t \leq 820\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -7.50000000000000049e-41 or 820 < t Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l/81.2%
sub-neg81.2%
+-commutative81.2%
neg-sub081.2%
associate-+l-81.2%
sub0-neg81.2%
neg-mul-181.2%
times-frac91.2%
fma-def91.2%
sub-neg91.2%
+-commutative91.2%
neg-sub091.2%
associate-+l-91.2%
sub0-neg91.2%
neg-mul-191.2%
*-commutative91.2%
associate-/l*91.2%
metadata-eval91.2%
/-rgt-identity91.2%
Simplified91.2%
Taylor expanded in t around inf 77.3%
if -7.50000000000000049e-41 < t < 820Initial program 95.0%
+-commutative95.0%
*-commutative95.0%
associate-*l/97.6%
sub-neg97.6%
+-commutative97.6%
neg-sub097.6%
associate-+l-97.6%
sub0-neg97.6%
neg-mul-197.6%
times-frac97.5%
fma-def97.5%
sub-neg97.5%
+-commutative97.5%
neg-sub097.5%
associate-+l-97.5%
sub0-neg97.5%
neg-mul-197.5%
*-commutative97.5%
associate-/l*97.5%
metadata-eval97.5%
/-rgt-identity97.5%
Simplified97.5%
Taylor expanded in t around 0 79.8%
associate-/l*81.3%
Simplified81.3%
Final simplification79.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -7e-44) (+ x y) (if (<= t 38.0) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7e-44) {
tmp = x + y;
} else if (t <= 38.0) {
tmp = x;
} 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 (t <= (-7d-44)) then
tmp = x + y
else if (t <= 38.0d0) then
tmp = x
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 (t <= -7e-44) {
tmp = x + y;
} else if (t <= 38.0) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7e-44: tmp = x + y elif t <= 38.0: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7e-44) tmp = Float64(x + y); elseif (t <= 38.0) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7e-44) tmp = x + y; elseif (t <= 38.0) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7e-44], N[(x + y), $MachinePrecision], If[LessEqual[t, 38.0], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{-44}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 38:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -6.9999999999999995e-44 or 38 < t Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l/81.2%
sub-neg81.2%
+-commutative81.2%
neg-sub081.2%
associate-+l-81.2%
sub0-neg81.2%
neg-mul-181.2%
times-frac91.2%
fma-def91.2%
sub-neg91.2%
+-commutative91.2%
neg-sub091.2%
associate-+l-91.2%
sub0-neg91.2%
neg-mul-191.2%
*-commutative91.2%
associate-/l*91.2%
metadata-eval91.2%
/-rgt-identity91.2%
Simplified91.2%
Taylor expanded in t around inf 77.3%
if -6.9999999999999995e-44 < t < 38Initial program 95.0%
+-commutative95.0%
*-commutative95.0%
associate-*l/97.6%
sub-neg97.6%
+-commutative97.6%
neg-sub097.6%
associate-+l-97.6%
sub0-neg97.6%
neg-mul-197.6%
times-frac97.5%
fma-def97.5%
sub-neg97.5%
+-commutative97.5%
neg-sub097.5%
associate-+l-97.5%
sub0-neg97.5%
neg-mul-197.5%
*-commutative97.5%
associate-/l*97.5%
metadata-eval97.5%
/-rgt-identity97.5%
Simplified97.5%
Taylor expanded in y around 0 52.1%
Final simplification65.4%
(FPCore (x y z t a) :precision binary64 (if (<= y -5.8e+103) y (if (<= y 1.95e+208) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.8e+103) {
tmp = y;
} else if (y <= 1.95e+208) {
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 <= (-5.8d+103)) then
tmp = y
else if (y <= 1.95d+208) 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 <= -5.8e+103) {
tmp = y;
} else if (y <= 1.95e+208) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5.8e+103: tmp = y elif y <= 1.95e+208: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5.8e+103) tmp = y; elseif (y <= 1.95e+208) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5.8e+103) tmp = y; elseif (y <= 1.95e+208) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5.8e+103], y, If[LessEqual[y, 1.95e+208], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+103}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{+208}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -5.7999999999999997e103 or 1.95e208 < y Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l/67.2%
sub-neg67.2%
+-commutative67.2%
neg-sub067.2%
associate-+l-67.2%
sub0-neg67.2%
neg-mul-167.2%
times-frac93.3%
fma-def93.3%
sub-neg93.3%
+-commutative93.3%
neg-sub093.3%
associate-+l-93.3%
sub0-neg93.3%
neg-mul-193.3%
*-commutative93.3%
associate-/l*93.3%
metadata-eval93.3%
/-rgt-identity93.3%
Simplified93.3%
Taylor expanded in y around -inf 55.9%
*-commutative55.9%
associate-*r/79.6%
Simplified79.6%
Taylor expanded in z around 0 21.9%
associate-/l*45.8%
Simplified45.8%
Taylor expanded in t around inf 36.7%
if -5.7999999999999997e103 < y < 1.95e208Initial program 96.9%
+-commutative96.9%
*-commutative96.9%
associate-*l/95.1%
sub-neg95.1%
+-commutative95.1%
neg-sub095.1%
associate-+l-95.1%
sub0-neg95.1%
neg-mul-195.1%
times-frac94.5%
fma-def94.5%
sub-neg94.5%
+-commutative94.5%
neg-sub094.5%
associate-+l-94.5%
sub0-neg94.5%
neg-mul-194.5%
*-commutative94.5%
associate-/l*94.5%
metadata-eval94.5%
/-rgt-identity94.5%
Simplified94.5%
Taylor expanded in y around 0 60.7%
Final simplification55.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 97.6%
+-commutative97.6%
*-commutative97.6%
associate-*l/88.9%
sub-neg88.9%
+-commutative88.9%
neg-sub088.9%
associate-+l-88.9%
sub0-neg88.9%
neg-mul-188.9%
times-frac94.2%
fma-def94.2%
sub-neg94.2%
+-commutative94.2%
neg-sub094.2%
associate-+l-94.2%
sub0-neg94.2%
neg-mul-194.2%
*-commutative94.2%
associate-/l*94.2%
metadata-eval94.2%
/-rgt-identity94.2%
Simplified94.2%
Taylor expanded in y around 0 50.5%
Final simplification50.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (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) :: tmp
t_1 = x + (y * ((z - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (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 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2023181
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))