
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(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}
Initial program 82.7%
associate-/l*97.3%
*-commutative97.3%
Applied egg-rr97.3%
*-commutative97.3%
clear-num97.3%
un-div-inv97.6%
Applied egg-rr97.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ y (/ (- z a) z)))))
(if (<= z -1.3e+31)
t_1
(if (<= z -5.4e-196)
(- x (* t (/ y z)))
(if (<= z 1.65e+42) (+ x (* y (/ t a))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / ((z - a) / z));
double tmp;
if (z <= -1.3e+31) {
tmp = t_1;
} else if (z <= -5.4e-196) {
tmp = x - (t * (y / z));
} else if (z <= 1.65e+42) {
tmp = x + (y * (t / a));
} 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 - a) / z))
if (z <= (-1.3d+31)) then
tmp = t_1
else if (z <= (-5.4d-196)) then
tmp = x - (t * (y / z))
else if (z <= 1.65d+42) then
tmp = x + (y * (t / a))
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 - a) / z));
double tmp;
if (z <= -1.3e+31) {
tmp = t_1;
} else if (z <= -5.4e-196) {
tmp = x - (t * (y / z));
} else if (z <= 1.65e+42) {
tmp = x + (y * (t / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / ((z - a) / z)) tmp = 0 if z <= -1.3e+31: tmp = t_1 elif z <= -5.4e-196: tmp = x - (t * (y / z)) elif z <= 1.65e+42: tmp = x + (y * (t / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(Float64(z - a) / z))) tmp = 0.0 if (z <= -1.3e+31) tmp = t_1; elseif (z <= -5.4e-196) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 1.65e+42) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y / ((z - a) / z)); tmp = 0.0; if (z <= -1.3e+31) tmp = t_1; elseif (z <= -5.4e-196) tmp = x - (t * (y / z)); elseif (z <= 1.65e+42) tmp = x + (y * (t / a)); 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 - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.3e+31], t$95$1, If[LessEqual[z, -5.4e-196], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+42], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.4 \cdot 10^{-196}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+42}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.3e31 or 1.6499999999999999e42 < z Initial program 66.1%
associate-/l*99.9%
*-commutative99.9%
Applied egg-rr99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 89.4%
if -1.3e31 < z < -5.39999999999999963e-196Initial program 95.9%
associate-/l*93.3%
*-commutative93.3%
Applied egg-rr93.3%
Taylor expanded in z around 0 84.3%
neg-mul-184.3%
Simplified84.3%
Taylor expanded in z around inf 65.5%
mul-1-neg65.5%
associate-/l*66.2%
distribute-lft-neg-in66.2%
Simplified66.2%
if -5.39999999999999963e-196 < z < 1.6499999999999999e42Initial program 97.8%
associate-/l*95.9%
*-commutative95.9%
Applied egg-rr95.9%
Taylor expanded in z around 0 84.5%
Final simplification83.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -1.55e+32)
t_1
(if (<= z -9.5e-197)
(- x (* t (/ y z)))
(if (<= z 8.5e+41) (+ x (* y (/ t a))) 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.55e+32) {
tmp = t_1;
} else if (z <= -9.5e-197) {
tmp = x - (t * (y / z));
} else if (z <= 8.5e+41) {
tmp = x + (y * (t / a));
} 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.55d+32)) then
tmp = t_1
else if (z <= (-9.5d-197)) then
tmp = x - (t * (y / z))
else if (z <= 8.5d+41) then
tmp = x + (y * (t / a))
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.55e+32) {
tmp = t_1;
} else if (z <= -9.5e-197) {
tmp = x - (t * (y / z));
} else if (z <= 8.5e+41) {
tmp = x + (y * (t / a));
} 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.55e+32: tmp = t_1 elif z <= -9.5e-197: tmp = x - (t * (y / z)) elif z <= 8.5e+41: tmp = x + (y * (t / a)) 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.55e+32) tmp = t_1; elseif (z <= -9.5e-197) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 8.5e+41) tmp = Float64(x + Float64(y * Float64(t / a))); 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.55e+32) tmp = t_1; elseif (z <= -9.5e-197) tmp = x - (t * (y / z)); elseif (z <= 8.5e+41) tmp = x + (y * (t / a)); 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.55e+32], t$95$1, If[LessEqual[z, -9.5e-197], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+41], N[(x + N[(y * N[(t / a), $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.55 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-197}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+41}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.54999999999999997e32 or 8.49999999999999938e41 < z Initial program 66.1%
Taylor expanded in t around 0 62.3%
associate-/l*89.3%
Simplified89.3%
if -1.54999999999999997e32 < z < -9.5000000000000003e-197Initial program 95.9%
associate-/l*93.3%
*-commutative93.3%
Applied egg-rr93.3%
Taylor expanded in z around 0 84.3%
neg-mul-184.3%
Simplified84.3%
Taylor expanded in z around inf 65.5%
mul-1-neg65.5%
associate-/l*66.2%
distribute-lft-neg-in66.2%
Simplified66.2%
if -9.5000000000000003e-197 < z < 8.49999999999999938e41Initial program 97.8%
associate-/l*95.9%
*-commutative95.9%
Applied egg-rr95.9%
Taylor expanded in z around 0 84.5%
Final simplification83.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.06e+78)
(+ x y)
(if (<= z -6e-196)
(- x (* t (/ y z)))
(if (<= z 8.8e+117) (+ x (* y (/ t a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.06e+78) {
tmp = x + y;
} else if (z <= -6e-196) {
tmp = x - (t * (y / z));
} else if (z <= 8.8e+117) {
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 <= (-1.06d+78)) then
tmp = x + y
else if (z <= (-6d-196)) then
tmp = x - (t * (y / z))
else if (z <= 8.8d+117) 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 <= -1.06e+78) {
tmp = x + y;
} else if (z <= -6e-196) {
tmp = x - (t * (y / z));
} else if (z <= 8.8e+117) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.06e+78: tmp = x + y elif z <= -6e-196: tmp = x - (t * (y / z)) elif z <= 8.8e+117: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.06e+78) tmp = Float64(x + y); elseif (z <= -6e-196) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 8.8e+117) 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 <= -1.06e+78) tmp = x + y; elseif (z <= -6e-196) tmp = x - (t * (y / z)); elseif (z <= 8.8e+117) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.06e+78], N[(x + y), $MachinePrecision], If[LessEqual[z, -6e-196], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e+117], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{+78}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-196}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+117}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.06e78 or 8.80000000000000056e117 < z Initial program 61.9%
+-commutative61.9%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 83.7%
+-commutative83.7%
Simplified83.7%
if -1.06e78 < z < -6e-196Initial program 95.0%
associate-/l*94.6%
*-commutative94.6%
Applied egg-rr94.6%
Taylor expanded in z around 0 80.7%
neg-mul-180.7%
Simplified80.7%
Taylor expanded in z around inf 64.0%
mul-1-neg64.0%
associate-/l*66.3%
distribute-lft-neg-in66.3%
Simplified66.3%
if -6e-196 < z < 8.80000000000000056e117Initial program 93.8%
associate-/l*96.5%
*-commutative96.5%
Applied egg-rr96.5%
Taylor expanded in z around 0 81.5%
Final simplification79.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.1e+50)
(+ x y)
(if (<= z -6e-196)
(- x (/ (* y t) z))
(if (<= z 8.8e+117) (+ x (* y (/ t a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.1e+50) {
tmp = x + y;
} else if (z <= -6e-196) {
tmp = x - ((y * t) / z);
} else if (z <= 8.8e+117) {
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 <= (-2.1d+50)) then
tmp = x + y
else if (z <= (-6d-196)) then
tmp = x - ((y * t) / z)
else if (z <= 8.8d+117) 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 <= -2.1e+50) {
tmp = x + y;
} else if (z <= -6e-196) {
tmp = x - ((y * t) / z);
} else if (z <= 8.8e+117) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.1e+50: tmp = x + y elif z <= -6e-196: tmp = x - ((y * t) / z) elif z <= 8.8e+117: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.1e+50) tmp = Float64(x + y); elseif (z <= -6e-196) tmp = Float64(x - Float64(Float64(y * t) / z)); elseif (z <= 8.8e+117) 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 <= -2.1e+50) tmp = x + y; elseif (z <= -6e-196) tmp = x - ((y * t) / z); elseif (z <= 8.8e+117) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.1e+50], N[(x + y), $MachinePrecision], If[LessEqual[z, -6e-196], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e+117], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+50}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-196}:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+117}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.1e50 or 8.80000000000000056e117 < z Initial program 63.3%
+-commutative63.3%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 83.0%
+-commutative83.0%
Simplified83.0%
if -2.1e50 < z < -6e-196Initial program 96.3%
associate-/l*94.0%
*-commutative94.0%
Applied egg-rr94.0%
Taylor expanded in z around 0 80.1%
neg-mul-180.1%
Simplified80.1%
Taylor expanded in z around inf 63.3%
mul-1-neg63.3%
unsub-neg63.3%
*-commutative63.3%
Simplified63.3%
if -6e-196 < z < 8.80000000000000056e117Initial program 93.8%
associate-/l*96.5%
*-commutative96.5%
Applied egg-rr96.5%
Taylor expanded in z around 0 81.5%
Final simplification78.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.8e+146)
(+ x y)
(if (<= z -6e-196)
(- x (* y (/ t z)))
(if (<= z 8.8e+117) (+ x (* y (/ t a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.8e+146) {
tmp = x + y;
} else if (z <= -6e-196) {
tmp = x - (y * (t / z));
} else if (z <= 8.8e+117) {
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 <= (-6.8d+146)) then
tmp = x + y
else if (z <= (-6d-196)) then
tmp = x - (y * (t / z))
else if (z <= 8.8d+117) 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 <= -6.8e+146) {
tmp = x + y;
} else if (z <= -6e-196) {
tmp = x - (y * (t / z));
} else if (z <= 8.8e+117) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.8e+146: tmp = x + y elif z <= -6e-196: tmp = x - (y * (t / z)) elif z <= 8.8e+117: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.8e+146) tmp = Float64(x + y); elseif (z <= -6e-196) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 8.8e+117) 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 <= -6.8e+146) tmp = x + y; elseif (z <= -6e-196) tmp = x - (y * (t / z)); elseif (z <= 8.8e+117) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.8e+146], N[(x + y), $MachinePrecision], If[LessEqual[z, -6e-196], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e+117], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+146}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-196}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+117}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -6.79999999999999981e146 or 8.80000000000000056e117 < z Initial program 55.7%
+-commutative55.7%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 84.7%
+-commutative84.7%
Simplified84.7%
if -6.79999999999999981e146 < z < -6e-196Initial program 92.5%
associate-/l*96.0%
*-commutative96.0%
Applied egg-rr96.0%
Taylor expanded in z around 0 80.5%
neg-mul-180.5%
Simplified80.5%
Taylor expanded in z around inf 65.7%
mul-1-neg65.7%
unsub-neg65.7%
*-commutative65.7%
Simplified65.7%
add-cube-cbrt65.5%
*-commutative65.5%
times-frac66.9%
add-sqr-sqrt31.8%
sqrt-unprod44.2%
sqr-neg44.2%
sqrt-unprod20.2%
add-sqr-sqrt36.8%
times-frac38.2%
add-cube-cbrt38.2%
associate-*l/36.8%
add-sqr-sqrt20.2%
sqrt-unprod44.3%
sqr-neg44.3%
sqrt-unprod31.9%
add-sqr-sqrt67.2%
Applied egg-rr67.2%
if -6e-196 < z < 8.80000000000000056e117Initial program 93.8%
associate-/l*96.5%
*-commutative96.5%
Applied egg-rr96.5%
Taylor expanded in z around 0 81.5%
Final simplification78.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.7e+35) (+ x (* y (/ (- z t) z))) (if (<= z 5.2e+52) (+ x (* t (/ y (- a z)))) (+ x (/ y (/ (- z a) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.7e+35) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 5.2e+52) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / ((z - 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 <= (-5.7d+35)) then
tmp = x + (y * ((z - t) / z))
else if (z <= 5.2d+52) then
tmp = x + (t * (y / (a - z)))
else
tmp = x + (y / ((z - 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 <= -5.7e+35) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 5.2e+52) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.7e+35: tmp = x + (y * ((z - t) / z)) elif z <= 5.2e+52: tmp = x + (t * (y / (a - z))) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.7e+35) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); elseif (z <= 5.2e+52) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.7e+35) tmp = x + (y * ((z - t) / z)); elseif (z <= 5.2e+52) tmp = x + (t * (y / (a - z))); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.7e+35], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+52], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.7 \cdot 10^{+35}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+52}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if z < -5.69999999999999993e35Initial program 66.7%
+-commutative66.7%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 65.0%
+-commutative65.0%
associate-/l*94.4%
Simplified94.4%
if -5.69999999999999993e35 < z < 5.2e52Initial program 96.6%
Taylor expanded in t around inf 91.1%
mul-1-neg91.1%
associate-/l*92.3%
distribute-rgt-neg-in92.3%
distribute-frac-neg292.3%
Simplified92.3%
if 5.2e52 < z Initial program 64.6%
associate-/l*99.9%
*-commutative99.9%
Applied egg-rr99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 95.7%
Final simplification93.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.45e+35) (+ x (* y (/ (- z t) z))) (if (<= z 3.6e+56) (+ x (* y (/ t (- a z)))) (+ x (/ y (/ (- z a) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e+35) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 3.6e+56) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y / ((z - 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 <= (-1.45d+35)) then
tmp = x + (y * ((z - t) / z))
else if (z <= 3.6d+56) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (y / ((z - 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 <= -1.45e+35) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 3.6e+56) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.45e+35: tmp = x + (y * ((z - t) / z)) elif z <= 3.6e+56: tmp = x + (y * (t / (a - z))) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.45e+35) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); elseif (z <= 3.6e+56) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.45e+35) tmp = x + (y * ((z - t) / z)); elseif (z <= 3.6e+56) tmp = x + (y * (t / (a - z))); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.45e+35], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+56], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+35}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+56}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if z < -1.44999999999999997e35Initial program 66.7%
+-commutative66.7%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 65.0%
+-commutative65.0%
associate-/l*94.4%
Simplified94.4%
if -1.44999999999999997e35 < z < 3.59999999999999998e56Initial program 96.6%
associate-/l*95.2%
*-commutative95.2%
Applied egg-rr95.2%
Taylor expanded in z around 0 89.6%
neg-mul-189.6%
Simplified89.6%
Taylor expanded in x around 0 91.1%
*-commutative91.1%
associate-*r/89.6%
neg-mul-189.6%
sub-neg89.6%
Simplified89.6%
if 3.59999999999999998e56 < z Initial program 64.6%
associate-/l*99.9%
*-commutative99.9%
Applied egg-rr99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 95.7%
Final simplification92.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -6e-196) (+ x (* y (/ (- z t) z))) (if (<= z 1.2e+42) (+ x (* y (/ t a))) (+ x (/ y (/ (- z a) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e-196) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 1.2e+42) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y / ((z - 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 <= (-6d-196)) then
tmp = x + (y * ((z - t) / z))
else if (z <= 1.2d+42) then
tmp = x + (y * (t / a))
else
tmp = x + (y / ((z - 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 <= -6e-196) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 1.2e+42) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6e-196: tmp = x + (y * ((z - t) / z)) elif z <= 1.2e+42: tmp = x + (y * (t / a)) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e-196) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); elseif (z <= 1.2e+42) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6e-196) tmp = x + (y * ((z - t) / z)); elseif (z <= 1.2e+42) tmp = x + (y * (t / a)); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e-196], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+42], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-196}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+42}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if z < -6e-196Initial program 79.3%
+-commutative79.3%
associate-/l*97.1%
fma-define97.1%
Simplified97.1%
Taylor expanded in a around 0 65.2%
+-commutative65.2%
associate-/l*80.3%
Simplified80.3%
if -6e-196 < z < 1.1999999999999999e42Initial program 97.8%
associate-/l*95.9%
*-commutative95.9%
Applied egg-rr95.9%
Taylor expanded in z around 0 84.5%
if 1.1999999999999999e42 < z Initial program 64.9%
associate-/l*99.8%
*-commutative99.8%
Applied egg-rr99.8%
*-commutative99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 92.7%
Final simplification84.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -6e-196) (+ x (/ (- z t) (/ z y))) (if (<= z 8.5e+41) (+ x (* y (/ t a))) (+ x (/ y (/ (- z a) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e-196) {
tmp = x + ((z - t) / (z / y));
} else if (z <= 8.5e+41) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y / ((z - 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 <= (-6d-196)) then
tmp = x + ((z - t) / (z / y))
else if (z <= 8.5d+41) then
tmp = x + (y * (t / a))
else
tmp = x + (y / ((z - 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 <= -6e-196) {
tmp = x + ((z - t) / (z / y));
} else if (z <= 8.5e+41) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6e-196: tmp = x + ((z - t) / (z / y)) elif z <= 8.5e+41: tmp = x + (y * (t / a)) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e-196) tmp = Float64(x + Float64(Float64(z - t) / Float64(z / y))); elseif (z <= 8.5e+41) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6e-196) tmp = x + ((z - t) / (z / y)); elseif (z <= 8.5e+41) tmp = x + (y * (t / a)); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e-196], N[(x + N[(N[(z - t), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+41], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-196}:\\
\;\;\;\;x + \frac{z - t}{\frac{z}{y}}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+41}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if z < -6e-196Initial program 79.3%
associate-/l*97.1%
*-commutative97.1%
Applied egg-rr97.1%
associate-*l/79.3%
associate-*r/95.4%
clear-num95.2%
un-div-inv95.3%
Applied egg-rr95.3%
Taylor expanded in z around inf 78.6%
if -6e-196 < z < 8.49999999999999938e41Initial program 97.8%
associate-/l*95.9%
*-commutative95.9%
Applied egg-rr95.9%
Taylor expanded in z around 0 84.5%
if 8.49999999999999938e41 < z Initial program 64.9%
associate-/l*99.8%
*-commutative99.8%
Applied egg-rr99.8%
*-commutative99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 92.7%
Final simplification84.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.12e+23) (not (<= z 8.8e+117))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.12e+23) || !(z <= 8.8e+117)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.12d+23)) .or. (.not. (z <= 8.8d+117))) then
tmp = x + y
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.12e+23) || !(z <= 8.8e+117)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.12e+23) or not (z <= 8.8e+117): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.12e+23) || !(z <= 8.8e+117)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.12e+23) || ~((z <= 8.8e+117))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.12e+23], N[Not[LessEqual[z, 8.8e+117]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{+23} \lor \neg \left(z \leq 8.8 \cdot 10^{+117}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.12e23 or 8.80000000000000056e117 < z Initial program 66.1%
+-commutative66.1%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 80.6%
+-commutative80.6%
Simplified80.6%
if -1.12e23 < z < 8.80000000000000056e117Initial program 94.3%
+-commutative94.3%
associate-/l*95.5%
fma-define95.5%
Simplified95.5%
Taylor expanded in z around 0 72.1%
+-commutative72.1%
associate-/l*72.8%
Simplified72.8%
Final simplification76.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.12e+23) (not (<= z 1e+50))) (+ x y) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.12e+23) || !(z <= 1e+50)) {
tmp = x + y;
} else {
tmp = x + ((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) :: tmp
if ((z <= (-1.12d+23)) .or. (.not. (z <= 1d+50))) then
tmp = x + y
else
tmp = x + ((y * t) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.12e+23) || !(z <= 1e+50)) {
tmp = x + y;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.12e+23) or not (z <= 1e+50): tmp = x + y else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.12e+23) || !(z <= 1e+50)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.12e+23) || ~((z <= 1e+50))) tmp = x + y; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.12e+23], N[Not[LessEqual[z, 1e+50]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{+23} \lor \neg \left(z \leq 10^{+50}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.12e23 or 1.0000000000000001e50 < z Initial program 66.3%
+-commutative66.3%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 78.4%
+-commutative78.4%
Simplified78.4%
if -1.12e23 < z < 1.0000000000000001e50Initial program 97.2%
Taylor expanded in z around 0 73.4%
Final simplification75.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.5e+23) (not (<= z 1.12e+118))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e+23) || !(z <= 1.12e+118)) {
tmp = x + y;
} else {
tmp = x + (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) :: tmp
if ((z <= (-4.5d+23)) .or. (.not. (z <= 1.12d+118))) then
tmp = x + y
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.5e+23) || !(z <= 1.12e+118)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.5e+23) or not (z <= 1.12e+118): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.5e+23) || !(z <= 1.12e+118)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.5e+23) || ~((z <= 1.12e+118))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e+23], N[Not[LessEqual[z, 1.12e+118]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+23} \lor \neg \left(z \leq 1.12 \cdot 10^{+118}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -4.49999999999999979e23 or 1.11999999999999999e118 < z Initial program 66.1%
+-commutative66.1%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 80.6%
+-commutative80.6%
Simplified80.6%
if -4.49999999999999979e23 < z < 1.11999999999999999e118Initial program 94.3%
associate-/l*95.5%
*-commutative95.5%
Applied egg-rr95.5%
Taylor expanded in z around 0 72.3%
Final simplification75.7%
(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}
Initial program 82.7%
associate-/l*97.3%
*-commutative97.3%
Applied egg-rr97.3%
Final simplification97.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.5e+154) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.5e+154) {
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 (a <= (-3.5d+154)) 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 (a <= -3.5e+154) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.5e+154: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.5e+154) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.5e+154) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.5e+154], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{+154}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -3.5000000000000002e154Initial program 70.8%
+-commutative70.8%
associate-/l*96.8%
fma-define96.8%
Simplified96.8%
Taylor expanded in y around 0 66.8%
if -3.5000000000000002e154 < a Initial program 84.2%
+-commutative84.2%
associate-/l*97.4%
fma-define97.4%
Simplified97.4%
Taylor expanded in z around inf 59.5%
+-commutative59.5%
Simplified59.5%
Final simplification60.3%
(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 82.7%
+-commutative82.7%
associate-/l*97.3%
fma-define97.3%
Simplified97.3%
Taylor expanded in y around 0 46.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 2024146
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (/ (* y (- z t)) (- z a))))