
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (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 - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (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 - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x y) t) (- z a) y)))
(if (<= t -2.45e+64)
t_1
(if (<= t 8e+164) (- x (/ (- y x) (/ (- t a) (- z t)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((x - y) / t), (z - a), y);
double tmp;
if (t <= -2.45e+64) {
tmp = t_1;
} else if (t <= 8e+164) {
tmp = x - ((y - x) / ((t - a) / (z - t)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(x - y) / t), Float64(z - a), y) tmp = 0.0 if (t <= -2.45e+64) tmp = t_1; elseif (t <= 8e+164) tmp = Float64(x - Float64(Float64(y - x) / Float64(Float64(t - a) / Float64(z - t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -2.45e+64], t$95$1, If[LessEqual[t, 8e+164], N[(x - N[(N[(y - x), $MachinePrecision] / N[(N[(t - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x - y}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -2.45 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8 \cdot 10^{+164}:\\
\;\;\;\;x - \frac{y - x}{\frac{t - a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.4500000000000001e64 or 8e164 < t Initial program 35.7%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites89.9%
if -2.4500000000000001e64 < t < 8e164Initial program 81.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6492.6
Applied rewrites92.6%
Final simplification91.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (- y x) x)) (t_2 (fma (/ y a) z x)))
(if (<= a -1.95e+71)
t_2
(if (<= a -7.5e-138)
t_1
(if (<= a 9.6e-271) (* (/ x t) z) (if (<= a 6.6e-97) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - x) + x;
double t_2 = fma((y / a), z, x);
double tmp;
if (a <= -1.95e+71) {
tmp = t_2;
} else if (a <= -7.5e-138) {
tmp = t_1;
} else if (a <= 9.6e-271) {
tmp = (x / t) * z;
} else if (a <= 6.6e-97) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y - x) + x) t_2 = fma(Float64(y / a), z, x) tmp = 0.0 if (a <= -1.95e+71) tmp = t_2; elseif (a <= -7.5e-138) tmp = t_1; elseif (a <= 9.6e-271) tmp = Float64(Float64(x / t) * z); elseif (a <= 6.6e-97) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision]}, If[LessEqual[a, -1.95e+71], t$95$2, If[LessEqual[a, -7.5e-138], t$95$1, If[LessEqual[a, 9.6e-271], N[(N[(x / t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 6.6e-97], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - x\right) + x\\
t_2 := \mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{if}\;a \leq -1.95 \cdot 10^{+71}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -7.5 \cdot 10^{-138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9.6 \cdot 10^{-271}:\\
\;\;\;\;\frac{x}{t} \cdot z\\
\mathbf{elif}\;a \leq 6.6 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -1.9500000000000001e71 or 6.6000000000000002e-97 < a Initial program 68.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6485.3
Applied rewrites85.3%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6467.7
Applied rewrites67.7%
Taylor expanded in y around inf
Applied rewrites58.7%
if -1.9500000000000001e71 < a < -7.4999999999999995e-138 or 9.6000000000000009e-271 < a < 6.6000000000000002e-97Initial program 73.7%
Taylor expanded in t around inf
lower--.f6435.9
Applied rewrites35.9%
if -7.4999999999999995e-138 < a < 9.6000000000000009e-271Initial program 67.4%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6458.5
Applied rewrites58.5%
Taylor expanded in x around inf
Applied rewrites54.8%
Applied rewrites55.0%
Final simplification51.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -4e+88)
(fma (- y x) (/ z a) x)
(if (<= a -1.4e-138)
(* (/ y (- t a)) (- t z))
(if (<= a 1.25e-24) (* (/ z (- t a)) (- x y)) (fma (/ (- y x) a) z x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4e+88) {
tmp = fma((y - x), (z / a), x);
} else if (a <= -1.4e-138) {
tmp = (y / (t - a)) * (t - z);
} else if (a <= 1.25e-24) {
tmp = (z / (t - a)) * (x - y);
} else {
tmp = fma(((y - x) / a), z, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4e+88) tmp = fma(Float64(y - x), Float64(z / a), x); elseif (a <= -1.4e-138) tmp = Float64(Float64(y / Float64(t - a)) * Float64(t - z)); elseif (a <= 1.25e-24) tmp = Float64(Float64(z / Float64(t - a)) * Float64(x - y)); else tmp = fma(Float64(Float64(y - x) / a), z, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4e+88], N[(N[(y - x), $MachinePrecision] * N[(z / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, -1.4e-138], N[(N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.25e-24], N[(N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4 \cdot 10^{+88}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a}, x\right)\\
\mathbf{elif}\;a \leq -1.4 \cdot 10^{-138}:\\
\;\;\;\;\frac{y}{t - a} \cdot \left(t - z\right)\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-24}:\\
\;\;\;\;\frac{z}{t - a} \cdot \left(x - y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\end{array}
\end{array}
if a < -3.99999999999999984e88Initial program 69.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6486.4
Applied rewrites86.4%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6472.8
Applied rewrites72.8%
Applied rewrites72.8%
if -3.99999999999999984e88 < a < -1.4e-138Initial program 76.2%
Taylor expanded in y around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6470.8
Applied rewrites70.8%
if -1.4e-138 < a < 1.24999999999999995e-24Initial program 68.5%
Taylor expanded in z around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6463.2
Applied rewrites63.2%
if 1.24999999999999995e-24 < a Initial program 68.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6471.7
Applied rewrites71.7%
Final simplification68.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.5e+70)
(fma (- y x) (/ z a) x)
(if (<= a -1.66e-121)
(* (/ (- t z) t) y)
(if (<= a 1.25e-24) (* (/ z (- t a)) (- x y)) (fma (/ (- y x) a) z x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.5e+70) {
tmp = fma((y - x), (z / a), x);
} else if (a <= -1.66e-121) {
tmp = ((t - z) / t) * y;
} else if (a <= 1.25e-24) {
tmp = (z / (t - a)) * (x - y);
} else {
tmp = fma(((y - x) / a), z, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.5e+70) tmp = fma(Float64(y - x), Float64(z / a), x); elseif (a <= -1.66e-121) tmp = Float64(Float64(Float64(t - z) / t) * y); elseif (a <= 1.25e-24) tmp = Float64(Float64(z / Float64(t - a)) * Float64(x - y)); else tmp = fma(Float64(Float64(y - x) / a), z, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.5e+70], N[(N[(y - x), $MachinePrecision] * N[(z / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, -1.66e-121], N[(N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[a, 1.25e-24], N[(N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a}, x\right)\\
\mathbf{elif}\;a \leq -1.66 \cdot 10^{-121}:\\
\;\;\;\;\frac{t - z}{t} \cdot y\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-24}:\\
\;\;\;\;\frac{z}{t - a} \cdot \left(x - y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\end{array}
\end{array}
if a < -1.49999999999999988e70Initial program 69.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6486.6
Applied rewrites86.6%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6473.3
Applied rewrites73.3%
Applied rewrites73.4%
if -1.49999999999999988e70 < a < -1.6600000000000001e-121Initial program 74.2%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6448.2
Applied rewrites48.2%
Taylor expanded in y around inf
Applied rewrites62.3%
if -1.6600000000000001e-121 < a < 1.24999999999999995e-24Initial program 69.1%
Taylor expanded in z around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6462.9
Applied rewrites62.9%
if 1.24999999999999995e-24 < a Initial program 68.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6471.7
Applied rewrites71.7%
Final simplification67.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x y) t) (- z a) y)))
(if (<= t -2.45e+64)
t_1
(if (<= t 7.5e+164) (fma (- z t) (/ (- y x) (- a t)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((x - y) / t), (z - a), y);
double tmp;
if (t <= -2.45e+64) {
tmp = t_1;
} else if (t <= 7.5e+164) {
tmp = fma((z - t), ((y - x) / (a - t)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(x - y) / t), Float64(z - a), y) tmp = 0.0 if (t <= -2.45e+64) tmp = t_1; elseif (t <= 7.5e+164) tmp = fma(Float64(z - t), Float64(Float64(y - x) / Float64(a - t)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -2.45e+64], t$95$1, If[LessEqual[t, 7.5e+164], N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x - y}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -2.45 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+164}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y - x}{a - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.4500000000000001e64 or 7.49999999999999976e164 < t Initial program 35.7%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites89.9%
if -2.4500000000000001e64 < t < 7.49999999999999976e164Initial program 81.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6489.8
Applied rewrites89.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ y a) z x)))
(if (<= a -1.95e+71)
t_1
(if (<= a -7e-67)
(+ (- y x) x)
(if (<= a 3.1e-98) (/ (* (- x y) z) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y / a), z, x);
double tmp;
if (a <= -1.95e+71) {
tmp = t_1;
} else if (a <= -7e-67) {
tmp = (y - x) + x;
} else if (a <= 3.1e-98) {
tmp = ((x - y) * z) / t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y / a), z, x) tmp = 0.0 if (a <= -1.95e+71) tmp = t_1; elseif (a <= -7e-67) tmp = Float64(Float64(y - x) + x); elseif (a <= 3.1e-98) tmp = Float64(Float64(Float64(x - y) * z) / t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision]}, If[LessEqual[a, -1.95e+71], t$95$1, If[LessEqual[a, -7e-67], N[(N[(y - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 3.1e-98], N[(N[(N[(x - y), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{if}\;a \leq -1.95 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -7 \cdot 10^{-67}:\\
\;\;\;\;\left(y - x\right) + x\\
\mathbf{elif}\;a \leq 3.1 \cdot 10^{-98}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.9500000000000001e71 or 3.1e-98 < a Initial program 68.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6485.3
Applied rewrites85.3%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6467.7
Applied rewrites67.7%
Taylor expanded in y around inf
Applied rewrites58.7%
if -1.9500000000000001e71 < a < -7.0000000000000001e-67Initial program 74.7%
Taylor expanded in t around inf
lower--.f6437.6
Applied rewrites37.6%
if -7.0000000000000001e-67 < a < 3.1e-98Initial program 70.3%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6465.8
Applied rewrites65.8%
Taylor expanded in t around 0
Applied rewrites54.1%
Final simplification54.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- x y) t) (- z a) y)))
(if (<= t -7.8e+62)
t_1
(if (<= t 6e+57) (fma (/ (- z t) a) (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((x - y) / t), (z - a), y);
double tmp;
if (t <= -7.8e+62) {
tmp = t_1;
} else if (t <= 6e+57) {
tmp = fma(((z - t) / a), (y - x), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(x - y) / t), Float64(z - a), y) tmp = 0.0 if (t <= -7.8e+62) tmp = t_1; elseif (t <= 6e+57) tmp = fma(Float64(Float64(z - t) / a), Float64(y - x), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t, -7.8e+62], t$95$1, If[LessEqual[t, 6e+57], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{x - y}{t}, z - a, y\right)\\
\mathbf{if}\;t \leq -7.8 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+57}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.8e62 or 5.9999999999999999e57 < t Initial program 44.9%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites82.2%
if -7.8e62 < t < 5.9999999999999999e57Initial program 85.2%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6477.5
Applied rewrites77.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.8e+112) (fma (- y x) (/ z a) x) (if (<= a 1.95e+80) (fma (/ (- x y) t) (- z a) y) (fma (/ (- y x) a) z x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.8e+112) {
tmp = fma((y - x), (z / a), x);
} else if (a <= 1.95e+80) {
tmp = fma(((x - y) / t), (z - a), y);
} else {
tmp = fma(((y - x) / a), z, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.8e+112) tmp = fma(Float64(y - x), Float64(z / a), x); elseif (a <= 1.95e+80) tmp = fma(Float64(Float64(x - y) / t), Float64(z - a), y); else tmp = fma(Float64(Float64(y - x) / a), z, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.8e+112], N[(N[(y - x), $MachinePrecision] * N[(z / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 1.95e+80], N[(N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision] + y), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a}, x\right)\\
\mathbf{elif}\;a \leq 1.95 \cdot 10^{+80}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - y}{t}, z - a, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\end{array}
\end{array}
if a < -6.79999999999999987e112Initial program 72.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6493.4
Applied rewrites93.4%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6478.4
Applied rewrites78.4%
Applied rewrites78.4%
if -6.79999999999999987e112 < a < 1.94999999999999999e80Initial program 68.9%
Taylor expanded in t around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-commutativeN/A
mul-1-negN/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites73.5%
if 1.94999999999999999e80 < a Initial program 70.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6484.6
Applied rewrites84.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.5e-62)
(* (/ z (- t a)) (- x y))
(if (<= z 2.7e+109)
(fma (- x y) (/ t (- a t)) x)
(* (/ (- y x) (- a t)) z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e-62) {
tmp = (z / (t - a)) * (x - y);
} else if (z <= 2.7e+109) {
tmp = fma((x - y), (t / (a - t)), x);
} else {
tmp = ((y - x) / (a - t)) * z;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e-62) tmp = Float64(Float64(z / Float64(t - a)) * Float64(x - y)); elseif (z <= 2.7e+109) tmp = fma(Float64(x - y), Float64(t / Float64(a - t)), x); else tmp = Float64(Float64(Float64(y - x) / Float64(a - t)) * z); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e-62], N[(N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e+109], N[(N[(x - y), $MachinePrecision] * N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{z}{t - a} \cdot \left(x - y\right)\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(x - y, \frac{t}{a - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y - x}{a - t} \cdot z\\
\end{array}
\end{array}
if z < -5.50000000000000022e-62Initial program 72.8%
Taylor expanded in z around inf
div-subN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6471.2
Applied rewrites71.2%
if -5.50000000000000022e-62 < z < 2.70000000000000001e109Initial program 67.4%
Taylor expanded in z around 0
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6466.8
Applied rewrites66.8%
if 2.70000000000000001e109 < z Initial program 73.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6492.8
Applied rewrites92.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f6490.1
Applied rewrites90.1%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
div-subN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6483.4
Applied rewrites83.4%
Final simplification70.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ (- t z) t) y)))
(if (<= t -1.28e+63)
t_1
(if (<= t 1.55e+134) (fma (- y x) (/ z a) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((t - z) / t) * y;
double tmp;
if (t <= -1.28e+63) {
tmp = t_1;
} else if (t <= 1.55e+134) {
tmp = fma((y - x), (z / a), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(t - z) / t) * y) tmp = 0.0 if (t <= -1.28e+63) tmp = t_1; elseif (t <= 1.55e+134) tmp = fma(Float64(y - x), Float64(z / a), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t, -1.28e+63], t$95$1, If[LessEqual[t, 1.55e+134], N[(N[(y - x), $MachinePrecision] * N[(z / a), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{t} \cdot y\\
\mathbf{if}\;t \leq -1.28 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+134}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.27999999999999994e63 or 1.54999999999999991e134 < t Initial program 39.5%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6452.3
Applied rewrites52.3%
Taylor expanded in y around inf
Applied rewrites61.8%
if -1.27999999999999994e63 < t < 1.54999999999999991e134Initial program 82.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6490.4
Applied rewrites90.4%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6463.4
Applied rewrites63.4%
Applied rewrites65.5%
Final simplification64.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.2e-65) (fma (- y x) (/ z a) x) (if (<= a 2.3e-98) (/ (* (- x y) z) t) (fma (/ (- y x) a) z x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.2e-65) {
tmp = fma((y - x), (z / a), x);
} else if (a <= 2.3e-98) {
tmp = ((x - y) * z) / t;
} else {
tmp = fma(((y - x) / a), z, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.2e-65) tmp = fma(Float64(y - x), Float64(z / a), x); elseif (a <= 2.3e-98) tmp = Float64(Float64(Float64(x - y) * z) / t); else tmp = fma(Float64(Float64(y - x) / a), z, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.2e-65], N[(N[(y - x), $MachinePrecision] * N[(z / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, 2.3e-98], N[(N[(N[(x - y), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{-65}:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a}, x\right)\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-98}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\end{array}
\end{array}
if a < -3.1999999999999999e-65Initial program 71.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6485.0
Applied rewrites85.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6458.3
Applied rewrites58.3%
Applied rewrites59.5%
if -3.1999999999999999e-65 < a < 2.30000000000000001e-98Initial program 70.6%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6466.2
Applied rewrites66.2%
Taylor expanded in t around 0
Applied rewrites53.5%
if 2.30000000000000001e-98 < a Initial program 68.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6464.6
Applied rewrites64.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ (- y x) a) z x))) (if (<= a -1.35e-45) t_1 (if (<= a 2.3e-98) (/ (* (- x y) z) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((y - x) / a), z, x);
double tmp;
if (a <= -1.35e-45) {
tmp = t_1;
} else if (a <= 2.3e-98) {
tmp = ((x - y) * z) / t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(y - x) / a), z, x) tmp = 0.0 if (a <= -1.35e-45) tmp = t_1; elseif (a <= 2.3e-98) tmp = Float64(Float64(Float64(x - y) * z) / t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision]}, If[LessEqual[a, -1.35e-45], t$95$1, If[LessEqual[a, 2.3e-98], N[(N[(N[(x - y), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\mathbf{if}\;a \leq -1.35 \cdot 10^{-45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-98}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.34999999999999992e-45 or 2.30000000000000001e-98 < a Initial program 69.2%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6462.0
Applied rewrites62.0%
if -1.34999999999999992e-45 < a < 2.30000000000000001e-98Initial program 71.0%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6465.5
Applied rewrites65.5%
Taylor expanded in t around 0
Applied rewrites52.9%
(FPCore (x y z t a) :precision binary64 (if (<= x -2.25e-60) (* (/ z t) x) (if (<= x 7.3e+18) (+ (- y x) x) (* (/ x t) z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.25e-60) {
tmp = (z / t) * x;
} else if (x <= 7.3e+18) {
tmp = (y - x) + x;
} else {
tmp = (x / 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) :: tmp
if (x <= (-2.25d-60)) then
tmp = (z / t) * x
else if (x <= 7.3d+18) then
tmp = (y - x) + x
else
tmp = (x / t) * z
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.25e-60) {
tmp = (z / t) * x;
} else if (x <= 7.3e+18) {
tmp = (y - x) + x;
} else {
tmp = (x / t) * z;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.25e-60: tmp = (z / t) * x elif x <= 7.3e+18: tmp = (y - x) + x else: tmp = (x / t) * z return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.25e-60) tmp = Float64(Float64(z / t) * x); elseif (x <= 7.3e+18) tmp = Float64(Float64(y - x) + x); else tmp = Float64(Float64(x / t) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.25e-60) tmp = (z / t) * x; elseif (x <= 7.3e+18) tmp = (y - x) + x; else tmp = (x / t) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.25e-60], N[(N[(z / t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, 7.3e+18], N[(N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(x / t), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.25 \cdot 10^{-60}:\\
\;\;\;\;\frac{z}{t} \cdot x\\
\mathbf{elif}\;x \leq 7.3 \cdot 10^{+18}:\\
\;\;\;\;\left(y - x\right) + x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} \cdot z\\
\end{array}
\end{array}
if x < -2.25e-60Initial program 58.2%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6430.6
Applied rewrites30.6%
Taylor expanded in x around inf
Applied rewrites27.0%
if -2.25e-60 < x < 7.3e18Initial program 81.2%
Taylor expanded in t around inf
lower--.f6429.7
Applied rewrites29.7%
if 7.3e18 < x Initial program 63.1%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6424.9
Applied rewrites24.9%
Taylor expanded in x around inf
Applied rewrites27.4%
Applied rewrites27.5%
Final simplification28.3%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ x t) z))) (if (<= x -2.25e-60) t_1 (if (<= x 7.3e+18) (+ (- y x) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x / t) * z;
double tmp;
if (x <= -2.25e-60) {
tmp = t_1;
} else if (x <= 7.3e+18) {
tmp = (y - x) + 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 = (x / t) * z
if (x <= (-2.25d-60)) then
tmp = t_1
else if (x <= 7.3d+18) then
tmp = (y - x) + 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 = (x / t) * z;
double tmp;
if (x <= -2.25e-60) {
tmp = t_1;
} else if (x <= 7.3e+18) {
tmp = (y - x) + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x / t) * z tmp = 0 if x <= -2.25e-60: tmp = t_1 elif x <= 7.3e+18: tmp = (y - x) + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x / t) * z) tmp = 0.0 if (x <= -2.25e-60) tmp = t_1; elseif (x <= 7.3e+18) tmp = Float64(Float64(y - x) + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x / t) * z; tmp = 0.0; if (x <= -2.25e-60) tmp = t_1; elseif (x <= 7.3e+18) tmp = (y - x) + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[x, -2.25e-60], t$95$1, If[LessEqual[x, 7.3e+18], N[(N[(y - x), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t} \cdot z\\
\mathbf{if}\;x \leq -2.25 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7.3 \cdot 10^{+18}:\\
\;\;\;\;\left(y - x\right) + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.25e-60 or 7.3e18 < x Initial program 60.4%
Taylor expanded in a around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6428.1
Applied rewrites28.1%
Taylor expanded in x around inf
Applied rewrites27.2%
Applied rewrites27.2%
if -2.25e-60 < x < 7.3e18Initial program 81.2%
Taylor expanded in t around inf
lower--.f6429.7
Applied rewrites29.7%
Final simplification28.3%
(FPCore (x y z t a) :precision binary64 (+ (- y x) x))
double code(double x, double y, double z, double t, double a) {
return (y - x) + 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) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (y - x) + x;
}
def code(x, y, z, t, a): return (y - x) + x
function code(x, y, z, t, a) return Float64(Float64(y - x) + x) end
function tmp = code(x, y, z, t, a) tmp = (y - x) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(y - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\left(y - x\right) + x
\end{array}
Initial program 69.8%
Taylor expanded in t around inf
lower--.f6417.6
Applied rewrites17.6%
Final simplification17.6%
(FPCore (x y z t a) :precision binary64 (+ (- x) x))
double code(double x, double y, double z, double t, double a) {
return -x + 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 + x
end function
public static double code(double x, double y, double z, double t, double a) {
return -x + x;
}
def code(x, y, z, t, a): return -x + x
function code(x, y, z, t, a) return Float64(Float64(-x) + x) end
function tmp = code(x, y, z, t, a) tmp = -x + x; end
code[x_, y_, z_, t_, a_] := N[((-x) + x), $MachinePrecision]
\begin{array}{l}
\\
\left(-x\right) + x
\end{array}
Initial program 69.8%
Taylor expanded in t around inf
lower--.f6417.6
Applied rewrites17.6%
Taylor expanded in y around 0
Applied rewrites2.7%
Final simplification2.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))
(if (< a -1.6153062845442575e-142)
t_1
(if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
double tmp;
if (a < -1.6153062845442575e-142) {
tmp = t_1;
} else if (a < 3.774403170083174e-182) {
tmp = y - ((z / t) * (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 = x + (((y - x) / 1.0d0) * ((z - t) / (a - t)))
if (a < (-1.6153062845442575d-142)) then
tmp = t_1
else if (a < 3.774403170083174d-182) then
tmp = y - ((z / t) * (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 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
double tmp;
if (a < -1.6153062845442575e-142) {
tmp = t_1;
} else if (a < 3.774403170083174e-182) {
tmp = y - ((z / t) * (y - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t))) tmp = 0 if a < -1.6153062845442575e-142: tmp = t_1 elif a < 3.774403170083174e-182: tmp = y - ((z / t) * (y - x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) / 1.0) * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (a < -1.6153062845442575e-142) tmp = t_1; elseif (a < 3.774403170083174e-182) tmp = Float64(y - Float64(Float64(z / t) * Float64(y - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t))); tmp = 0.0; if (a < -1.6153062845442575e-142) tmp = t_1; elseif (a < 3.774403170083174e-182) tmp = y - ((z / t) * (y - x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] / 1.0), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[a, -1.6153062845442575e-142], t$95$1, If[Less[a, 3.774403170083174e-182], N[(y - N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;a < -1.6153062845442575 \cdot 10^{-142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\
\;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024255
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (if (< a -646122513817703/4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 1887201585041587/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))