
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\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) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (- x (* y (/ (- t z) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - (y * ((t - z) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (z - a)));
}
def code(x, y, z, t, a): return x - (y * ((t - z) / (z - a)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(t - z) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((t - z) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{t - z}{z - a}
\end{array}
Initial program 98.8%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -1.9e-153)
t_1
(if (<= z 3e-68)
(+ x (/ t (/ a y)))
(if (<= z 7e-13)
t_1
(if (<= z 1.4e+23)
(+ x (/ y (/ a t)))
(if (<= z 1.45e+88) (- x (* y (/ t z))) t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -1.9e-153) {
tmp = t_1;
} else if (z <= 3e-68) {
tmp = x + (t / (a / y));
} else if (z <= 7e-13) {
tmp = t_1;
} else if (z <= 1.4e+23) {
tmp = x + (y / (a / t));
} else if (z <= 1.45e+88) {
tmp = x - (y * (t / z));
} 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 / (z - a)))
if (z <= (-1.9d-153)) then
tmp = t_1
else if (z <= 3d-68) then
tmp = x + (t / (a / y))
else if (z <= 7d-13) then
tmp = t_1
else if (z <= 1.4d+23) then
tmp = x + (y / (a / t))
else if (z <= 1.45d+88) then
tmp = x - (y * (t / z))
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 / (z - a)));
double tmp;
if (z <= -1.9e-153) {
tmp = t_1;
} else if (z <= 3e-68) {
tmp = x + (t / (a / y));
} else if (z <= 7e-13) {
tmp = t_1;
} else if (z <= 1.4e+23) {
tmp = x + (y / (a / t));
} else if (z <= 1.45e+88) {
tmp = x - (y * (t / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -1.9e-153: tmp = t_1 elif z <= 3e-68: tmp = x + (t / (a / y)) elif z <= 7e-13: tmp = t_1 elif z <= 1.4e+23: tmp = x + (y / (a / t)) elif z <= 1.45e+88: tmp = x - (y * (t / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -1.9e-153) tmp = t_1; elseif (z <= 3e-68) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 7e-13) tmp = t_1; elseif (z <= 1.4e+23) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 1.45e+88) tmp = Float64(x - Float64(y * Float64(t / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / (z - a))); tmp = 0.0; if (z <= -1.9e-153) tmp = t_1; elseif (z <= 3e-68) tmp = x + (t / (a / y)); elseif (z <= 7e-13) tmp = t_1; elseif (z <= 1.4e+23) tmp = x + (y / (a / t)); elseif (z <= 1.45e+88) tmp = x - (y * (t / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e-153], t$95$1, If[LessEqual[z, 3e-68], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e-13], t$95$1, If[LessEqual[z, 1.4e+23], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+88], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{-153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-68}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+23}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+88}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.90000000000000011e-153 or 3e-68 < z < 7.0000000000000005e-13 or 1.45e88 < z Initial program 100.0%
Taylor expanded in t around 0 85.0%
if -1.90000000000000011e-153 < z < 3e-68Initial program 96.2%
+-commutative96.2%
associate-*r/95.1%
associate-*l/98.6%
*-commutative98.6%
fma-def98.6%
Simplified98.6%
Taylor expanded in z around 0 86.4%
associate-/l*90.0%
Simplified90.0%
clear-num90.0%
associate-/r/88.7%
clear-num88.7%
Applied egg-rr88.7%
associate-*l/86.4%
associate-/l*90.8%
Applied egg-rr90.8%
if 7.0000000000000005e-13 < z < 1.4e23Initial program 99.7%
+-commutative99.7%
associate-*r/99.7%
associate-*l/99.7%
*-commutative99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
associate-/l*100.0%
Simplified100.0%
if 1.4e23 < z < 1.45e88Initial program 100.0%
+-commutative100.0%
associate-*r/92.9%
associate-*l/93.4%
*-commutative93.4%
fma-def93.1%
Simplified93.1%
Taylor expanded in a around 0 92.3%
*-commutative92.3%
associate-/l*78.5%
Simplified78.5%
Taylor expanded in z around 0 84.4%
associate-*r/84.4%
mul-1-neg84.4%
distribute-rgt-neg-in84.4%
Simplified84.4%
Taylor expanded in y around 0 84.4%
+-commutative84.4%
mul-1-neg84.4%
associate-*r/84.4%
distribute-lft-neg-in84.4%
cancel-sign-sub-inv84.4%
Simplified84.4%
Final simplification87.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -2.9e-153)
t_1
(if (<= z 1.85e-66)
(+ x (/ t (/ a y)))
(if (<= z 9.5e-12)
t_1
(if (<= z 9.2e+22) (+ x (/ y (/ a t))) (- x (* y (/ (- t z) z)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -2.9e-153) {
tmp = t_1;
} else if (z <= 1.85e-66) {
tmp = x + (t / (a / y));
} else if (z <= 9.5e-12) {
tmp = t_1;
} else if (z <= 9.2e+22) {
tmp = x + (y / (a / t));
} else {
tmp = x - (y * ((t - z) / 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) :: t_1
real(8) :: tmp
t_1 = x + (y * (z / (z - a)))
if (z <= (-2.9d-153)) then
tmp = t_1
else if (z <= 1.85d-66) then
tmp = x + (t / (a / y))
else if (z <= 9.5d-12) then
tmp = t_1
else if (z <= 9.2d+22) then
tmp = x + (y / (a / t))
else
tmp = x - (y * ((t - z) / z))
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 / (z - a)));
double tmp;
if (z <= -2.9e-153) {
tmp = t_1;
} else if (z <= 1.85e-66) {
tmp = x + (t / (a / y));
} else if (z <= 9.5e-12) {
tmp = t_1;
} else if (z <= 9.2e+22) {
tmp = x + (y / (a / t));
} else {
tmp = x - (y * ((t - z) / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -2.9e-153: tmp = t_1 elif z <= 1.85e-66: tmp = x + (t / (a / y)) elif z <= 9.5e-12: tmp = t_1 elif z <= 9.2e+22: tmp = x + (y / (a / t)) else: tmp = x - (y * ((t - z) / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -2.9e-153) tmp = t_1; elseif (z <= 1.85e-66) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 9.5e-12) tmp = t_1; elseif (z <= 9.2e+22) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / (z - a))); tmp = 0.0; if (z <= -2.9e-153) tmp = t_1; elseif (z <= 1.85e-66) tmp = x + (t / (a / y)); elseif (z <= 9.5e-12) tmp = t_1; elseif (z <= 9.2e+22) tmp = x + (y / (a / t)); else tmp = x - (y * ((t - z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e-153], t$95$1, If[LessEqual[z, 1.85e-66], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-12], t$95$1, If[LessEqual[z, 9.2e+22], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{-153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-66}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\end{array}
\end{array}
if z < -2.90000000000000002e-153 or 1.8500000000000001e-66 < z < 9.4999999999999995e-12Initial program 100.0%
Taylor expanded in t around 0 82.4%
if -2.90000000000000002e-153 < z < 1.8500000000000001e-66Initial program 96.2%
+-commutative96.2%
associate-*r/95.1%
associate-*l/98.6%
*-commutative98.6%
fma-def98.6%
Simplified98.6%
Taylor expanded in z around 0 86.4%
associate-/l*90.0%
Simplified90.0%
clear-num90.0%
associate-/r/88.7%
clear-num88.7%
Applied egg-rr88.7%
associate-*l/86.4%
associate-/l*90.8%
Applied egg-rr90.8%
if 9.4999999999999995e-12 < z < 9.2000000000000008e22Initial program 99.7%
+-commutative99.7%
associate-*r/99.7%
associate-*l/99.7%
*-commutative99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
associate-/l*100.0%
Simplified100.0%
if 9.2000000000000008e22 < z Initial program 99.9%
Taylor expanded in a around 0 93.9%
Final simplification88.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* y t) (- a z)))) (t_2 (- x (* y (/ (- t z) z)))))
(if (<= z -9.4e-38)
t_2
(if (<= z -1e-144)
t_1
(if (<= z 7.5e-206)
(+ x (* (/ y a) (- t z)))
(if (<= z 4.2e+24) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y * t) / (a - z));
double t_2 = x - (y * ((t - z) / z));
double tmp;
if (z <= -9.4e-38) {
tmp = t_2;
} else if (z <= -1e-144) {
tmp = t_1;
} else if (z <= 7.5e-206) {
tmp = x + ((y / a) * (t - z));
} else if (z <= 4.2e+24) {
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 * t) / (a - z))
t_2 = x - (y * ((t - z) / z))
if (z <= (-9.4d-38)) then
tmp = t_2
else if (z <= (-1d-144)) then
tmp = t_1
else if (z <= 7.5d-206) then
tmp = x + ((y / a) * (t - z))
else if (z <= 4.2d+24) 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 * t) / (a - z));
double t_2 = x - (y * ((t - z) / z));
double tmp;
if (z <= -9.4e-38) {
tmp = t_2;
} else if (z <= -1e-144) {
tmp = t_1;
} else if (z <= 7.5e-206) {
tmp = x + ((y / a) * (t - z));
} else if (z <= 4.2e+24) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y * t) / (a - z)) t_2 = x - (y * ((t - z) / z)) tmp = 0 if z <= -9.4e-38: tmp = t_2 elif z <= -1e-144: tmp = t_1 elif z <= 7.5e-206: tmp = x + ((y / a) * (t - z)) elif z <= 4.2e+24: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y * t) / Float64(a - z))) t_2 = Float64(x - Float64(y * Float64(Float64(t - z) / z))) tmp = 0.0 if (z <= -9.4e-38) tmp = t_2; elseif (z <= -1e-144) tmp = t_1; elseif (z <= 7.5e-206) tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); elseif (z <= 4.2e+24) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y * t) / (a - z)); t_2 = x - (y * ((t - z) / z)); tmp = 0.0; if (z <= -9.4e-38) tmp = t_2; elseif (z <= -1e-144) tmp = t_1; elseif (z <= 7.5e-206) tmp = x + ((y / a) * (t - z)); elseif (z <= 4.2e+24) 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[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.4e-38], t$95$2, If[LessEqual[z, -1e-144], t$95$1, If[LessEqual[z, 7.5e-206], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e+24], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot t}{a - z}\\
t_2 := x - y \cdot \frac{t - z}{z}\\
\mathbf{if}\;z \leq -9.4 \cdot 10^{-38}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-144}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-206}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+24}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -9.39999999999999996e-38 or 4.2000000000000003e24 < z Initial program 100.0%
Taylor expanded in a around 0 90.8%
if -9.39999999999999996e-38 < z < -9.9999999999999995e-145 or 7.5e-206 < z < 4.2000000000000003e24Initial program 99.9%
Taylor expanded in t around inf 88.9%
associate-*r/88.9%
mul-1-neg88.9%
distribute-rgt-neg-out88.9%
Simplified88.9%
frac-2neg88.9%
div-inv88.9%
distribute-rgt-neg-out88.9%
remove-double-neg88.9%
Applied egg-rr88.9%
Taylor expanded in y around 0 88.9%
if -9.9999999999999995e-145 < z < 7.5e-206Initial program 94.5%
+-commutative94.5%
associate-*r/92.7%
associate-*l/98.0%
*-commutative98.0%
fma-def98.0%
Simplified98.0%
Taylor expanded in a around inf 91.0%
+-commutative91.0%
mul-1-neg91.0%
unsub-neg91.0%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in y around 0 91.0%
associate-/l*96.4%
associate-/r/96.3%
Simplified96.3%
Final simplification91.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* y t) (- a z)))) (t_2 (- x (* y (/ (- t z) z)))))
(if (<= z -3.5e-39)
t_2
(if (<= z -2.45e-147)
t_1
(if (<= z 2.35e-206)
(- x (/ y (/ a (- z t))))
(if (<= z 9.5e+22) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y * t) / (a - z));
double t_2 = x - (y * ((t - z) / z));
double tmp;
if (z <= -3.5e-39) {
tmp = t_2;
} else if (z <= -2.45e-147) {
tmp = t_1;
} else if (z <= 2.35e-206) {
tmp = x - (y / (a / (z - t)));
} else if (z <= 9.5e+22) {
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 * t) / (a - z))
t_2 = x - (y * ((t - z) / z))
if (z <= (-3.5d-39)) then
tmp = t_2
else if (z <= (-2.45d-147)) then
tmp = t_1
else if (z <= 2.35d-206) then
tmp = x - (y / (a / (z - t)))
else if (z <= 9.5d+22) 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 * t) / (a - z));
double t_2 = x - (y * ((t - z) / z));
double tmp;
if (z <= -3.5e-39) {
tmp = t_2;
} else if (z <= -2.45e-147) {
tmp = t_1;
} else if (z <= 2.35e-206) {
tmp = x - (y / (a / (z - t)));
} else if (z <= 9.5e+22) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y * t) / (a - z)) t_2 = x - (y * ((t - z) / z)) tmp = 0 if z <= -3.5e-39: tmp = t_2 elif z <= -2.45e-147: tmp = t_1 elif z <= 2.35e-206: tmp = x - (y / (a / (z - t))) elif z <= 9.5e+22: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y * t) / Float64(a - z))) t_2 = Float64(x - Float64(y * Float64(Float64(t - z) / z))) tmp = 0.0 if (z <= -3.5e-39) tmp = t_2; elseif (z <= -2.45e-147) tmp = t_1; elseif (z <= 2.35e-206) tmp = Float64(x - Float64(y / Float64(a / Float64(z - t)))); elseif (z <= 9.5e+22) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y * t) / (a - z)); t_2 = x - (y * ((t - z) / z)); tmp = 0.0; if (z <= -3.5e-39) tmp = t_2; elseif (z <= -2.45e-147) tmp = t_1; elseif (z <= 2.35e-206) tmp = x - (y / (a / (z - t))); elseif (z <= 9.5e+22) 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[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e-39], t$95$2, If[LessEqual[z, -2.45e-147], t$95$1, If[LessEqual[z, 2.35e-206], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+22], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot t}{a - z}\\
t_2 := x - y \cdot \frac{t - z}{z}\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{-39}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-147}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-206}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+22}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3.5e-39 or 9.49999999999999937e22 < z Initial program 100.0%
Taylor expanded in a around 0 90.8%
if -3.5e-39 < z < -2.45000000000000002e-147 or 2.3499999999999999e-206 < z < 9.49999999999999937e22Initial program 99.9%
Taylor expanded in t around inf 88.9%
associate-*r/88.9%
mul-1-neg88.9%
distribute-rgt-neg-out88.9%
Simplified88.9%
frac-2neg88.9%
div-inv88.9%
distribute-rgt-neg-out88.9%
remove-double-neg88.9%
Applied egg-rr88.9%
Taylor expanded in y around 0 88.9%
if -2.45000000000000002e-147 < z < 2.3499999999999999e-206Initial program 94.5%
+-commutative94.5%
associate-*r/92.7%
associate-*l/98.0%
*-commutative98.0%
fma-def98.0%
Simplified98.0%
Taylor expanded in a around inf 91.0%
+-commutative91.0%
mul-1-neg91.0%
unsub-neg91.0%
associate-/l*96.4%
Simplified96.4%
Final simplification91.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* y t) (- a z)))) (t_2 (- x (* y (/ (- t z) z)))))
(if (<= z -5.2e-38)
t_2
(if (<= z -8.5e-146)
t_1
(if (<= z 4.2e-206)
(+ x (/ (- z t) (/ a (- y))))
(if (<= z 5.8e+24) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y * t) / (a - z));
double t_2 = x - (y * ((t - z) / z));
double tmp;
if (z <= -5.2e-38) {
tmp = t_2;
} else if (z <= -8.5e-146) {
tmp = t_1;
} else if (z <= 4.2e-206) {
tmp = x + ((z - t) / (a / -y));
} else if (z <= 5.8e+24) {
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 * t) / (a - z))
t_2 = x - (y * ((t - z) / z))
if (z <= (-5.2d-38)) then
tmp = t_2
else if (z <= (-8.5d-146)) then
tmp = t_1
else if (z <= 4.2d-206) then
tmp = x + ((z - t) / (a / -y))
else if (z <= 5.8d+24) 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 * t) / (a - z));
double t_2 = x - (y * ((t - z) / z));
double tmp;
if (z <= -5.2e-38) {
tmp = t_2;
} else if (z <= -8.5e-146) {
tmp = t_1;
} else if (z <= 4.2e-206) {
tmp = x + ((z - t) / (a / -y));
} else if (z <= 5.8e+24) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y * t) / (a - z)) t_2 = x - (y * ((t - z) / z)) tmp = 0 if z <= -5.2e-38: tmp = t_2 elif z <= -8.5e-146: tmp = t_1 elif z <= 4.2e-206: tmp = x + ((z - t) / (a / -y)) elif z <= 5.8e+24: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y * t) / Float64(a - z))) t_2 = Float64(x - Float64(y * Float64(Float64(t - z) / z))) tmp = 0.0 if (z <= -5.2e-38) tmp = t_2; elseif (z <= -8.5e-146) tmp = t_1; elseif (z <= 4.2e-206) tmp = Float64(x + Float64(Float64(z - t) / Float64(a / Float64(-y)))); elseif (z <= 5.8e+24) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y * t) / (a - z)); t_2 = x - (y * ((t - z) / z)); tmp = 0.0; if (z <= -5.2e-38) tmp = t_2; elseif (z <= -8.5e-146) tmp = t_1; elseif (z <= 4.2e-206) tmp = x + ((z - t) / (a / -y)); elseif (z <= 5.8e+24) 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[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e-38], t$95$2, If[LessEqual[z, -8.5e-146], t$95$1, If[LessEqual[z, 4.2e-206], N[(x + N[(N[(z - t), $MachinePrecision] / N[(a / (-y)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+24], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot t}{a - z}\\
t_2 := x - y \cdot \frac{t - z}{z}\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{-38}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-146}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-206}:\\
\;\;\;\;x + \frac{z - t}{\frac{a}{-y}}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+24}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -5.20000000000000022e-38 or 5.79999999999999958e24 < z Initial program 100.0%
Taylor expanded in a around 0 90.8%
if -5.20000000000000022e-38 < z < -8.4999999999999997e-146 or 4.2000000000000002e-206 < z < 5.79999999999999958e24Initial program 99.9%
Taylor expanded in t around inf 88.9%
associate-*r/88.9%
mul-1-neg88.9%
distribute-rgt-neg-out88.9%
Simplified88.9%
frac-2neg88.9%
div-inv88.9%
distribute-rgt-neg-out88.9%
remove-double-neg88.9%
Applied egg-rr88.9%
Taylor expanded in y around 0 88.9%
if -8.4999999999999997e-146 < z < 4.2000000000000002e-206Initial program 94.5%
associate-*r/92.7%
Simplified92.7%
associate-/l*96.4%
associate-/r/98.0%
Applied egg-rr98.0%
Taylor expanded in a around inf 91.0%
associate-*r/91.0%
neg-mul-191.0%
distribute-lft-neg-in91.0%
*-commutative91.0%
associate-/l*97.6%
Simplified97.6%
Final simplification91.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.2e-38) (not (<= z 4.2e+24))) (- x (* y (/ (- t z) z))) (+ x (/ (* y t) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.2e-38) || !(z <= 4.2e+24)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + ((y * t) / (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 ((z <= (-9.2d-38)) .or. (.not. (z <= 4.2d+24))) then
tmp = x - (y * ((t - z) / z))
else
tmp = x + ((y * t) / (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 ((z <= -9.2e-38) || !(z <= 4.2e+24)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.2e-38) or not (z <= 4.2e+24): tmp = x - (y * ((t - z) / z)) else: tmp = x + ((y * t) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.2e-38) || !(z <= 4.2e+24)) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); else tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9.2e-38) || ~((z <= 4.2e+24))) tmp = x - (y * ((t - z) / z)); else tmp = x + ((y * t) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.2e-38], N[Not[LessEqual[z, 4.2e+24]], $MachinePrecision]], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{-38} \lor \neg \left(z \leq 4.2 \cdot 10^{+24}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\end{array}
\end{array}
if z < -9.20000000000000007e-38 or 4.2000000000000003e24 < z Initial program 100.0%
Taylor expanded in a around 0 90.8%
if -9.20000000000000007e-38 < z < 4.2000000000000003e24Initial program 97.5%
Taylor expanded in t around inf 88.2%
associate-*r/88.2%
mul-1-neg88.2%
distribute-rgt-neg-out88.2%
Simplified88.2%
frac-2neg88.2%
div-inv88.1%
distribute-rgt-neg-out88.1%
remove-double-neg88.1%
Applied egg-rr88.1%
Taylor expanded in y around 0 88.2%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.5e-38) (+ x y) (if (<= z 2.9e+23) (+ x (* y (/ t a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e-38) {
tmp = x + y;
} else if (z <= 2.9e+23) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.5d-38)) then
tmp = x + y
else if (z <= 2.9d+23) then
tmp = x + (y * (t / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e-38) {
tmp = x + y;
} else if (z <= 2.9e+23) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e-38: tmp = x + y elif z <= 2.9e+23: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e-38) tmp = Float64(x + y); elseif (z <= 2.9e+23) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.5e-38) tmp = x + y; elseif (z <= 2.9e+23) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e-38], N[(x + y), $MachinePrecision], If[LessEqual[z, 2.9e+23], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-38}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+23}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -5.50000000000000005e-38 or 2.90000000000000013e23 < z Initial program 100.0%
+-commutative100.0%
associate-*r/77.9%
associate-*l/97.0%
*-commutative97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in z around inf 81.4%
if -5.50000000000000005e-38 < z < 2.90000000000000013e23Initial program 97.5%
Taylor expanded in z around 0 79.1%
Final simplification80.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -9.4e-38) (+ x y) (if (<= z 1.25e+23) (+ x (* t (/ y a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.4e-38) {
tmp = x + y;
} else if (z <= 1.25e+23) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-9.4d-38)) then
tmp = x + y
else if (z <= 1.25d+23) then
tmp = x + (t * (y / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.4e-38) {
tmp = x + y;
} else if (z <= 1.25e+23) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9.4e-38: tmp = x + y elif z <= 1.25e+23: tmp = x + (t * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.4e-38) tmp = Float64(x + y); elseif (z <= 1.25e+23) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9.4e-38) tmp = x + y; elseif (z <= 1.25e+23) tmp = x + (t * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.4e-38], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.25e+23], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.4 \cdot 10^{-38}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+23}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -9.39999999999999996e-38 or 1.25e23 < z Initial program 100.0%
+-commutative100.0%
associate-*r/77.9%
associate-*l/97.0%
*-commutative97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in z around inf 81.4%
if -9.39999999999999996e-38 < z < 1.25e23Initial program 97.5%
+-commutative97.5%
associate-*r/96.0%
associate-*l/98.8%
*-commutative98.8%
fma-def98.8%
Simplified98.8%
Taylor expanded in z around 0 76.8%
associate-/l*80.0%
Simplified80.0%
associate-/r/79.6%
Applied egg-rr79.6%
Final simplification80.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.2e-38) (+ x y) (if (<= z 9.2e+22) (+ x (/ t (/ a y))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e-38) {
tmp = x + y;
} else if (z <= 9.2e+22) {
tmp = x + (t / (a / y));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.2d-38)) then
tmp = x + y
else if (z <= 9.2d+22) then
tmp = x + (t / (a / y))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e-38) {
tmp = x + y;
} else if (z <= 9.2e+22) {
tmp = x + (t / (a / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.2e-38: tmp = x + y elif z <= 9.2e+22: tmp = x + (t / (a / y)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.2e-38) tmp = Float64(x + y); elseif (z <= 9.2e+22) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.2e-38) tmp = x + y; elseif (z <= 9.2e+22) tmp = x + (t / (a / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.2e-38], N[(x + y), $MachinePrecision], If[LessEqual[z, 9.2e+22], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-38}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.20000000000000011e-38 or 9.2000000000000008e22 < z Initial program 100.0%
+-commutative100.0%
associate-*r/77.9%
associate-*l/97.0%
*-commutative97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in z around inf 81.4%
if -1.20000000000000011e-38 < z < 9.2000000000000008e22Initial program 97.5%
+-commutative97.5%
associate-*r/96.0%
associate-*l/98.8%
*-commutative98.8%
fma-def98.8%
Simplified98.8%
Taylor expanded in z around 0 76.8%
associate-/l*80.0%
Simplified80.0%
clear-num80.0%
associate-/r/79.1%
clear-num79.1%
Applied egg-rr79.1%
associate-*l/76.8%
associate-/l*80.2%
Applied egg-rr80.2%
Final simplification80.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.8e-38) (+ x y) (if (<= z 1.15e+30) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.8e-38) {
tmp = x + y;
} else if (z <= 1.15e+30) {
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 (z <= (-7.8d-38)) then
tmp = x + y
else if (z <= 1.15d+30) 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 (z <= -7.8e-38) {
tmp = x + y;
} else if (z <= 1.15e+30) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.8e-38: tmp = x + y elif z <= 1.15e+30: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.8e-38) tmp = Float64(x + y); elseif (z <= 1.15e+30) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.8e-38) tmp = x + y; elseif (z <= 1.15e+30) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.8e-38], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.15e+30], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{-38}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+30}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -7.7999999999999998e-38 or 1.15e30 < z Initial program 100.0%
+-commutative100.0%
associate-*r/77.7%
associate-*l/97.0%
*-commutative97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in z around inf 82.0%
if -7.7999999999999998e-38 < z < 1.15e30Initial program 97.5%
+-commutative97.5%
associate-*r/96.0%
associate-*l/98.8%
*-commutative98.8%
fma-def98.8%
Simplified98.8%
Taylor expanded in y around 0 44.0%
Final simplification64.1%
(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 98.8%
+-commutative98.8%
associate-*r/86.4%
associate-*l/97.8%
*-commutative97.8%
fma-def97.8%
Simplified97.8%
Taylor expanded in y around 0 50.6%
Final simplification50.6%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - 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 - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2023185
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))