
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
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 = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
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 = ((60.0d0 * (x - y)) / (z - t)) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((60.0 * (x - y)) / (z - t)) + (a * 120.0);
}
def code(x, y, z, t, a): return ((60.0 * (x - y)) / (z - t)) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(60.0 * Float64(x - y)) / Float64(z - t)) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = ((60.0 * (x - y)) / (z - t)) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(60.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60 \cdot \left(x - y\right)}{z - t} + a \cdot 120
\end{array}
(FPCore (x y z t a) :precision binary64 (fma a 120.0 (/ 60.0 (/ (- z t) (- x y)))))
double code(double x, double y, double z, double t, double a) {
return fma(a, 120.0, (60.0 / ((z - t) / (x - y))));
}
function code(x, y, z, t, a) return fma(a, 120.0, Float64(60.0 / Float64(Float64(z - t) / Float64(x - y)))) end
code[x_, y_, z_, t_, a_] := N[(a * 120.0 + N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, 120, \frac{60}{\frac{z - t}{x - y}}\right)
\end{array}
Initial program 99.0%
associate-/l*99.8%
Simplified99.8%
+-commutative99.8%
fma-define99.8%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -10000000000000.0)
(* a 120.0)
(if (<= (* a 120.0) 20000000000000.0)
(/ 60.0 (/ (- z t) (- x y)))
(if (<= (* a 120.0) 2e+78)
(+ (* a 120.0) (* 60.0 (/ x z)))
(* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -10000000000000.0) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 20000000000000.0) {
tmp = 60.0 / ((z - t) / (x - y));
} else if ((a * 120.0) <= 2e+78) {
tmp = (a * 120.0) + (60.0 * (x / z));
} else {
tmp = a * 120.0;
}
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 * 120.0d0) <= (-10000000000000.0d0)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 20000000000000.0d0) then
tmp = 60.0d0 / ((z - t) / (x - y))
else if ((a * 120.0d0) <= 2d+78) then
tmp = (a * 120.0d0) + (60.0d0 * (x / z))
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -10000000000000.0) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 20000000000000.0) {
tmp = 60.0 / ((z - t) / (x - y));
} else if ((a * 120.0) <= 2e+78) {
tmp = (a * 120.0) + (60.0 * (x / z));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -10000000000000.0: tmp = a * 120.0 elif (a * 120.0) <= 20000000000000.0: tmp = 60.0 / ((z - t) / (x - y)) elif (a * 120.0) <= 2e+78: tmp = (a * 120.0) + (60.0 * (x / z)) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -10000000000000.0) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 20000000000000.0) tmp = Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))); elseif (Float64(a * 120.0) <= 2e+78) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / z))); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -10000000000000.0) tmp = a * 120.0; elseif ((a * 120.0) <= 20000000000000.0) tmp = 60.0 / ((z - t) / (x - y)); elseif ((a * 120.0) <= 2e+78) tmp = (a * 120.0) + (60.0 * (x / z)); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -10000000000000.0], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 20000000000000.0], N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 2e+78], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -10000000000000:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 20000000000000:\\
\;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\
\mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{+78}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -1e13 or 2.00000000000000002e78 < (*.f64 a #s(literal 120 binary64)) Initial program 98.9%
*-commutative98.9%
associate-/l*99.9%
fma-define99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
distribute-frac-neg299.9%
distribute-neg-frac99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 80.5%
if -1e13 < (*.f64 a #s(literal 120 binary64)) < 2e13Initial program 99.0%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 78.4%
clear-num78.4%
un-div-inv78.4%
Applied egg-rr78.4%
if 2e13 < (*.f64 a #s(literal 120 binary64)) < 2.00000000000000002e78Initial program 99.8%
associate-/l*99.9%
Simplified99.9%
+-commutative99.9%
fma-define99.9%
clear-num99.6%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 82.6%
Taylor expanded in z around inf 73.7%
Final simplification78.8%
(FPCore (x y z t a)
:precision binary64
(if (<= (* a 120.0) -10000000000000.0)
(* a 120.0)
(if (<= (* a 120.0) 20000000000000.0)
(* 60.0 (/ (- x y) (- z t)))
(if (<= (* a 120.0) 2e+78)
(+ (* a 120.0) (* 60.0 (/ x z)))
(* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -10000000000000.0) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 20000000000000.0) {
tmp = 60.0 * ((x - y) / (z - t));
} else if ((a * 120.0) <= 2e+78) {
tmp = (a * 120.0) + (60.0 * (x / z));
} else {
tmp = a * 120.0;
}
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 * 120.0d0) <= (-10000000000000.0d0)) then
tmp = a * 120.0d0
else if ((a * 120.0d0) <= 20000000000000.0d0) then
tmp = 60.0d0 * ((x - y) / (z - t))
else if ((a * 120.0d0) <= 2d+78) then
tmp = (a * 120.0d0) + (60.0d0 * (x / z))
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a * 120.0) <= -10000000000000.0) {
tmp = a * 120.0;
} else if ((a * 120.0) <= 20000000000000.0) {
tmp = 60.0 * ((x - y) / (z - t));
} else if ((a * 120.0) <= 2e+78) {
tmp = (a * 120.0) + (60.0 * (x / z));
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a * 120.0) <= -10000000000000.0: tmp = a * 120.0 elif (a * 120.0) <= 20000000000000.0: tmp = 60.0 * ((x - y) / (z - t)) elif (a * 120.0) <= 2e+78: tmp = (a * 120.0) + (60.0 * (x / z)) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a * 120.0) <= -10000000000000.0) tmp = Float64(a * 120.0); elseif (Float64(a * 120.0) <= 20000000000000.0) tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); elseif (Float64(a * 120.0) <= 2e+78) tmp = Float64(Float64(a * 120.0) + Float64(60.0 * Float64(x / z))); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a * 120.0) <= -10000000000000.0) tmp = a * 120.0; elseif ((a * 120.0) <= 20000000000000.0) tmp = 60.0 * ((x - y) / (z - t)); elseif ((a * 120.0) <= 2e+78) tmp = (a * 120.0) + (60.0 * (x / z)); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a * 120.0), $MachinePrecision], -10000000000000.0], N[(a * 120.0), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 20000000000000.0], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 120.0), $MachinePrecision], 2e+78], N[(N[(a * 120.0), $MachinePrecision] + N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot 120 \leq -10000000000000:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \cdot 120 \leq 20000000000000:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\mathbf{elif}\;a \cdot 120 \leq 2 \cdot 10^{+78}:\\
\;\;\;\;a \cdot 120 + 60 \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if (*.f64 a #s(literal 120 binary64)) < -1e13 or 2.00000000000000002e78 < (*.f64 a #s(literal 120 binary64)) Initial program 98.9%
*-commutative98.9%
associate-/l*99.9%
fma-define99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
distribute-frac-neg299.9%
distribute-neg-frac99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 80.5%
if -1e13 < (*.f64 a #s(literal 120 binary64)) < 2e13Initial program 99.0%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 78.4%
if 2e13 < (*.f64 a #s(literal 120 binary64)) < 2.00000000000000002e78Initial program 99.8%
associate-/l*99.9%
Simplified99.9%
+-commutative99.9%
fma-define99.9%
clear-num99.6%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 82.6%
Taylor expanded in z around inf 73.7%
Final simplification78.8%
(FPCore (x y z t a)
:precision binary64
(if (<= a -6.8e-48)
(* a 120.0)
(if (<= a -7.5e-264)
(* 60.0 (/ (- x y) z))
(if (<= a 1.12e-11) (* -60.0 (/ (- x y) t)) (* a 120.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.8e-48) {
tmp = a * 120.0;
} else if (a <= -7.5e-264) {
tmp = 60.0 * ((x - y) / z);
} else if (a <= 1.12e-11) {
tmp = -60.0 * ((x - y) / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-6.8d-48)) then
tmp = a * 120.0d0
else if (a <= (-7.5d-264)) then
tmp = 60.0d0 * ((x - y) / z)
else if (a <= 1.12d-11) then
tmp = (-60.0d0) * ((x - y) / t)
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.8e-48) {
tmp = a * 120.0;
} else if (a <= -7.5e-264) {
tmp = 60.0 * ((x - y) / z);
} else if (a <= 1.12e-11) {
tmp = -60.0 * ((x - y) / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.8e-48: tmp = a * 120.0 elif a <= -7.5e-264: tmp = 60.0 * ((x - y) / z) elif a <= 1.12e-11: tmp = -60.0 * ((x - y) / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.8e-48) tmp = Float64(a * 120.0); elseif (a <= -7.5e-264) tmp = Float64(60.0 * Float64(Float64(x - y) / z)); elseif (a <= 1.12e-11) tmp = Float64(-60.0 * Float64(Float64(x - y) / t)); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6.8e-48) tmp = a * 120.0; elseif (a <= -7.5e-264) tmp = 60.0 * ((x - y) / z); elseif (a <= 1.12e-11) tmp = -60.0 * ((x - y) / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.8e-48], N[(a * 120.0), $MachinePrecision], If[LessEqual[a, -7.5e-264], N[(60.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.12e-11], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{-48}:\\
\;\;\;\;a \cdot 120\\
\mathbf{elif}\;a \leq -7.5 \cdot 10^{-264}:\\
\;\;\;\;60 \cdot \frac{x - y}{z}\\
\mathbf{elif}\;a \leq 1.12 \cdot 10^{-11}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if a < -6.80000000000000056e-48 or 1.1200000000000001e-11 < a Initial program 99.2%
*-commutative99.2%
associate-/l*99.9%
fma-define99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
distribute-frac-neg299.9%
distribute-neg-frac99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 70.1%
if -6.80000000000000056e-48 < a < -7.5000000000000001e-264Initial program 97.2%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in a around 0 83.4%
Taylor expanded in z around inf 54.2%
if -7.5000000000000001e-264 < a < 1.1200000000000001e-11Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 82.3%
Taylor expanded in z around 0 49.7%
Final simplification61.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -1.9e-10) (not (<= x 1.85e+84))) (+ (/ (* 60.0 x) (- z t)) (* a 120.0)) (+ (/ (* y -60.0) (- z t)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -1.9e-10) || !(x <= 1.85e+84)) {
tmp = ((60.0 * x) / (z - t)) + (a * 120.0);
} else {
tmp = ((y * -60.0) / (z - t)) + (a * 120.0);
}
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 ((x <= (-1.9d-10)) .or. (.not. (x <= 1.85d+84))) then
tmp = ((60.0d0 * x) / (z - t)) + (a * 120.0d0)
else
tmp = ((y * (-60.0d0)) / (z - t)) + (a * 120.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -1.9e-10) || !(x <= 1.85e+84)) {
tmp = ((60.0 * x) / (z - t)) + (a * 120.0);
} else {
tmp = ((y * -60.0) / (z - t)) + (a * 120.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -1.9e-10) or not (x <= 1.85e+84): tmp = ((60.0 * x) / (z - t)) + (a * 120.0) else: tmp = ((y * -60.0) / (z - t)) + (a * 120.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -1.9e-10) || !(x <= 1.85e+84)) tmp = Float64(Float64(Float64(60.0 * x) / Float64(z - t)) + Float64(a * 120.0)); else tmp = Float64(Float64(Float64(y * -60.0) / Float64(z - t)) + Float64(a * 120.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -1.9e-10) || ~((x <= 1.85e+84))) tmp = ((60.0 * x) / (z - t)) + (a * 120.0); else tmp = ((y * -60.0) / (z - t)) + (a * 120.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -1.9e-10], N[Not[LessEqual[x, 1.85e+84]], $MachinePrecision]], N[(N[(N[(60.0 * x), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{-10} \lor \neg \left(x \leq 1.85 \cdot 10^{+84}\right):\\
\;\;\;\;\frac{60 \cdot x}{z - t} + a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -60}{z - t} + a \cdot 120\\
\end{array}
\end{array}
if x < -1.8999999999999999e-10 or 1.85e84 < x Initial program 97.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 90.5%
associate-*r/88.6%
Simplified88.6%
if -1.8999999999999999e-10 < x < 1.85e84Initial program 99.8%
Taylor expanded in x around 0 91.3%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -2.4e+210) (not (<= x 3e+132))) (/ 60.0 (/ (- z t) (- x y))) (+ (/ (* y -60.0) (- z t)) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -2.4e+210) || !(x <= 3e+132)) {
tmp = 60.0 / ((z - t) / (x - y));
} else {
tmp = ((y * -60.0) / (z - t)) + (a * 120.0);
}
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 ((x <= (-2.4d+210)) .or. (.not. (x <= 3d+132))) then
tmp = 60.0d0 / ((z - t) / (x - y))
else
tmp = ((y * (-60.0d0)) / (z - t)) + (a * 120.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -2.4e+210) || !(x <= 3e+132)) {
tmp = 60.0 / ((z - t) / (x - y));
} else {
tmp = ((y * -60.0) / (z - t)) + (a * 120.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -2.4e+210) or not (x <= 3e+132): tmp = 60.0 / ((z - t) / (x - y)) else: tmp = ((y * -60.0) / (z - t)) + (a * 120.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -2.4e+210) || !(x <= 3e+132)) tmp = Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))); else tmp = Float64(Float64(Float64(y * -60.0) / Float64(z - t)) + Float64(a * 120.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -2.4e+210) || ~((x <= 3e+132))) tmp = 60.0 / ((z - t) / (x - y)); else tmp = ((y * -60.0) / (z - t)) + (a * 120.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -2.4e+210], N[Not[LessEqual[x, 3e+132]], $MachinePrecision]], N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * -60.0), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+210} \lor \neg \left(x \leq 3 \cdot 10^{+132}\right):\\
\;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot -60}{z - t} + a \cdot 120\\
\end{array}
\end{array}
if x < -2.39999999999999988e210 or 2.9999999999999998e132 < x Initial program 96.3%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 77.5%
clear-num77.5%
un-div-inv77.6%
Applied egg-rr77.6%
if -2.39999999999999988e210 < x < 2.9999999999999998e132Initial program 99.8%
Taylor expanded in x around 0 85.4%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -2.55e+210) (not (<= x 2.5e+132))) (/ 60.0 (/ (- z t) (- x y))) (+ (* y (/ -60.0 (- z t))) (* a 120.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -2.55e+210) || !(x <= 2.5e+132)) {
tmp = 60.0 / ((z - t) / (x - y));
} else {
tmp = (y * (-60.0 / (z - t))) + (a * 120.0);
}
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 ((x <= (-2.55d+210)) .or. (.not. (x <= 2.5d+132))) then
tmp = 60.0d0 / ((z - t) / (x - y))
else
tmp = (y * ((-60.0d0) / (z - t))) + (a * 120.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -2.55e+210) || !(x <= 2.5e+132)) {
tmp = 60.0 / ((z - t) / (x - y));
} else {
tmp = (y * (-60.0 / (z - t))) + (a * 120.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -2.55e+210) or not (x <= 2.5e+132): tmp = 60.0 / ((z - t) / (x - y)) else: tmp = (y * (-60.0 / (z - t))) + (a * 120.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -2.55e+210) || !(x <= 2.5e+132)) tmp = Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))); else tmp = Float64(Float64(y * Float64(-60.0 / Float64(z - t))) + Float64(a * 120.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -2.55e+210) || ~((x <= 2.5e+132))) tmp = 60.0 / ((z - t) / (x - y)); else tmp = (y * (-60.0 / (z - t))) + (a * 120.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -2.55e+210], N[Not[LessEqual[x, 2.5e+132]], $MachinePrecision]], N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(-60.0 / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.55 \cdot 10^{+210} \lor \neg \left(x \leq 2.5 \cdot 10^{+132}\right):\\
\;\;\;\;\frac{60}{\frac{z - t}{x - y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-60}{z - t} + a \cdot 120\\
\end{array}
\end{array}
if x < -2.55e210 or 2.5000000000000001e132 < x Initial program 96.3%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 77.5%
clear-num77.5%
un-div-inv77.6%
Applied egg-rr77.6%
if -2.55e210 < x < 2.5000000000000001e132Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 85.3%
associate-*r/85.4%
*-commutative85.4%
*-lft-identity85.4%
times-frac85.3%
/-rgt-identity85.3%
Simplified85.3%
Final simplification83.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1300000000.0) (not (<= a 1.7e+76))) (* a 120.0) (* 60.0 (/ (- x y) (- z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1300000000.0) || !(a <= 1.7e+76)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * ((x - y) / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1300000000.0d0)) .or. (.not. (a <= 1.7d+76))) then
tmp = a * 120.0d0
else
tmp = 60.0d0 * ((x - y) / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1300000000.0) || !(a <= 1.7e+76)) {
tmp = a * 120.0;
} else {
tmp = 60.0 * ((x - y) / (z - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1300000000.0) or not (a <= 1.7e+76): tmp = a * 120.0 else: tmp = 60.0 * ((x - y) / (z - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1300000000.0) || !(a <= 1.7e+76)) tmp = Float64(a * 120.0); else tmp = Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1300000000.0) || ~((a <= 1.7e+76))) tmp = a * 120.0; else tmp = 60.0 * ((x - y) / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1300000000.0], N[Not[LessEqual[a, 1.7e+76]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1300000000 \lor \neg \left(a \leq 1.7 \cdot 10^{+76}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;60 \cdot \frac{x - y}{z - t}\\
\end{array}
\end{array}
if a < -1.3e9 or 1.6999999999999999e76 < a Initial program 98.9%
*-commutative98.9%
associate-/l*99.9%
fma-define99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
distribute-frac-neg299.9%
distribute-neg-frac99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 80.5%
if -1.3e9 < a < 1.6999999999999999e76Initial program 99.1%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 75.1%
Final simplification77.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.08e-219) (not (<= z 2.9e-184))) (* a 120.0) (* -60.0 (/ (- x y) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.08e-219) || !(z <= 2.9e-184)) {
tmp = a * 120.0;
} else {
tmp = -60.0 * ((x - y) / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.08d-219)) .or. (.not. (z <= 2.9d-184))) then
tmp = a * 120.0d0
else
tmp = (-60.0d0) * ((x - y) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.08e-219) || !(z <= 2.9e-184)) {
tmp = a * 120.0;
} else {
tmp = -60.0 * ((x - y) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.08e-219) or not (z <= 2.9e-184): tmp = a * 120.0 else: tmp = -60.0 * ((x - y) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.08e-219) || !(z <= 2.9e-184)) tmp = Float64(a * 120.0); else tmp = Float64(-60.0 * Float64(Float64(x - y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.08e-219) || ~((z <= 2.9e-184))) tmp = a * 120.0; else tmp = -60.0 * ((x - y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.08e-219], N[Not[LessEqual[z, 2.9e-184]], $MachinePrecision]], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{-219} \lor \neg \left(z \leq 2.9 \cdot 10^{-184}\right):\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x - y}{t}\\
\end{array}
\end{array}
if z < -1.08e-219 or 2.90000000000000014e-184 < z Initial program 98.9%
*-commutative98.9%
associate-/l*99.8%
fma-define99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
distribute-frac-neg299.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 54.5%
if -1.08e-219 < z < 2.90000000000000014e-184Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 82.9%
Taylor expanded in z around 0 76.0%
Final simplification58.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -9.5e+210) (not (<= x 5.3e+135))) (* -60.0 (/ x t)) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -9.5e+210) || !(x <= 5.3e+135)) {
tmp = -60.0 * (x / t);
} else {
tmp = a * 120.0;
}
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 ((x <= (-9.5d+210)) .or. (.not. (x <= 5.3d+135))) then
tmp = (-60.0d0) * (x / t)
else
tmp = a * 120.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -9.5e+210) || !(x <= 5.3e+135)) {
tmp = -60.0 * (x / t);
} else {
tmp = a * 120.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -9.5e+210) or not (x <= 5.3e+135): tmp = -60.0 * (x / t) else: tmp = a * 120.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -9.5e+210) || !(x <= 5.3e+135)) tmp = Float64(-60.0 * Float64(x / t)); else tmp = Float64(a * 120.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -9.5e+210) || ~((x <= 5.3e+135))) tmp = -60.0 * (x / t); else tmp = a * 120.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -9.5e+210], N[Not[LessEqual[x, 5.3e+135]], $MachinePrecision]], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision], N[(a * 120.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+210} \lor \neg \left(x \leq 5.3 \cdot 10^{+135}\right):\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;a \cdot 120\\
\end{array}
\end{array}
if x < -9.5000000000000004e210 or 5.30000000000000017e135 < x Initial program 96.2%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in a around 0 77.1%
Taylor expanded in z around 0 45.7%
Taylor expanded in x around inf 45.8%
if -9.5000000000000004e210 < x < 5.30000000000000017e135Initial program 99.8%
*-commutative99.8%
associate-/l*99.8%
fma-define99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
distribute-frac-neg299.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 53.7%
Final simplification52.0%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.4e+211) (* 60.0 (/ x z)) (if (<= x 1.06e+136) (* a 120.0) (/ (* x -60.0) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.4e+211) {
tmp = 60.0 * (x / z);
} else if (x <= 1.06e+136) {
tmp = a * 120.0;
} else {
tmp = (x * -60.0) / t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-1.4d+211)) then
tmp = 60.0d0 * (x / z)
else if (x <= 1.06d+136) then
tmp = a * 120.0d0
else
tmp = (x * (-60.0d0)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.4e+211) {
tmp = 60.0 * (x / z);
} else if (x <= 1.06e+136) {
tmp = a * 120.0;
} else {
tmp = (x * -60.0) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.4e+211: tmp = 60.0 * (x / z) elif x <= 1.06e+136: tmp = a * 120.0 else: tmp = (x * -60.0) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.4e+211) tmp = Float64(60.0 * Float64(x / z)); elseif (x <= 1.06e+136) tmp = Float64(a * 120.0); else tmp = Float64(Float64(x * -60.0) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.4e+211) tmp = 60.0 * (x / z); elseif (x <= 1.06e+136) tmp = a * 120.0; else tmp = (x * -60.0) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.4e+211], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.06e+136], N[(a * 120.0), $MachinePrecision], N[(N[(x * -60.0), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+211}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\
\mathbf{elif}\;x \leq 1.06 \cdot 10^{+136}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot -60}{t}\\
\end{array}
\end{array}
if x < -1.4e211Initial program 94.6%
associate-/l*99.8%
Simplified99.8%
+-commutative99.8%
fma-define99.8%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 95.0%
Taylor expanded in z around inf 69.9%
Taylor expanded in x around inf 54.7%
if -1.4e211 < x < 1.06000000000000003e136Initial program 99.8%
*-commutative99.8%
associate-/l*99.8%
fma-define99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
distribute-frac-neg299.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 53.7%
if 1.06000000000000003e136 < x Initial program 97.1%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in a around 0 73.3%
Taylor expanded in z around 0 46.8%
Taylor expanded in x around inf 47.0%
associate-*r/47.1%
Applied egg-rr47.1%
Final simplification52.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -4.1e+210) (* 60.0 (/ x z)) (if (<= x 7.5e+135) (* a 120.0) (/ -60.0 (/ t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4.1e+210) {
tmp = 60.0 * (x / z);
} else if (x <= 7.5e+135) {
tmp = a * 120.0;
} else {
tmp = -60.0 / (t / x);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-4.1d+210)) then
tmp = 60.0d0 * (x / z)
else if (x <= 7.5d+135) then
tmp = a * 120.0d0
else
tmp = (-60.0d0) / (t / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4.1e+210) {
tmp = 60.0 * (x / z);
} else if (x <= 7.5e+135) {
tmp = a * 120.0;
} else {
tmp = -60.0 / (t / x);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -4.1e+210: tmp = 60.0 * (x / z) elif x <= 7.5e+135: tmp = a * 120.0 else: tmp = -60.0 / (t / x) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -4.1e+210) tmp = Float64(60.0 * Float64(x / z)); elseif (x <= 7.5e+135) tmp = Float64(a * 120.0); else tmp = Float64(-60.0 / Float64(t / x)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -4.1e+210) tmp = 60.0 * (x / z); elseif (x <= 7.5e+135) tmp = a * 120.0; else tmp = -60.0 / (t / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -4.1e+210], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e+135], N[(a * 120.0), $MachinePrecision], N[(-60.0 / N[(t / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.1 \cdot 10^{+210}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+135}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;\frac{-60}{\frac{t}{x}}\\
\end{array}
\end{array}
if x < -4.10000000000000001e210Initial program 94.6%
associate-/l*99.8%
Simplified99.8%
+-commutative99.8%
fma-define99.8%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 95.0%
Taylor expanded in z around inf 69.9%
Taylor expanded in x around inf 54.7%
if -4.10000000000000001e210 < x < 7.49999999999999947e135Initial program 99.8%
*-commutative99.8%
associate-/l*99.8%
fma-define99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
distribute-frac-neg299.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 53.7%
if 7.49999999999999947e135 < x Initial program 97.1%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in a around 0 73.3%
Taylor expanded in z around 0 46.8%
Taylor expanded in x around inf 47.0%
clear-num47.0%
un-div-inv47.1%
Applied egg-rr47.1%
Final simplification52.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -9.5e+210) (* 60.0 (/ x z)) (if (<= x 1.22e+135) (* a 120.0) (* -60.0 (/ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -9.5e+210) {
tmp = 60.0 * (x / z);
} else if (x <= 1.22e+135) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-9.5d+210)) then
tmp = 60.0d0 * (x / z)
else if (x <= 1.22d+135) then
tmp = a * 120.0d0
else
tmp = (-60.0d0) * (x / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -9.5e+210) {
tmp = 60.0 * (x / z);
} else if (x <= 1.22e+135) {
tmp = a * 120.0;
} else {
tmp = -60.0 * (x / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -9.5e+210: tmp = 60.0 * (x / z) elif x <= 1.22e+135: tmp = a * 120.0 else: tmp = -60.0 * (x / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -9.5e+210) tmp = Float64(60.0 * Float64(x / z)); elseif (x <= 1.22e+135) tmp = Float64(a * 120.0); else tmp = Float64(-60.0 * Float64(x / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -9.5e+210) tmp = 60.0 * (x / z); elseif (x <= 1.22e+135) tmp = a * 120.0; else tmp = -60.0 * (x / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -9.5e+210], N[(60.0 * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.22e+135], N[(a * 120.0), $MachinePrecision], N[(-60.0 * N[(x / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+210}:\\
\;\;\;\;60 \cdot \frac{x}{z}\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{+135}:\\
\;\;\;\;a \cdot 120\\
\mathbf{else}:\\
\;\;\;\;-60 \cdot \frac{x}{t}\\
\end{array}
\end{array}
if x < -9.5000000000000004e210Initial program 94.6%
associate-/l*99.8%
Simplified99.8%
+-commutative99.8%
fma-define99.8%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 95.0%
Taylor expanded in z around inf 69.9%
Taylor expanded in x around inf 54.7%
if -9.5000000000000004e210 < x < 1.21999999999999996e135Initial program 99.8%
*-commutative99.8%
associate-/l*99.8%
fma-define99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
distribute-frac-neg299.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 53.7%
if 1.21999999999999996e135 < x Initial program 97.1%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in a around 0 73.3%
Taylor expanded in z around 0 46.8%
Taylor expanded in x around inf 47.0%
Final simplification52.8%
(FPCore (x y z t a) :precision binary64 (+ (* 60.0 (/ (- x y) (- z t))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return (60.0 * ((x - y) / (z - t))) + (a * 120.0);
}
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 = (60.0d0 * ((x - y) / (z - t))) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return (60.0 * ((x - y) / (z - t))) + (a * 120.0);
}
def code(x, y, z, t, a): return (60.0 * ((x - y) / (z - t))) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(60.0 * Float64(Float64(x - y) / Float64(z - t))) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = (60.0 * ((x - y) / (z - t))) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(60.0 * N[(N[(x - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
60 \cdot \frac{x - y}{z - t} + a \cdot 120
\end{array}
Initial program 99.0%
associate-/l*99.8%
Simplified99.8%
(FPCore (x y z t a) :precision binary64 (* a 120.0))
double code(double x, double y, double z, double t, double a) {
return a * 120.0;
}
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 = a * 120.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return a * 120.0;
}
def code(x, y, z, t, a): return a * 120.0
function code(x, y, z, t, a) return Float64(a * 120.0) end
function tmp = code(x, y, z, t, a) tmp = a * 120.0; end
code[x_, y_, z_, t_, a_] := N[(a * 120.0), $MachinePrecision]
\begin{array}{l}
\\
a \cdot 120
\end{array}
Initial program 99.0%
*-commutative99.0%
associate-/l*99.8%
fma-define99.8%
sub-neg99.8%
+-commutative99.8%
neg-sub099.8%
associate-+l-99.8%
sub0-neg99.8%
distribute-frac-neg299.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 47.4%
Final simplification47.4%
(FPCore (x y z t a) :precision binary64 (+ (/ 60.0 (/ (- z t) (- x y))) (* a 120.0)))
double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
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 = (60.0d0 / ((z - t) / (x - y))) + (a * 120.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return (60.0 / ((z - t) / (x - y))) + (a * 120.0);
}
def code(x, y, z, t, a): return (60.0 / ((z - t) / (x - y))) + (a * 120.0)
function code(x, y, z, t, a) return Float64(Float64(60.0 / Float64(Float64(z - t) / Float64(x - y))) + Float64(a * 120.0)) end
function tmp = code(x, y, z, t, a) tmp = (60.0 / ((z - t) / (x - y))) + (a * 120.0); end
code[x_, y_, z_, t_, a_] := N[(N[(60.0 / N[(N[(z - t), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * 120.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{60}{\frac{z - t}{x - y}} + a \cdot 120
\end{array}
herbie shell --seed 2024181
(FPCore (x y z t a)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, B"
:precision binary64
:alt
(! :herbie-platform default (+ (/ 60 (/ (- z t) (- x y))) (* a 120)))
(+ (/ (* 60.0 (- x y)) (- z t)) (* a 120.0)))