
(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 15 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 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(z - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Initial program 98.4%
+-commutative98.4%
fma-def98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -5e+17)
(- x (* t (/ y z)))
(if (<= t_1 0.1)
(+ x (* y (/ (- t z) a)))
(if (<= t_1 2.0)
(- x (* y (/ (- t z) z)))
(if (<= t_1 1e+111)
(* y t_1)
(if (<= t_1 1e+204)
(- x (/ y (/ z t)))
(/ (* y (- t)) (- z a)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -5e+17) {
tmp = x - (t * (y / z));
} else if (t_1 <= 0.1) {
tmp = x + (y * ((t - z) / a));
} else if (t_1 <= 2.0) {
tmp = x - (y * ((t - z) / z));
} else if (t_1 <= 1e+111) {
tmp = y * t_1;
} else if (t_1 <= 1e+204) {
tmp = x - (y / (z / t));
} else {
tmp = (y * -t) / (z - a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (z - t) / (z - a)
if (t_1 <= (-5d+17)) then
tmp = x - (t * (y / z))
else if (t_1 <= 0.1d0) then
tmp = x + (y * ((t - z) / a))
else if (t_1 <= 2.0d0) then
tmp = x - (y * ((t - z) / z))
else if (t_1 <= 1d+111) then
tmp = y * t_1
else if (t_1 <= 1d+204) then
tmp = x - (y / (z / t))
else
tmp = (y * -t) / (z - a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -5e+17) {
tmp = x - (t * (y / z));
} else if (t_1 <= 0.1) {
tmp = x + (y * ((t - z) / a));
} else if (t_1 <= 2.0) {
tmp = x - (y * ((t - z) / z));
} else if (t_1 <= 1e+111) {
tmp = y * t_1;
} else if (t_1 <= 1e+204) {
tmp = x - (y / (z / t));
} else {
tmp = (y * -t) / (z - a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= -5e+17: tmp = x - (t * (y / z)) elif t_1 <= 0.1: tmp = x + (y * ((t - z) / a)) elif t_1 <= 2.0: tmp = x - (y * ((t - z) / z)) elif t_1 <= 1e+111: tmp = y * t_1 elif t_1 <= 1e+204: tmp = x - (y / (z / t)) else: tmp = (y * -t) / (z - a) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -5e+17) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (t_1 <= 0.1) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); elseif (t_1 <= 2.0) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); elseif (t_1 <= 1e+111) tmp = Float64(y * t_1); elseif (t_1 <= 1e+204) tmp = Float64(x - Float64(y / Float64(z / t))); else tmp = Float64(Float64(y * Float64(-t)) / Float64(z - a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= -5e+17) tmp = x - (t * (y / z)); elseif (t_1 <= 0.1) tmp = x + (y * ((t - z) / a)); elseif (t_1 <= 2.0) tmp = x - (y * ((t - z) / z)); elseif (t_1 <= 1e+111) tmp = y * t_1; elseif (t_1 <= 1e+204) tmp = x - (y / (z / t)); else tmp = (y * -t) / (z - a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+17], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.1], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2.0], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+111], N[(y * t$95$1), $MachinePrecision], If[LessEqual[t$95$1, 1e+204], N[(x - N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * (-t)), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+17}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;t\_1 \leq 0.1:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{elif}\;t\_1 \leq 10^{+111}:\\
\;\;\;\;y \cdot t\_1\\
\mathbf{elif}\;t\_1 \leq 10^{+204}:\\
\;\;\;\;x - \frac{y}{\frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(-t\right)}{z - a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -5e17Initial program 97.0%
Taylor expanded in a around 0 76.9%
Taylor expanded in z around 0 68.5%
associate-*r/68.5%
*-commutative68.5%
neg-mul-168.5%
distribute-rgt-neg-in68.5%
Simplified68.5%
Taylor expanded in x around 0 68.5%
mul-1-neg68.5%
associate-*r/77.0%
distribute-lft-neg-in77.0%
cancel-sign-sub-inv77.0%
Simplified77.0%
if -5e17 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.10000000000000001Initial program 99.6%
Taylor expanded in a around inf 85.7%
mul-1-neg85.7%
unsub-neg85.7%
*-lft-identity85.7%
times-frac97.1%
/-rgt-identity97.1%
Simplified97.1%
if 0.10000000000000001 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2Initial program 100.0%
Taylor expanded in a around 0 99.9%
if 2 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.99999999999999957e110Initial program 99.7%
add-cube-cbrt98.3%
pow398.4%
+-commutative98.4%
fma-udef98.4%
Applied egg-rr98.4%
Taylor expanded in x around 0 73.4%
pow-base-173.4%
associate-*r/89.1%
*-lft-identity89.1%
Simplified89.1%
if 9.99999999999999957e110 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.99999999999999989e203Initial program 100.0%
Taylor expanded in a around 0 75.8%
Taylor expanded in z around 0 87.5%
associate-*r/87.5%
*-commutative87.5%
neg-mul-187.5%
distribute-rgt-neg-in87.5%
Simplified87.5%
div-inv87.3%
add-sqr-sqrt50.0%
sqrt-unprod26.2%
sqr-neg26.2%
sqrt-unprod12.8%
add-sqr-sqrt38.9%
distribute-rgt-neg-in38.9%
cancel-sign-sub-inv38.9%
div-inv38.9%
associate-/l*38.9%
add-sqr-sqrt12.8%
sqrt-unprod26.2%
sqr-neg26.2%
sqrt-unprod50.2%
add-sqr-sqrt87.7%
Applied egg-rr87.7%
if 9.99999999999999989e203 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 84.3%
Taylor expanded in y around 0 100.0%
associate-*r/84.3%
*-commutative84.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
associate-*l/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 93.3%
mul-1-neg93.3%
*-commutative93.3%
distribute-neg-frac93.3%
Simplified93.3%
Final simplification94.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -5e+17)
(- x (* t (/ y z)))
(if (<= t_1 0.1)
(+ x (* y (/ t a)))
(if (<= t_1 2.0) (+ y x) (* y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -5e+17) {
tmp = x - (t * (y / z));
} else if (t_1 <= 0.1) {
tmp = x + (y * (t / a));
} else if (t_1 <= 2.0) {
tmp = y + x;
} else {
tmp = y * t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (z - t) / (z - a)
if (t_1 <= (-5d+17)) then
tmp = x - (t * (y / z))
else if (t_1 <= 0.1d0) then
tmp = x + (y * (t / a))
else if (t_1 <= 2.0d0) then
tmp = y + x
else
tmp = y * t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -5e+17) {
tmp = x - (t * (y / z));
} else if (t_1 <= 0.1) {
tmp = x + (y * (t / a));
} else if (t_1 <= 2.0) {
tmp = y + x;
} else {
tmp = y * t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= -5e+17: tmp = x - (t * (y / z)) elif t_1 <= 0.1: tmp = x + (y * (t / a)) elif t_1 <= 2.0: tmp = y + x else: tmp = y * t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -5e+17) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (t_1 <= 0.1) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (t_1 <= 2.0) tmp = Float64(y + x); else tmp = Float64(y * t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= -5e+17) tmp = x - (t * (y / z)); elseif (t_1 <= 0.1) tmp = x + (y * (t / a)); elseif (t_1 <= 2.0) tmp = y + x; else tmp = y * t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+17], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.1], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2.0], N[(y + x), $MachinePrecision], N[(y * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+17}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;t\_1 \leq 0.1:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -5e17Initial program 97.0%
Taylor expanded in a around 0 76.9%
Taylor expanded in z around 0 68.5%
associate-*r/68.5%
*-commutative68.5%
neg-mul-168.5%
distribute-rgt-neg-in68.5%
Simplified68.5%
Taylor expanded in x around 0 68.5%
mul-1-neg68.5%
associate-*r/77.0%
distribute-lft-neg-in77.0%
cancel-sign-sub-inv77.0%
Simplified77.0%
if -5e17 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.10000000000000001Initial program 99.6%
Taylor expanded in z around 0 78.8%
+-commutative78.8%
*-commutative78.8%
*-lft-identity78.8%
times-frac84.2%
/-rgt-identity84.2%
Simplified84.2%
if 0.10000000000000001 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2Initial program 100.0%
Taylor expanded in z around inf 99.2%
+-commutative99.2%
Simplified99.2%
if 2 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 93.7%
add-cube-cbrt92.6%
pow392.6%
+-commutative92.6%
fma-udef92.6%
Applied egg-rr92.6%
Taylor expanded in x around 0 77.2%
pow-base-177.2%
associate-*r/78.0%
*-lft-identity78.0%
Simplified78.0%
Final simplification88.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (- x (/ (* y t) (- z a)))))
(if (<= t_1 -50000000000.0)
t_2
(if (<= t_1 0.1)
(+ x (* y (/ (- t z) a)))
(if (<= t_1 50000.0) (- x (* y (/ (- t z) z))) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = x - ((y * t) / (z - a));
double tmp;
if (t_1 <= -50000000000.0) {
tmp = t_2;
} else if (t_1 <= 0.1) {
tmp = x + (y * ((t - z) / a));
} else if (t_1 <= 50000.0) {
tmp = x - (y * ((t - z) / z));
} 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 = (z - t) / (z - a)
t_2 = x - ((y * t) / (z - a))
if (t_1 <= (-50000000000.0d0)) then
tmp = t_2
else if (t_1 <= 0.1d0) then
tmp = x + (y * ((t - z) / a))
else if (t_1 <= 50000.0d0) then
tmp = x - (y * ((t - z) / z))
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 = (z - t) / (z - a);
double t_2 = x - ((y * t) / (z - a));
double tmp;
if (t_1 <= -50000000000.0) {
tmp = t_2;
} else if (t_1 <= 0.1) {
tmp = x + (y * ((t - z) / a));
} else if (t_1 <= 50000.0) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = x - ((y * t) / (z - a)) tmp = 0 if t_1 <= -50000000000.0: tmp = t_2 elif t_1 <= 0.1: tmp = x + (y * ((t - z) / a)) elif t_1 <= 50000.0: tmp = x - (y * ((t - z) / z)) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(x - Float64(Float64(y * t) / Float64(z - a))) tmp = 0.0 if (t_1 <= -50000000000.0) tmp = t_2; elseif (t_1 <= 0.1) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); elseif (t_1 <= 50000.0) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = x - ((y * t) / (z - a)); tmp = 0.0; if (t_1 <= -50000000000.0) tmp = t_2; elseif (t_1 <= 0.1) tmp = x + (y * ((t - z) / a)); elseif (t_1 <= 50000.0) tmp = x - (y * ((t - z) / z)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(y * t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -50000000000.0], t$95$2, If[LessEqual[t$95$1, 0.1], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 50000.0], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := x - \frac{y \cdot t}{z - a}\\
\mathbf{if}\;t\_1 \leq -50000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0.1:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{elif}\;t\_1 \leq 50000:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -5e10 or 5e4 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 95.2%
Taylor expanded in t around inf 91.1%
associate-*r/91.1%
mul-1-neg91.1%
distribute-lft-neg-out91.1%
*-commutative91.1%
Simplified91.1%
if -5e10 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.10000000000000001Initial program 99.6%
Taylor expanded in a around inf 86.4%
mul-1-neg86.4%
unsub-neg86.4%
*-lft-identity86.4%
times-frac98.2%
/-rgt-identity98.2%
Simplified98.2%
if 0.10000000000000001 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5e4Initial program 100.0%
Taylor expanded in a around 0 99.7%
Final simplification96.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -5e+17)
(- x (* t (/ y z)))
(if (<= t_1 2.0) (+ x (* y (/ z (- z a)))) (* y t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -5e+17) {
tmp = x - (t * (y / z));
} else if (t_1 <= 2.0) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = y * t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (z - t) / (z - a)
if (t_1 <= (-5d+17)) then
tmp = x - (t * (y / z))
else if (t_1 <= 2.0d0) then
tmp = x + (y * (z / (z - a)))
else
tmp = y * t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -5e+17) {
tmp = x - (t * (y / z));
} else if (t_1 <= 2.0) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = y * t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= -5e+17: tmp = x - (t * (y / z)) elif t_1 <= 2.0: tmp = x + (y * (z / (z - a))) else: tmp = y * t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -5e+17) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (t_1 <= 2.0) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(y * t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= -5e+17) tmp = x - (t * (y / z)); elseif (t_1 <= 2.0) tmp = x + (y * (z / (z - a))); else tmp = y * t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+17], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2.0], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+17}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -5e17Initial program 97.0%
Taylor expanded in a around 0 76.9%
Taylor expanded in z around 0 68.5%
associate-*r/68.5%
*-commutative68.5%
neg-mul-168.5%
distribute-rgt-neg-in68.5%
Simplified68.5%
Taylor expanded in x around 0 68.5%
mul-1-neg68.5%
associate-*r/77.0%
distribute-lft-neg-in77.0%
cancel-sign-sub-inv77.0%
Simplified77.0%
if -5e17 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2Initial program 99.8%
Taylor expanded in t around 0 92.2%
if 2 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 93.7%
add-cube-cbrt92.6%
pow392.6%
+-commutative92.6%
fma-udef92.6%
Applied egg-rr92.6%
Taylor expanded in x around 0 77.2%
pow-base-177.2%
associate-*r/78.0%
*-lft-identity78.0%
Simplified78.0%
Final simplification87.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -9.5e-40)
(+ y x)
(if (<= z 700000000.0)
(+ x (* y (/ t a)))
(if (or (<= z 4.7e+142) (not (<= z 1.2e+181)))
(+ y x)
(- x (* t (/ y z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.5e-40) {
tmp = y + x;
} else if (z <= 700000000.0) {
tmp = x + (y * (t / a));
} else if ((z <= 4.7e+142) || !(z <= 1.2e+181)) {
tmp = y + x;
} else {
tmp = x - (t * (y / 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.5d-40)) then
tmp = y + x
else if (z <= 700000000.0d0) then
tmp = x + (y * (t / a))
else if ((z <= 4.7d+142) .or. (.not. (z <= 1.2d+181))) then
tmp = y + x
else
tmp = x - (t * (y / 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.5e-40) {
tmp = y + x;
} else if (z <= 700000000.0) {
tmp = x + (y * (t / a));
} else if ((z <= 4.7e+142) || !(z <= 1.2e+181)) {
tmp = y + x;
} else {
tmp = x - (t * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9.5e-40: tmp = y + x elif z <= 700000000.0: tmp = x + (y * (t / a)) elif (z <= 4.7e+142) or not (z <= 1.2e+181): tmp = y + x else: tmp = x - (t * (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.5e-40) tmp = Float64(y + x); elseif (z <= 700000000.0) tmp = Float64(x + Float64(y * Float64(t / a))); elseif ((z <= 4.7e+142) || !(z <= 1.2e+181)) tmp = Float64(y + x); else tmp = Float64(x - Float64(t * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9.5e-40) tmp = y + x; elseif (z <= 700000000.0) tmp = x + (y * (t / a)); elseif ((z <= 4.7e+142) || ~((z <= 1.2e+181))) tmp = y + x; else tmp = x - (t * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.5e-40], N[(y + x), $MachinePrecision], If[LessEqual[z, 700000000.0], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 4.7e+142], N[Not[LessEqual[z, 1.2e+181]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-40}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 700000000:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{+142} \lor \neg \left(z \leq 1.2 \cdot 10^{+181}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\end{array}
\end{array}
if z < -9.5000000000000006e-40 or 7e8 < z < 4.7e142 or 1.20000000000000001e181 < z Initial program 99.9%
Taylor expanded in z around inf 78.1%
+-commutative78.1%
Simplified78.1%
if -9.5000000000000006e-40 < z < 7e8Initial program 96.5%
Taylor expanded in z around 0 71.8%
+-commutative71.8%
*-commutative71.8%
*-lft-identity71.8%
times-frac73.7%
/-rgt-identity73.7%
Simplified73.7%
if 4.7e142 < z < 1.20000000000000001e181Initial program 99.7%
Taylor expanded in a around 0 83.6%
Taylor expanded in z around 0 70.3%
associate-*r/70.3%
*-commutative70.3%
neg-mul-170.3%
distribute-rgt-neg-in70.3%
Simplified70.3%
Taylor expanded in x around 0 70.3%
mul-1-neg70.3%
associate-*r/86.6%
distribute-lft-neg-in86.6%
cancel-sign-sub-inv86.6%
Simplified86.6%
Final simplification76.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (- 1.0 (/ t z)))))
(if (<= t -2.6e+184)
t_1
(if (<= t 4.8e+164)
(+ y x)
(if (<= t 3e+226)
t_1
(if (<= t 1.4e+303) (/ t (/ a y)) (* y (- (/ t z)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (1.0 - (t / z));
double tmp;
if (t <= -2.6e+184) {
tmp = t_1;
} else if (t <= 4.8e+164) {
tmp = y + x;
} else if (t <= 3e+226) {
tmp = t_1;
} else if (t <= 1.4e+303) {
tmp = t / (a / y);
} else {
tmp = y * -(t / z);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = y * (1.0d0 - (t / z))
if (t <= (-2.6d+184)) then
tmp = t_1
else if (t <= 4.8d+164) then
tmp = y + x
else if (t <= 3d+226) then
tmp = t_1
else if (t <= 1.4d+303) then
tmp = t / (a / y)
else
tmp = y * -(t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (1.0 - (t / z));
double tmp;
if (t <= -2.6e+184) {
tmp = t_1;
} else if (t <= 4.8e+164) {
tmp = y + x;
} else if (t <= 3e+226) {
tmp = t_1;
} else if (t <= 1.4e+303) {
tmp = t / (a / y);
} else {
tmp = y * -(t / z);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (1.0 - (t / z)) tmp = 0 if t <= -2.6e+184: tmp = t_1 elif t <= 4.8e+164: tmp = y + x elif t <= 3e+226: tmp = t_1 elif t <= 1.4e+303: tmp = t / (a / y) else: tmp = y * -(t / z) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(1.0 - Float64(t / z))) tmp = 0.0 if (t <= -2.6e+184) tmp = t_1; elseif (t <= 4.8e+164) tmp = Float64(y + x); elseif (t <= 3e+226) tmp = t_1; elseif (t <= 1.4e+303) tmp = Float64(t / Float64(a / y)); else tmp = Float64(y * Float64(-Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (1.0 - (t / z)); tmp = 0.0; if (t <= -2.6e+184) tmp = t_1; elseif (t <= 4.8e+164) tmp = y + x; elseif (t <= 3e+226) tmp = t_1; elseif (t <= 1.4e+303) tmp = t / (a / y); else tmp = y * -(t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.6e+184], t$95$1, If[LessEqual[t, 4.8e+164], N[(y + x), $MachinePrecision], If[LessEqual[t, 3e+226], t$95$1, If[LessEqual[t, 1.4e+303], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], N[(y * (-N[(t / z), $MachinePrecision])), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{+184}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+164}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+226}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+303}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-\frac{t}{z}\right)\\
\end{array}
\end{array}
if t < -2.59999999999999993e184 or 4.80000000000000021e164 < t < 2.99999999999999975e226Initial program 96.0%
Taylor expanded in a around 0 77.9%
Taylor expanded in y around inf 61.0%
if -2.59999999999999993e184 < t < 4.80000000000000021e164Initial program 99.8%
Taylor expanded in z around inf 71.8%
+-commutative71.8%
Simplified71.8%
if 2.99999999999999975e226 < t < 1.39999999999999988e303Initial program 87.6%
Taylor expanded in a around inf 67.5%
mul-1-neg67.5%
unsub-neg67.5%
*-lft-identity67.5%
times-frac73.5%
/-rgt-identity73.5%
Simplified73.5%
Taylor expanded in x around 0 48.2%
mul-1-neg48.2%
associate-*r/54.2%
*-commutative54.2%
distribute-rgt-neg-out54.2%
Simplified54.2%
Taylor expanded in z around 0 48.6%
associate-/l*61.0%
Simplified61.0%
if 1.39999999999999988e303 < t Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 100.0%
associate-*r/100.0%
*-commutative100.0%
neg-mul-1100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
associate-*r/100.0%
distribute-lft-neg-in100.0%
cancel-sign-sub-inv100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
mul-1-neg100.0%
associate-/l*100.0%
associate-/r/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Final simplification69.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (/ t (/ z y)))))
(if (<= t -3.35e+184)
t_1
(if (<= t 1.9e+182)
(+ y x)
(if (<= t 1.12e+223) t_1 (if (<= t 6.5e+226) x (/ t (/ a y))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -(t / (z / y));
double tmp;
if (t <= -3.35e+184) {
tmp = t_1;
} else if (t <= 1.9e+182) {
tmp = y + x;
} else if (t <= 1.12e+223) {
tmp = t_1;
} else if (t <= 6.5e+226) {
tmp = x;
} else {
tmp = t / (a / y);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = -(t / (z / y))
if (t <= (-3.35d+184)) then
tmp = t_1
else if (t <= 1.9d+182) then
tmp = y + x
else if (t <= 1.12d+223) then
tmp = t_1
else if (t <= 6.5d+226) then
tmp = x
else
tmp = t / (a / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -(t / (z / y));
double tmp;
if (t <= -3.35e+184) {
tmp = t_1;
} else if (t <= 1.9e+182) {
tmp = y + x;
} else if (t <= 1.12e+223) {
tmp = t_1;
} else if (t <= 6.5e+226) {
tmp = x;
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -(t / (z / y)) tmp = 0 if t <= -3.35e+184: tmp = t_1 elif t <= 1.9e+182: tmp = y + x elif t <= 1.12e+223: tmp = t_1 elif t <= 6.5e+226: tmp = x else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) t_1 = Float64(-Float64(t / Float64(z / y))) tmp = 0.0 if (t <= -3.35e+184) tmp = t_1; elseif (t <= 1.9e+182) tmp = Float64(y + x); elseif (t <= 1.12e+223) tmp = t_1; elseif (t <= 6.5e+226) tmp = x; else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -(t / (z / y)); tmp = 0.0; if (t <= -3.35e+184) tmp = t_1; elseif (t <= 1.9e+182) tmp = y + x; elseif (t <= 1.12e+223) tmp = t_1; elseif (t <= 6.5e+226) tmp = x; else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = (-N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[t, -3.35e+184], t$95$1, If[LessEqual[t, 1.9e+182], N[(y + x), $MachinePrecision], If[LessEqual[t, 1.12e+223], t$95$1, If[LessEqual[t, 6.5e+226], x, N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\frac{t}{\frac{z}{y}}\\
\mathbf{if}\;t \leq -3.35 \cdot 10^{+184}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+182}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{+223}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+226}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -3.35e184 or 1.90000000000000006e182 < t < 1.1200000000000001e223Initial program 95.2%
Taylor expanded in a around 0 77.6%
Taylor expanded in z around 0 61.7%
associate-*r/61.7%
*-commutative61.7%
neg-mul-161.7%
distribute-rgt-neg-in61.7%
Simplified61.7%
Taylor expanded in x around 0 61.7%
mul-1-neg61.7%
associate-*r/71.6%
distribute-lft-neg-in71.6%
cancel-sign-sub-inv71.6%
Simplified71.6%
Taylor expanded in x around 0 51.0%
mul-1-neg51.0%
associate-/l*58.4%
distribute-neg-frac58.4%
Simplified58.4%
if -3.35e184 < t < 1.90000000000000006e182Initial program 99.8%
Taylor expanded in z around inf 70.9%
+-commutative70.9%
Simplified70.9%
if 1.1200000000000001e223 < t < 6.49999999999999955e226Initial program 100.0%
Taylor expanded in x around inf 100.0%
if 6.49999999999999955e226 < t Initial program 88.4%
Taylor expanded in a around inf 63.3%
mul-1-neg63.3%
unsub-neg63.3%
*-lft-identity63.3%
times-frac68.9%
/-rgt-identity68.9%
Simplified68.9%
Taylor expanded in x around 0 45.2%
mul-1-neg45.2%
associate-*r/50.9%
*-commutative50.9%
distribute-rgt-neg-out50.9%
Simplified50.9%
Taylor expanded in z around 0 45.6%
associate-/l*57.2%
Simplified57.2%
Final simplification68.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.2e-41) (not (<= z 2.3e+25))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e-41) || !(z <= 2.3e+25)) {
tmp = y + x;
} 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 <= (-7.2d-41)) .or. (.not. (z <= 2.3d+25))) then
tmp = y + x
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 <= -7.2e-41) || !(z <= 2.3e+25)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.2e-41) or not (z <= 2.3e+25): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.2e-41) || !(z <= 2.3e+25)) tmp = Float64(y + x); 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 <= -7.2e-41) || ~((z <= 2.3e+25))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.2e-41], N[Not[LessEqual[z, 2.3e+25]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-41} \lor \neg \left(z \leq 2.3 \cdot 10^{+25}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -7.2e-41 or 2.2999999999999998e25 < z Initial program 99.9%
Taylor expanded in z around inf 76.3%
+-commutative76.3%
Simplified76.3%
if -7.2e-41 < z < 2.2999999999999998e25Initial program 96.6%
Taylor expanded in z around 0 71.5%
Final simplification74.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e-40) (not (<= z 130.0))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e-40) || !(z <= 130.0)) {
tmp = y + x;
} 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 <= (-9d-40)) .or. (.not. (z <= 130.0d0))) then
tmp = y + x
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 <= -9e-40) || !(z <= 130.0)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9e-40) or not (z <= 130.0): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9e-40) || !(z <= 130.0)) tmp = Float64(y + x); 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 <= -9e-40) || ~((z <= 130.0))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9e-40], N[Not[LessEqual[z, 130.0]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-40} \lor \neg \left(z \leq 130\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -9.0000000000000002e-40 or 130 < z Initial program 99.9%
Taylor expanded in z around inf 75.9%
+-commutative75.9%
Simplified75.9%
if -9.0000000000000002e-40 < z < 130Initial program 96.5%
Taylor expanded in z around 0 71.8%
+-commutative71.8%
*-commutative71.8%
*-lft-identity71.8%
times-frac73.7%
/-rgt-identity73.7%
Simplified73.7%
Final simplification75.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.6e+246) (not (<= t 2.8e+226))) (/ t (/ a y)) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.6e+246) || !(t <= 2.8e+226)) {
tmp = t / (a / y);
} else {
tmp = y + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-3.6d+246)) .or. (.not. (t <= 2.8d+226))) then
tmp = t / (a / y)
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.6e+246) || !(t <= 2.8e+226)) {
tmp = t / (a / y);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.6e+246) or not (t <= 2.8e+226): tmp = t / (a / y) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.6e+246) || !(t <= 2.8e+226)) tmp = Float64(t / Float64(a / y)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.6e+246) || ~((t <= 2.8e+226))) tmp = t / (a / y); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.6e+246], N[Not[LessEqual[t, 2.8e+226]], $MachinePrecision]], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+246} \lor \neg \left(t \leq 2.8 \cdot 10^{+226}\right):\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -3.6e246 or 2.8000000000000003e226 < t Initial program 89.2%
Taylor expanded in a around inf 71.1%
mul-1-neg71.1%
unsub-neg71.1%
*-lft-identity71.1%
times-frac73.4%
/-rgt-identity73.4%
Simplified73.4%
Taylor expanded in x around 0 56.2%
mul-1-neg56.2%
associate-*r/58.5%
*-commutative58.5%
distribute-rgt-neg-out58.5%
Simplified58.5%
Taylor expanded in z around 0 56.4%
associate-/l*63.6%
Simplified63.6%
if -3.6e246 < t < 2.8000000000000003e226Initial program 99.5%
Taylor expanded in z around inf 66.1%
+-commutative66.1%
Simplified66.1%
Final simplification65.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.2e+184) (* y (- (/ t z))) (if (<= t 5.5e+225) (+ y x) (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.2e+184) {
tmp = y * -(t / z);
} else if (t <= 5.5e+225) {
tmp = y + x;
} else {
tmp = t / (a / y);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-4.2d+184)) then
tmp = y * -(t / z)
else if (t <= 5.5d+225) then
tmp = y + x
else
tmp = t / (a / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.2e+184) {
tmp = y * -(t / z);
} else if (t <= 5.5e+225) {
tmp = y + x;
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.2e+184: tmp = y * -(t / z) elif t <= 5.5e+225: tmp = y + x else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.2e+184) tmp = Float64(y * Float64(-Float64(t / z))); elseif (t <= 5.5e+225) tmp = Float64(y + x); else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.2e+184) tmp = y * -(t / z); elseif (t <= 5.5e+225) tmp = y + x; else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.2e+184], N[(y * (-N[(t / z), $MachinePrecision])), $MachinePrecision], If[LessEqual[t, 5.5e+225], N[(y + x), $MachinePrecision], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+184}:\\
\;\;\;\;y \cdot \left(-\frac{t}{z}\right)\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+225}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -4.2e184Initial program 96.6%
Taylor expanded in a around 0 76.0%
Taylor expanded in z around 0 62.4%
associate-*r/62.4%
*-commutative62.4%
neg-mul-162.4%
distribute-rgt-neg-in62.4%
Simplified62.4%
Taylor expanded in x around 0 62.4%
mul-1-neg62.4%
associate-*r/69.2%
distribute-lft-neg-in69.2%
cancel-sign-sub-inv69.2%
Simplified69.2%
Taylor expanded in x around 0 48.7%
mul-1-neg48.7%
associate-/l*55.5%
associate-/r/55.1%
distribute-rgt-neg-in55.1%
Simplified55.1%
if -4.2e184 < t < 5.49999999999999985e225Initial program 99.4%
Taylor expanded in z around inf 68.7%
+-commutative68.7%
Simplified68.7%
if 5.49999999999999985e225 < t Initial program 88.4%
Taylor expanded in a around inf 63.3%
mul-1-neg63.3%
unsub-neg63.3%
*-lft-identity63.3%
times-frac68.9%
/-rgt-identity68.9%
Simplified68.9%
Taylor expanded in x around 0 45.2%
mul-1-neg45.2%
associate-*r/50.9%
*-commutative50.9%
distribute-rgt-neg-out50.9%
Simplified50.9%
Taylor expanded in z around 0 45.6%
associate-/l*57.2%
Simplified57.2%
Final simplification66.5%
(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 98.4%
Final simplification98.4%
(FPCore (x y z t a) :precision binary64 (+ y x))
double code(double x, double y, double z, double t, double a) {
return y + 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 = y + x
end function
public static double code(double x, double y, double z, double t, double a) {
return y + x;
}
def code(x, y, z, t, a): return y + x
function code(x, y, z, t, a) return Float64(y + x) end
function tmp = code(x, y, z, t, a) tmp = y + x; end
code[x_, y_, z_, t_, a_] := N[(y + x), $MachinePrecision]
\begin{array}{l}
\\
y + x
\end{array}
Initial program 98.4%
Taylor expanded in z around inf 61.6%
+-commutative61.6%
Simplified61.6%
Final simplification61.6%
(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.4%
Taylor expanded in x around inf 47.1%
Final simplification47.1%
(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 2024096
(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)))))