
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ (- z t) (- a t)) y x))
double code(double x, double y, double z, double t, double a) {
return fma(((z - t) / (a - t)), y, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(z - t) / Float64(a - t)), y, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{z - t}{a - t}, y, x\right)
\end{array}
Initial program 87.4%
+-commutative87.4%
*-commutative87.4%
associate-*l/98.8%
fma-def98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y a)))))
(if (<= t -1.72e+118)
(+ y x)
(if (<= t -1.1e+54)
t_1
(if (<= t -1.1e+18)
(+ y x)
(if (<= t -4500000.0)
(* y (/ z (- a t)))
(if (<= t 2.6e+14) t_1 (+ y x))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / a));
double tmp;
if (t <= -1.72e+118) {
tmp = y + x;
} else if (t <= -1.1e+54) {
tmp = t_1;
} else if (t <= -1.1e+18) {
tmp = y + x;
} else if (t <= -4500000.0) {
tmp = y * (z / (a - t));
} else if (t <= 2.6e+14) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (z * (y / a))
if (t <= (-1.72d+118)) then
tmp = y + x
else if (t <= (-1.1d+54)) then
tmp = t_1
else if (t <= (-1.1d+18)) then
tmp = y + x
else if (t <= (-4500000.0d0)) then
tmp = y * (z / (a - t))
else if (t <= 2.6d+14) then
tmp = t_1
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 t_1 = x + (z * (y / a));
double tmp;
if (t <= -1.72e+118) {
tmp = y + x;
} else if (t <= -1.1e+54) {
tmp = t_1;
} else if (t <= -1.1e+18) {
tmp = y + x;
} else if (t <= -4500000.0) {
tmp = y * (z / (a - t));
} else if (t <= 2.6e+14) {
tmp = t_1;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / a)) tmp = 0 if t <= -1.72e+118: tmp = y + x elif t <= -1.1e+54: tmp = t_1 elif t <= -1.1e+18: tmp = y + x elif t <= -4500000.0: tmp = y * (z / (a - t)) elif t <= 2.6e+14: tmp = t_1 else: tmp = y + x return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / a))) tmp = 0.0 if (t <= -1.72e+118) tmp = Float64(y + x); elseif (t <= -1.1e+54) tmp = t_1; elseif (t <= -1.1e+18) tmp = Float64(y + x); elseif (t <= -4500000.0) tmp = Float64(y * Float64(z / Float64(a - t))); elseif (t <= 2.6e+14) tmp = t_1; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / a)); tmp = 0.0; if (t <= -1.72e+118) tmp = y + x; elseif (t <= -1.1e+54) tmp = t_1; elseif (t <= -1.1e+18) tmp = y + x; elseif (t <= -4500000.0) tmp = y * (z / (a - t)); elseif (t <= 2.6e+14) tmp = t_1; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.72e+118], N[(y + x), $MachinePrecision], If[LessEqual[t, -1.1e+54], t$95$1, If[LessEqual[t, -1.1e+18], N[(y + x), $MachinePrecision], If[LessEqual[t, -4500000.0], N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e+14], t$95$1, N[(y + x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{a}\\
\mathbf{if}\;t \leq -1.72 \cdot 10^{+118}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -1.1 \cdot 10^{+54}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.1 \cdot 10^{+18}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -4500000:\\
\;\;\;\;y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+14}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.71999999999999999e118 or -1.09999999999999995e54 < t < -1.1e18 or 2.6e14 < t Initial program 81.2%
+-commutative81.2%
associate-*l/95.2%
fma-def95.3%
Simplified95.3%
Taylor expanded in t around inf 83.6%
if -1.71999999999999999e118 < t < -1.09999999999999995e54 or -4.5e6 < t < 2.6e14Initial program 92.9%
+-commutative92.9%
associate-*l/95.8%
fma-def95.8%
Simplified95.8%
Taylor expanded in t around 0 71.4%
associate-/l*76.8%
associate-/r/76.9%
Applied egg-rr76.9%
if -1.1e18 < t < -4.5e6Initial program 84.4%
+-commutative84.4%
associate-*l/100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in x around 0 69.8%
associate-/l*85.4%
associate-/r/85.4%
Applied egg-rr85.4%
Taylor expanded in z around inf 85.4%
Final simplification80.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.55e+118)
(+ y x)
(if (<= t -1.05e+54)
(+ x (* z (/ y a)))
(if (<= t -1.1e+18)
(+ y x)
(if (<= t -4500000.0)
(* y (/ z (- a t)))
(if (<= t 5e+14) (+ x (/ z (/ a y))) (+ y x)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.55e+118) {
tmp = y + x;
} else if (t <= -1.05e+54) {
tmp = x + (z * (y / a));
} else if (t <= -1.1e+18) {
tmp = y + x;
} else if (t <= -4500000.0) {
tmp = y * (z / (a - t));
} else if (t <= 5e+14) {
tmp = x + (z / (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 <= (-2.55d+118)) then
tmp = y + x
else if (t <= (-1.05d+54)) then
tmp = x + (z * (y / a))
else if (t <= (-1.1d+18)) then
tmp = y + x
else if (t <= (-4500000.0d0)) then
tmp = y * (z / (a - t))
else if (t <= 5d+14) then
tmp = x + (z / (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 <= -2.55e+118) {
tmp = y + x;
} else if (t <= -1.05e+54) {
tmp = x + (z * (y / a));
} else if (t <= -1.1e+18) {
tmp = y + x;
} else if (t <= -4500000.0) {
tmp = y * (z / (a - t));
} else if (t <= 5e+14) {
tmp = x + (z / (a / y));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.55e+118: tmp = y + x elif t <= -1.05e+54: tmp = x + (z * (y / a)) elif t <= -1.1e+18: tmp = y + x elif t <= -4500000.0: tmp = y * (z / (a - t)) elif t <= 5e+14: tmp = x + (z / (a / y)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.55e+118) tmp = Float64(y + x); elseif (t <= -1.05e+54) tmp = Float64(x + Float64(z * Float64(y / a))); elseif (t <= -1.1e+18) tmp = Float64(y + x); elseif (t <= -4500000.0) tmp = Float64(y * Float64(z / Float64(a - t))); elseif (t <= 5e+14) tmp = Float64(x + Float64(z / 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 <= -2.55e+118) tmp = y + x; elseif (t <= -1.05e+54) tmp = x + (z * (y / a)); elseif (t <= -1.1e+18) tmp = y + x; elseif (t <= -4500000.0) tmp = y * (z / (a - t)); elseif (t <= 5e+14) tmp = x + (z / (a / y)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.55e+118], N[(y + x), $MachinePrecision], If[LessEqual[t, -1.05e+54], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.1e+18], N[(y + x), $MachinePrecision], If[LessEqual[t, -4500000.0], N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e+14], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.55 \cdot 10^{+118}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -1.05 \cdot 10^{+54}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq -1.1 \cdot 10^{+18}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -4500000:\\
\;\;\;\;y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+14}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -2.55000000000000001e118 or -1.04999999999999993e54 < t < -1.1e18 or 5e14 < t Initial program 81.2%
+-commutative81.2%
associate-*l/95.2%
fma-def95.3%
Simplified95.3%
Taylor expanded in t around inf 83.6%
if -2.55000000000000001e118 < t < -1.04999999999999993e54Initial program 85.2%
+-commutative85.2%
associate-*l/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around 0 71.3%
associate-/l*78.6%
associate-/r/78.6%
Applied egg-rr78.6%
if -1.1e18 < t < -4.5e6Initial program 84.4%
+-commutative84.4%
associate-*l/100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in x around 0 69.8%
associate-/l*85.4%
associate-/r/85.4%
Applied egg-rr85.4%
Taylor expanded in z around inf 85.4%
if -4.5e6 < t < 5e14Initial program 93.8%
+-commutative93.8%
associate-*l/95.3%
fma-def95.3%
Simplified95.3%
Taylor expanded in t around 0 71.4%
*-commutative71.4%
associate-/l*76.7%
add-cube-cbrt76.3%
*-un-lft-identity76.3%
times-frac76.3%
pow276.3%
Applied egg-rr76.3%
/-rgt-identity76.3%
associate-*r/76.3%
unpow276.3%
rem-3cbrt-lft76.7%
Simplified76.7%
Final simplification80.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y a)))))
(if (<= t -1.72e+118)
(+ y x)
(if (<= t -6.2e+51)
t_1
(if (<= t -270000000000.0)
(/ (- z t) (/ t (- y)))
(if (<= t -7.5e-161)
(+ x (/ y (/ a z)))
(if (<= t 1250000000000.0) t_1 (+ y x))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / a));
double tmp;
if (t <= -1.72e+118) {
tmp = y + x;
} else if (t <= -6.2e+51) {
tmp = t_1;
} else if (t <= -270000000000.0) {
tmp = (z - t) / (t / -y);
} else if (t <= -7.5e-161) {
tmp = x + (y / (a / z));
} else if (t <= 1250000000000.0) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (z * (y / a))
if (t <= (-1.72d+118)) then
tmp = y + x
else if (t <= (-6.2d+51)) then
tmp = t_1
else if (t <= (-270000000000.0d0)) then
tmp = (z - t) / (t / -y)
else if (t <= (-7.5d-161)) then
tmp = x + (y / (a / z))
else if (t <= 1250000000000.0d0) then
tmp = t_1
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 t_1 = x + (z * (y / a));
double tmp;
if (t <= -1.72e+118) {
tmp = y + x;
} else if (t <= -6.2e+51) {
tmp = t_1;
} else if (t <= -270000000000.0) {
tmp = (z - t) / (t / -y);
} else if (t <= -7.5e-161) {
tmp = x + (y / (a / z));
} else if (t <= 1250000000000.0) {
tmp = t_1;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / a)) tmp = 0 if t <= -1.72e+118: tmp = y + x elif t <= -6.2e+51: tmp = t_1 elif t <= -270000000000.0: tmp = (z - t) / (t / -y) elif t <= -7.5e-161: tmp = x + (y / (a / z)) elif t <= 1250000000000.0: tmp = t_1 else: tmp = y + x return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / a))) tmp = 0.0 if (t <= -1.72e+118) tmp = Float64(y + x); elseif (t <= -6.2e+51) tmp = t_1; elseif (t <= -270000000000.0) tmp = Float64(Float64(z - t) / Float64(t / Float64(-y))); elseif (t <= -7.5e-161) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 1250000000000.0) tmp = t_1; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / a)); tmp = 0.0; if (t <= -1.72e+118) tmp = y + x; elseif (t <= -6.2e+51) tmp = t_1; elseif (t <= -270000000000.0) tmp = (z - t) / (t / -y); elseif (t <= -7.5e-161) tmp = x + (y / (a / z)); elseif (t <= 1250000000000.0) tmp = t_1; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.72e+118], N[(y + x), $MachinePrecision], If[LessEqual[t, -6.2e+51], t$95$1, If[LessEqual[t, -270000000000.0], N[(N[(z - t), $MachinePrecision] / N[(t / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -7.5e-161], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1250000000000.0], t$95$1, N[(y + x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{a}\\
\mathbf{if}\;t \leq -1.72 \cdot 10^{+118}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -6.2 \cdot 10^{+51}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -270000000000:\\
\;\;\;\;\frac{z - t}{\frac{t}{-y}}\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{-161}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 1250000000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.71999999999999999e118 or 1.25e12 < t Initial program 80.6%
+-commutative80.6%
associate-*l/95.1%
fma-def95.1%
Simplified95.1%
Taylor expanded in t around inf 83.0%
if -1.71999999999999999e118 < t < -6.20000000000000022e51 or -7.49999999999999991e-161 < t < 1.25e12Initial program 91.9%
+-commutative91.9%
associate-*l/95.5%
fma-def95.5%
Simplified95.5%
Taylor expanded in t around 0 71.2%
associate-/l*76.3%
associate-/r/78.3%
Applied egg-rr78.3%
if -6.20000000000000022e51 < t < -2.7e11Initial program 99.3%
+-commutative99.3%
associate-*l/100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in x around 0 73.1%
associate-/l*73.8%
associate-/r/73.8%
Applied egg-rr73.8%
Taylor expanded in a around 0 73.1%
associate-*r/73.1%
neg-mul-173.1%
distribute-rgt-neg-in73.1%
associate-/l*73.8%
Simplified73.8%
if -2.7e11 < t < -7.49999999999999991e-161Initial program 94.3%
+-commutative94.3%
associate-*l/97.1%
fma-def97.1%
Simplified97.1%
Taylor expanded in t around 0 71.9%
associate-/l*77.5%
Simplified77.5%
Final simplification80.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z (- a t)))))
(if (<= y -4.2e+199)
t_1
(if (<= y 8.8e+48)
(+ y x)
(if (<= y 2.5e+114)
(* (- z t) (/ y a))
(if (<= y 6.2e+215) (+ y x) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / (a - t));
double tmp;
if (y <= -4.2e+199) {
tmp = t_1;
} else if (y <= 8.8e+48) {
tmp = y + x;
} else if (y <= 2.5e+114) {
tmp = (z - t) * (y / a);
} else if (y <= 6.2e+215) {
tmp = y + x;
} 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 = y * (z / (a - t))
if (y <= (-4.2d+199)) then
tmp = t_1
else if (y <= 8.8d+48) then
tmp = y + x
else if (y <= 2.5d+114) then
tmp = (z - t) * (y / a)
else if (y <= 6.2d+215) then
tmp = y + x
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 = y * (z / (a - t));
double tmp;
if (y <= -4.2e+199) {
tmp = t_1;
} else if (y <= 8.8e+48) {
tmp = y + x;
} else if (y <= 2.5e+114) {
tmp = (z - t) * (y / a);
} else if (y <= 6.2e+215) {
tmp = y + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / (a - t)) tmp = 0 if y <= -4.2e+199: tmp = t_1 elif y <= 8.8e+48: tmp = y + x elif y <= 2.5e+114: tmp = (z - t) * (y / a) elif y <= 6.2e+215: tmp = y + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / Float64(a - t))) tmp = 0.0 if (y <= -4.2e+199) tmp = t_1; elseif (y <= 8.8e+48) tmp = Float64(y + x); elseif (y <= 2.5e+114) tmp = Float64(Float64(z - t) * Float64(y / a)); elseif (y <= 6.2e+215) tmp = Float64(y + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / (a - t)); tmp = 0.0; if (y <= -4.2e+199) tmp = t_1; elseif (y <= 8.8e+48) tmp = y + x; elseif (y <= 2.5e+114) tmp = (z - t) * (y / a); elseif (y <= 6.2e+215) tmp = y + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.2e+199], t$95$1, If[LessEqual[y, 8.8e+48], N[(y + x), $MachinePrecision], If[LessEqual[y, 2.5e+114], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e+215], N[(y + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{a - t}\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{+199}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{+48}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+114}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+215}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -4.1999999999999999e199 or 6.1999999999999998e215 < y Initial program 67.7%
+-commutative67.7%
associate-*l/91.9%
fma-def91.9%
Simplified91.9%
Taylor expanded in x around 0 63.5%
associate-/l*85.7%
associate-/r/93.6%
Applied egg-rr93.6%
Taylor expanded in z around inf 65.4%
if -4.1999999999999999e199 < y < 8.7999999999999997e48 or 2.5e114 < y < 6.1999999999999998e215Initial program 92.2%
+-commutative92.2%
associate-*l/96.2%
fma-def96.2%
Simplified96.2%
Taylor expanded in t around inf 75.2%
if 8.7999999999999997e48 < y < 2.5e114Initial program 85.1%
+-commutative85.1%
associate-*l/100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in x around 0 64.9%
associate-/l*79.8%
associate-/r/79.7%
Applied egg-rr79.7%
Taylor expanded in a around inf 57.5%
associate-/l*57.2%
associate-/r/57.7%
Simplified57.7%
Final simplification72.5%
(FPCore (x y z t a)
:precision binary64
(if (<= x -2.2e+59)
(+ x (/ y (/ a z)))
(if (<= x -1.15e-46)
(+ y x)
(if (<= x 3.6e-62) (* (/ (- z t) (- a t)) y) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.2e+59) {
tmp = x + (y / (a / z));
} else if (x <= -1.15e-46) {
tmp = y + x;
} else if (x <= 3.6e-62) {
tmp = ((z - t) / (a - t)) * 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 (x <= (-2.2d+59)) then
tmp = x + (y / (a / z))
else if (x <= (-1.15d-46)) then
tmp = y + x
else if (x <= 3.6d-62) then
tmp = ((z - t) / (a - t)) * 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 (x <= -2.2e+59) {
tmp = x + (y / (a / z));
} else if (x <= -1.15e-46) {
tmp = y + x;
} else if (x <= 3.6e-62) {
tmp = ((z - t) / (a - t)) * y;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.2e+59: tmp = x + (y / (a / z)) elif x <= -1.15e-46: tmp = y + x elif x <= 3.6e-62: tmp = ((z - t) / (a - t)) * y else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.2e+59) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (x <= -1.15e-46) tmp = Float64(y + x); elseif (x <= 3.6e-62) tmp = Float64(Float64(Float64(z - t) / Float64(a - t)) * y); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.2e+59) tmp = x + (y / (a / z)); elseif (x <= -1.15e-46) tmp = y + x; elseif (x <= 3.6e-62) tmp = ((z - t) / (a - t)) * y; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.2e+59], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.15e-46], N[(y + x), $MachinePrecision], If[LessEqual[x, 3.6e-62], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+59}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{-46}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-62}:\\
\;\;\;\;\frac{z - t}{a - t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if x < -2.2e59Initial program 89.8%
+-commutative89.8%
associate-*l/100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in t around 0 88.5%
associate-/l*91.2%
Simplified91.2%
if -2.2e59 < x < -1.15e-46 or 3.6e-62 < x Initial program 87.3%
+-commutative87.3%
associate-*l/95.7%
fma-def95.7%
Simplified95.7%
Taylor expanded in t around inf 74.3%
if -1.15e-46 < x < 3.6e-62Initial program 86.0%
+-commutative86.0%
associate-*l/92.8%
fma-def92.8%
Simplified92.8%
Taylor expanded in x around 0 69.0%
associate-/l*75.8%
associate-/r/82.8%
Applied egg-rr82.8%
Final simplification81.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.7e+185) (not (<= t 3.3e+121))) (+ y x) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.7e+185) || !(t <= 3.3e+121)) {
tmp = y + x;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.7d+185)) .or. (.not. (t <= 3.3d+121))) then
tmp = y + x
else
tmp = x + (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.7e+185) || !(t <= 3.3e+121)) {
tmp = y + x;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.7e+185) or not (t <= 3.3e+121): tmp = y + x else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.7e+185) || !(t <= 3.3e+121)) tmp = Float64(y + x); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.7e+185) || ~((t <= 3.3e+121))) tmp = y + x; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.7e+185], N[Not[LessEqual[t, 3.3e+121]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{+185} \lor \neg \left(t \leq 3.3 \cdot 10^{+121}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -2.70000000000000007e185 or 3.29999999999999979e121 < t Initial program 72.6%
+-commutative72.6%
associate-*l/92.0%
fma-def92.0%
Simplified92.0%
Taylor expanded in t around inf 91.1%
if -2.70000000000000007e185 < t < 3.29999999999999979e121Initial program 92.9%
Taylor expanded in z around inf 82.4%
associate-*l/87.0%
*-commutative87.0%
Simplified87.0%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.72e+118) (not (<= t 1.75e+86))) (- x (/ y (/ t (- z t)))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.72e+118) || !(t <= 1.75e+86)) {
tmp = x - (y / (t / (z - t)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.72d+118)) .or. (.not. (t <= 1.75d+86))) then
tmp = x - (y / (t / (z - t)))
else
tmp = x + (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.72e+118) || !(t <= 1.75e+86)) {
tmp = x - (y / (t / (z - t)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.72e+118) or not (t <= 1.75e+86): tmp = x - (y / (t / (z - t))) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.72e+118) || !(t <= 1.75e+86)) tmp = Float64(x - Float64(y / Float64(t / Float64(z - t)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.72e+118) || ~((t <= 1.75e+86))) tmp = x - (y / (t / (z - t))); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.72e+118], N[Not[LessEqual[t, 1.75e+86]], $MachinePrecision]], N[(x - N[(y / N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.72 \cdot 10^{+118} \lor \neg \left(t \leq 1.75 \cdot 10^{+86}\right):\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -1.71999999999999999e118 or 1.75000000000000009e86 < t Initial program 77.3%
+-commutative77.3%
associate-*l/94.2%
fma-def94.3%
Simplified94.3%
Taylor expanded in a around 0 75.9%
+-commutative75.9%
mul-1-neg75.9%
unsub-neg75.9%
*-commutative75.9%
associate-/l*96.2%
Simplified96.2%
if -1.71999999999999999e118 < t < 1.75000000000000009e86Initial program 93.5%
Taylor expanded in z around inf 82.6%
associate-*l/88.0%
*-commutative88.0%
Simplified88.0%
Final simplification91.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4e+59) (not (<= z 4.5e-66))) (+ x (* z (/ y (- a t)))) (+ x (/ y (/ (- t a) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4e+59) || !(z <= 4.5e-66)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y / ((t - a) / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4d+59)) .or. (.not. (z <= 4.5d-66))) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + (y / ((t - a) / 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 <= -4e+59) || !(z <= 4.5e-66)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y / ((t - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4e+59) or not (z <= 4.5e-66): tmp = x + (z * (y / (a - t))) else: tmp = x + (y / ((t - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4e+59) || !(z <= 4.5e-66)) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(y / Float64(Float64(t - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4e+59) || ~((z <= 4.5e-66))) tmp = x + (z * (y / (a - t))); else tmp = x + (y / ((t - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4e+59], N[Not[LessEqual[z, 4.5e-66]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+59} \lor \neg \left(z \leq 4.5 \cdot 10^{-66}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t - a}{t}}\\
\end{array}
\end{array}
if z < -3.99999999999999989e59 or 4.4999999999999998e-66 < z Initial program 87.7%
Taylor expanded in z around inf 83.2%
associate-*l/91.8%
*-commutative91.8%
Simplified91.8%
if -3.99999999999999989e59 < z < 4.4999999999999998e-66Initial program 87.2%
clear-num87.2%
associate-/r/87.2%
Applied egg-rr87.2%
associate-*l/87.2%
*-un-lft-identity87.2%
associate-/l*99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 92.0%
associate-*r/92.0%
mul-1-neg92.0%
Simplified92.0%
Final simplification91.9%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
Initial program 87.4%
clear-num87.4%
associate-/r/87.4%
Applied egg-rr87.4%
associate-*l/87.4%
*-un-lft-identity87.4%
associate-/l*98.8%
Applied egg-rr98.8%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.4e-124) x (if (<= x 1.5e-140) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.4e-124) {
tmp = x;
} else if (x <= 1.5e-140) {
tmp = y;
} else {
tmp = 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 <= (-1.4d-124)) then
tmp = x
else if (x <= 1.5d-140) then
tmp = y
else
tmp = 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 <= -1.4e-124) {
tmp = x;
} else if (x <= 1.5e-140) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.4e-124: tmp = x elif x <= 1.5e-140: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.4e-124) tmp = x; elseif (x <= 1.5e-140) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.4e-124) tmp = x; elseif (x <= 1.5e-140) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.4e-124], x, If[LessEqual[x, 1.5e-140], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-124}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-140}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.39999999999999999e-124 or 1.50000000000000009e-140 < x Initial program 87.4%
+-commutative87.4%
associate-*l/96.4%
fma-def96.4%
Simplified96.4%
Taylor expanded in y around 0 65.9%
if -1.39999999999999999e-124 < x < 1.50000000000000009e-140Initial program 87.7%
+-commutative87.7%
associate-*l/93.4%
fma-def93.4%
Simplified93.4%
Taylor expanded in x around 0 77.7%
associate-/l*83.6%
associate-/r/89.8%
Applied egg-rr89.8%
Taylor expanded in t around inf 37.2%
Final simplification58.2%
(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 87.4%
+-commutative87.4%
associate-*l/95.6%
fma-def95.6%
Simplified95.6%
Taylor expanded in t around inf 63.7%
Final simplification63.7%
(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 87.4%
+-commutative87.4%
associate-*l/95.6%
fma-def95.6%
Simplified95.6%
Taylor expanded in y around 0 51.6%
Final simplification51.6%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2023274
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))