
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
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 - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
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 - x)) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * (t - x)) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * (t - x)) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * (t - x)) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.85e+208) (not (<= z 7e+147))) (- t (* (/ (- t x) z) (- y a))) (fma (- t x) (/ (- y z) (- a z)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.85e+208) || !(z <= 7e+147)) {
tmp = t - (((t - x) / z) * (y - a));
} else {
tmp = fma((t - x), ((y - z) / (a - z)), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.85e+208) || !(z <= 7e+147)) tmp = Float64(t - Float64(Float64(Float64(t - x) / z) * Float64(y - a))); else tmp = fma(Float64(t - x), Float64(Float64(y - z) / Float64(a - z)), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.85e+208], N[Not[LessEqual[z, 7e+147]], $MachinePrecision]], N[(t - N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.85 \cdot 10^{+208} \lor \neg \left(z \leq 7 \cdot 10^{+147}\right):\\
\;\;\;\;t - \frac{t - x}{z} \cdot \left(y - a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\
\end{array}
\end{array}
if z < -2.85000000000000015e208 or 6.99999999999999949e147 < z Initial program 19.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6456.1
Applied rewrites56.1%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6493.2
Applied rewrites93.2%
if -2.85000000000000015e208 < z < 6.99999999999999949e147Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6490.8
Applied rewrites90.8%
Final simplification91.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (/ (* (- t x) (- y a)) z)))
(t_2 (fma (/ (- y z) a) (- t x) x)))
(if (<= a -880000000000.0)
t_2
(if (<= a -4.2e-80)
t_1
(if (<= a -3.7e-194)
(* (- t x) (/ y (- a z)))
(if (<= a 2.65e-36) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (((t - x) * (y - a)) / z);
double t_2 = fma(((y - z) / a), (t - x), x);
double tmp;
if (a <= -880000000000.0) {
tmp = t_2;
} else if (a <= -4.2e-80) {
tmp = t_1;
} else if (a <= -3.7e-194) {
tmp = (t - x) * (y / (a - z));
} else if (a <= 2.65e-36) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(Float64(t - x) * Float64(y - a)) / z)) t_2 = fma(Float64(Float64(y - z) / a), Float64(t - x), x) tmp = 0.0 if (a <= -880000000000.0) tmp = t_2; elseif (a <= -4.2e-80) tmp = t_1; elseif (a <= -3.7e-194) tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z))); elseif (a <= 2.65e-36) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -880000000000.0], t$95$2, If[LessEqual[a, -4.2e-80], t$95$1, If[LessEqual[a, -3.7e-194], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.65e-36], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\\
t_2 := \mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\mathbf{if}\;a \leq -880000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -4.2 \cdot 10^{-80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3.7 \cdot 10^{-194}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{elif}\;a \leq 2.65 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -8.8e11 or 2.6499999999999999e-36 < a Initial program 69.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6492.6
Applied rewrites92.6%
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.8
Applied rewrites77.8%
if -8.8e11 < a < -4.20000000000000003e-80 or -3.70000000000000008e-194 < a < 2.6499999999999999e-36Initial program 56.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6466.4
Applied rewrites66.4%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f6443.0
Applied rewrites43.0%
Taylor expanded in a 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
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6450.4
Applied rewrites50.4%
Taylor expanded in z around inf
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
mul-1-negN/A
div-subN/A
mul-1-negN/A
distribute-lft-out--N/A
associate-*r/N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites84.3%
if -4.20000000000000003e-80 < a < -3.70000000000000008e-194Initial program 83.1%
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--.f6486.5
Applied rewrites86.5%
Final simplification80.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- t) (/ z (- a z)))))
(if (<= z -1.55e+105)
t_1
(if (<= z 3.5e-117)
(fma (/ y a) (- t x) x)
(if (<= z 4.5e+106) (* (- t x) (/ y (- a z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -t * (z / (a - z));
double tmp;
if (z <= -1.55e+105) {
tmp = t_1;
} else if (z <= 3.5e-117) {
tmp = fma((y / a), (t - x), x);
} else if (z <= 4.5e+106) {
tmp = (t - x) * (y / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(-t) * Float64(z / Float64(a - z))) tmp = 0.0 if (z <= -1.55e+105) tmp = t_1; elseif (z <= 3.5e-117) tmp = fma(Float64(y / a), Float64(t - x), x); elseif (z <= 4.5e+106) tmp = Float64(Float64(t - x) * Float64(y / Float64(a - z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-t) * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.55e+105], t$95$1, If[LessEqual[z, 3.5e-117], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 4.5e+106], N[(N[(t - x), $MachinePrecision] * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-t\right) \cdot \frac{z}{a - z}\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-117}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+106}:\\
\;\;\;\;\left(t - x\right) \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.55000000000000002e105 or 4.4999999999999997e106 < z Initial program 30.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6466.1
Applied rewrites66.1%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6457.5
Applied rewrites57.5%
Taylor expanded in y around 0
Applied rewrites58.3%
if -1.55000000000000002e105 < z < 3.4999999999999998e-117Initial program 85.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6493.8
Applied rewrites93.8%
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--.f6475.8
Applied rewrites75.8%
Taylor expanded in y around inf
Applied rewrites71.1%
if 3.4999999999999998e-117 < z < 4.4999999999999997e106Initial program 70.4%
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--.f6465.1
Applied rewrites65.1%
Final simplification66.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -64000000000000.0) (not (<= a 3.9e-10))) (fma (/ (- y z) a) (- t x) x) (- t (* (/ (- t x) z) (- y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -64000000000000.0) || !(a <= 3.9e-10)) {
tmp = fma(((y - z) / a), (t - x), x);
} else {
tmp = t - (((t - x) / z) * (y - a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -64000000000000.0) || !(a <= 3.9e-10)) tmp = fma(Float64(Float64(y - z) / a), Float64(t - x), x); else tmp = Float64(t - Float64(Float64(Float64(t - x) / z) * Float64(y - a))); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -64000000000000.0], N[Not[LessEqual[a, 3.9e-10]], $MachinePrecision]], N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], N[(t - N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -64000000000000 \lor \neg \left(a \leq 3.9 \cdot 10^{-10}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;t - \frac{t - x}{z} \cdot \left(y - a\right)\\
\end{array}
\end{array}
if a < -6.4e13 or 3.9e-10 < a Initial program 69.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6492.9
Applied rewrites92.9%
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--.f6479.2
Applied rewrites79.2%
if -6.4e13 < a < 3.9e-10Initial program 61.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6474.8
Applied rewrites74.8%
Taylor expanded in z around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
div-subN/A
associate-/l*N/A
associate-/l*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6479.7
Applied rewrites79.7%
Final simplification79.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (- t x))))
(if (<= z -8e+98)
t_1
(if (<= z 4.6e-157)
(* (/ (- t x) a) y)
(if (<= z 2.8e+209) (* (/ t (- a z)) y) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t - x);
double tmp;
if (z <= -8e+98) {
tmp = t_1;
} else if (z <= 4.6e-157) {
tmp = ((t - x) / a) * y;
} else if (z <= 2.8e+209) {
tmp = (t / (a - z)) * y;
} 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 - x)
if (z <= (-8d+98)) then
tmp = t_1
else if (z <= 4.6d-157) then
tmp = ((t - x) / a) * y
else if (z <= 2.8d+209) then
tmp = (t / (a - z)) * y
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 - x);
double tmp;
if (z <= -8e+98) {
tmp = t_1;
} else if (z <= 4.6e-157) {
tmp = ((t - x) / a) * y;
} else if (z <= 2.8e+209) {
tmp = (t / (a - z)) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t - x) tmp = 0 if z <= -8e+98: tmp = t_1 elif z <= 4.6e-157: tmp = ((t - x) / a) * y elif z <= 2.8e+209: tmp = (t / (a - z)) * y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t - x)) tmp = 0.0 if (z <= -8e+98) tmp = t_1; elseif (z <= 4.6e-157) tmp = Float64(Float64(Float64(t - x) / a) * y); elseif (z <= 2.8e+209) tmp = Float64(Float64(t / Float64(a - z)) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t - x); tmp = 0.0; if (z <= -8e+98) tmp = t_1; elseif (z <= 4.6e-157) tmp = ((t - x) / a) * y; elseif (z <= 2.8e+209) tmp = (t / (a - z)) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+98], t$95$1, If[LessEqual[z, 4.6e-157], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 2.8e+209], N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(t - x\right)\\
\mathbf{if}\;z \leq -8 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-157}:\\
\;\;\;\;\frac{t - x}{a} \cdot y\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+209}:\\
\;\;\;\;\frac{t}{a - z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.99999999999999998e98 or 2.80000000000000013e209 < z Initial program 32.0%
Taylor expanded in z around inf
lower--.f6443.6
Applied rewrites43.6%
if -7.99999999999999998e98 < z < 4.59999999999999977e-157Initial program 85.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6494.2
Applied rewrites94.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--.f6476.4
Applied rewrites76.4%
Taylor expanded in y around inf
Applied rewrites40.3%
if 4.59999999999999977e-157 < z < 2.80000000000000013e209Initial program 59.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6480.8
Applied rewrites80.8%
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--.f6455.0
Applied rewrites55.0%
Taylor expanded in x around 0
Applied rewrites39.7%
Applied rewrites39.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.25e+55) (not (<= z 3.5e-117))) (* t (/ (- y z) (- a z))) (fma (/ (- y z) a) (- t x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.25e+55) || !(z <= 3.5e-117)) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = fma(((y - z) / a), (t - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.25e+55) || !(z <= 3.5e-117)) tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); else tmp = fma(Float64(Float64(y - z) / a), Float64(t - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.25e+55], N[Not[LessEqual[z, 3.5e-117]], $MachinePrecision]], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+55} \lor \neg \left(z \leq 3.5 \cdot 10^{-117}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a}, t - x, x\right)\\
\end{array}
\end{array}
if z < -2.24999999999999999e55 or 3.4999999999999998e-117 < z Initial program 45.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6474.8
Applied rewrites74.8%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6460.8
Applied rewrites60.8%
Applied rewrites66.3%
if -2.24999999999999999e55 < z < 3.4999999999999998e-117Initial program 86.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6494.0
Applied rewrites94.0%
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--.f6478.0
Applied rewrites78.0%
Final simplification71.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.4e+16) (not (<= a 2e-44))) (fma (- y z) (/ (- t x) a) x) (* t (/ (- y z) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.4e+16) || !(a <= 2e-44)) {
tmp = fma((y - z), ((t - x) / a), x);
} else {
tmp = t * ((y - z) / (a - z));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.4e+16) || !(a <= 2e-44)) tmp = fma(Float64(y - z), Float64(Float64(t - x) / a), x); else tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.4e+16], N[Not[LessEqual[a, 2e-44]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{+16} \lor \neg \left(a \leq 2 \cdot 10^{-44}\right):\\
\;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\end{array}
\end{array}
if a < -2.4e16 or 1.99999999999999991e-44 < a Initial program 68.7%
Taylor expanded in a around inf
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6476.2
Applied rewrites76.2%
if -2.4e16 < a < 1.99999999999999991e-44Initial program 61.0%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6474.1
Applied rewrites74.1%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6454.7
Applied rewrites54.7%
Applied rewrites63.5%
Final simplification70.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e+55) (not (<= z 3.2e-117))) (* t (/ (- y z) (- a z))) (fma (/ y a) (- t x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e+55) || !(z <= 3.2e-117)) {
tmp = t * ((y - z) / (a - z));
} else {
tmp = fma((y / a), (t - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e+55) || !(z <= 3.2e-117)) tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z))); else tmp = fma(Float64(y / a), Float64(t - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e+55], N[Not[LessEqual[z, 3.2e-117]], $MachinePrecision]], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+55} \lor \neg \left(z \leq 3.2 \cdot 10^{-117}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\end{array}
\end{array}
if z < -1.75000000000000005e55 or 3.19999999999999995e-117 < z Initial program 45.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6474.8
Applied rewrites74.8%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6460.8
Applied rewrites60.8%
Applied rewrites66.3%
if -1.75000000000000005e55 < z < 3.19999999999999995e-117Initial program 86.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6494.0
Applied rewrites94.0%
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--.f6478.0
Applied rewrites78.0%
Taylor expanded in y around inf
Applied rewrites74.4%
Final simplification70.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.95e+55) (not (<= z 2.9e-116))) (* (- y z) (/ t (- a z))) (fma (/ y a) (- t x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.95e+55) || !(z <= 2.9e-116)) {
tmp = (y - z) * (t / (a - z));
} else {
tmp = fma((y / a), (t - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.95e+55) || !(z <= 2.9e-116)) tmp = Float64(Float64(y - z) * Float64(t / Float64(a - z))); else tmp = fma(Float64(y / a), Float64(t - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.95e+55], N[Not[LessEqual[z, 2.9e-116]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+55} \lor \neg \left(z \leq 2.9 \cdot 10^{-116}\right):\\
\;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\end{array}
\end{array}
if z < -1.95000000000000014e55 or 2.8999999999999998e-116 < z Initial program 45.4%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6460.5
Applied rewrites60.5%
if -1.95000000000000014e55 < z < 2.8999999999999998e-116Initial program 86.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6494.1
Applied rewrites94.1%
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--.f6478.2
Applied rewrites78.2%
Taylor expanded in y around inf
Applied rewrites74.6%
Final simplification67.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y x) z)))
(if (<= x -5.1e-96)
t_1
(if (<= x -1.9e-231)
(/ (* y t) a)
(if (<= x 6.5e+74) (+ x (- t x)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * x) / z;
double tmp;
if (x <= -5.1e-96) {
tmp = t_1;
} else if (x <= -1.9e-231) {
tmp = (y * t) / a;
} else if (x <= 6.5e+74) {
tmp = x + (t - 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 * x) / z
if (x <= (-5.1d-96)) then
tmp = t_1
else if (x <= (-1.9d-231)) then
tmp = (y * t) / a
else if (x <= 6.5d+74) then
tmp = x + (t - 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 * x) / z;
double tmp;
if (x <= -5.1e-96) {
tmp = t_1;
} else if (x <= -1.9e-231) {
tmp = (y * t) / a;
} else if (x <= 6.5e+74) {
tmp = x + (t - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * x) / z tmp = 0 if x <= -5.1e-96: tmp = t_1 elif x <= -1.9e-231: tmp = (y * t) / a elif x <= 6.5e+74: tmp = x + (t - x) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * x) / z) tmp = 0.0 if (x <= -5.1e-96) tmp = t_1; elseif (x <= -1.9e-231) tmp = Float64(Float64(y * t) / a); elseif (x <= 6.5e+74) tmp = Float64(x + Float64(t - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * x) / z; tmp = 0.0; if (x <= -5.1e-96) tmp = t_1; elseif (x <= -1.9e-231) tmp = (y * t) / a; elseif (x <= 6.5e+74) tmp = x + (t - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[x, -5.1e-96], t$95$1, If[LessEqual[x, -1.9e-231], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[x, 6.5e+74], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot x}{z}\\
\mathbf{if}\;x \leq -5.1 \cdot 10^{-96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-231}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+74}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.09999999999999973e-96 or 6.49999999999999962e74 < x Initial program 57.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6476.3
Applied rewrites76.3%
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--.f6446.1
Applied rewrites46.1%
Taylor expanded in z around inf
Applied rewrites33.4%
Taylor expanded in x around inf
Applied rewrites25.4%
if -5.09999999999999973e-96 < x < -1.90000000000000007e-231Initial program 75.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6495.6
Applied rewrites95.6%
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--.f6461.4
Applied rewrites61.4%
Taylor expanded in x around 0
Applied rewrites50.7%
Taylor expanded in z around 0
Applied rewrites36.1%
if -1.90000000000000007e-231 < x < 6.49999999999999962e74Initial program 69.5%
Taylor expanded in z around inf
lower--.f6430.3
Applied rewrites30.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.55e+105) (not (<= z 8.5e+105))) (* (- t) (/ z (- a z))) (fma (/ y a) (- t x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.55e+105) || !(z <= 8.5e+105)) {
tmp = -t * (z / (a - z));
} else {
tmp = fma((y / a), (t - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.55e+105) || !(z <= 8.5e+105)) tmp = Float64(Float64(-t) * Float64(z / Float64(a - z))); else tmp = fma(Float64(y / a), Float64(t - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.55e+105], N[Not[LessEqual[z, 8.5e+105]], $MachinePrecision]], N[((-t) * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+105} \lor \neg \left(z \leq 8.5 \cdot 10^{+105}\right):\\
\;\;\;\;\left(-t\right) \cdot \frac{z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\end{array}
\end{array}
if z < -1.55000000000000002e105 or 8.49999999999999986e105 < z Initial program 30.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6466.1
Applied rewrites66.1%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6457.5
Applied rewrites57.5%
Taylor expanded in y around 0
Applied rewrites58.3%
if -1.55000000000000002e105 < z < 8.49999999999999986e105Initial program 82.1%
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 a around inf
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6471.7
Applied rewrites71.7%
Taylor expanded in y around inf
Applied rewrites66.5%
Final simplification63.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.7e-194) (not (<= a 1.55e-52))) (fma (/ y a) (- t x) x) (* (- y) (/ (- t x) z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.7e-194) || !(a <= 1.55e-52)) {
tmp = fma((y / a), (t - x), x);
} else {
tmp = -y * ((t - x) / z);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.7e-194) || !(a <= 1.55e-52)) tmp = fma(Float64(y / a), Float64(t - x), x); else tmp = Float64(Float64(-y) * Float64(Float64(t - x) / z)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.7e-194], N[Not[LessEqual[a, 1.55e-52]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], N[((-y) * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.7 \cdot 10^{-194} \lor \neg \left(a \leq 1.55 \cdot 10^{-52}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) \cdot \frac{t - x}{z}\\
\end{array}
\end{array}
if a < -3.70000000000000008e-194 or 1.5499999999999999e-52 < a Initial program 69.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6490.8
Applied rewrites90.8%
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--.f6471.8
Applied rewrites71.8%
Taylor expanded in y around inf
Applied rewrites64.3%
if -3.70000000000000008e-194 < a < 1.5499999999999999e-52Initial program 56.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6469.5
Applied rewrites69.5%
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--.f6448.1
Applied rewrites48.1%
Taylor expanded in z around inf
Applied rewrites46.0%
Final simplification58.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.85e+105) (not (<= z 7.2e+113))) (+ x (- t x)) (fma (/ y a) (- t x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.85e+105) || !(z <= 7.2e+113)) {
tmp = x + (t - x);
} else {
tmp = fma((y / a), (t - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.85e+105) || !(z <= 7.2e+113)) tmp = Float64(x + Float64(t - x)); else tmp = fma(Float64(y / a), Float64(t - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.85e+105], N[Not[LessEqual[z, 7.2e+113]], $MachinePrecision]], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+105} \lor \neg \left(z \leq 7.2 \cdot 10^{+113}\right):\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t - x, x\right)\\
\end{array}
\end{array}
if z < -1.84999999999999992e105 or 7.19999999999999984e113 < z Initial program 28.6%
Taylor expanded in z around inf
lower--.f6437.9
Applied rewrites37.9%
if -1.84999999999999992e105 < z < 7.19999999999999984e113Initial program 82.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6492.9
Applied rewrites92.9%
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--.f6471.6
Applied rewrites71.6%
Taylor expanded in y around inf
Applied rewrites65.9%
Final simplification56.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.85e+105) (not (<= z 7.2e+113))) (+ x (- t x)) (fma (/ (- t x) a) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.85e+105) || !(z <= 7.2e+113)) {
tmp = x + (t - x);
} else {
tmp = fma(((t - x) / a), y, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.85e+105) || !(z <= 7.2e+113)) tmp = Float64(x + Float64(t - x)); else tmp = fma(Float64(Float64(t - x) / a), y, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.85e+105], N[Not[LessEqual[z, 7.2e+113]], $MachinePrecision]], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+105} \lor \neg \left(z \leq 7.2 \cdot 10^{+113}\right):\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a}, y, x\right)\\
\end{array}
\end{array}
if z < -1.84999999999999992e105 or 7.19999999999999984e113 < z Initial program 28.6%
Taylor expanded in z around inf
lower--.f6437.9
Applied rewrites37.9%
if -1.84999999999999992e105 < z < 7.19999999999999984e113Initial program 82.3%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6464.0
Applied rewrites64.0%
Final simplification55.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.1e+72) (not (<= y 1.2e+64))) (* (/ (- t x) a) y) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.1e+72) || !(y <= 1.2e+64)) {
tmp = ((t - x) / a) * y;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-1.1d+72)) .or. (.not. (y <= 1.2d+64))) then
tmp = ((t - x) / a) * y
else
tmp = x + ((y * t) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.1e+72) || !(y <= 1.2e+64)) {
tmp = ((t - x) / a) * y;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.1e+72) or not (y <= 1.2e+64): tmp = ((t - x) / a) * y else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.1e+72) || !(y <= 1.2e+64)) tmp = Float64(Float64(Float64(t - x) / a) * y); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.1e+72) || ~((y <= 1.2e+64))) tmp = ((t - x) / a) * y; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.1e+72], N[Not[LessEqual[y, 1.2e+64]], $MachinePrecision]], N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+72} \lor \neg \left(y \leq 1.2 \cdot 10^{+64}\right):\\
\;\;\;\;\frac{t - x}{a} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if y < -1.1e72 or 1.2e64 < y Initial program 62.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6491.6
Applied rewrites91.6%
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--.f6456.3
Applied rewrites56.3%
Taylor expanded in y around inf
Applied rewrites49.4%
if -1.1e72 < y < 1.2e64Initial program 66.9%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6442.9
Applied rewrites42.9%
Taylor expanded in x around 0
Applied rewrites40.0%
Final simplification43.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.3e+95) (not (<= z 2.8e+209))) (+ x (- t x)) (* t (/ y (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e+95) || !(z <= 2.8e+209)) {
tmp = x + (t - x);
} else {
tmp = t * (y / (a - z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-4.3d+95)) .or. (.not. (z <= 2.8d+209))) then
tmp = x + (t - x)
else
tmp = t * (y / (a - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e+95) || !(z <= 2.8e+209)) {
tmp = x + (t - x);
} else {
tmp = t * (y / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.3e+95) or not (z <= 2.8e+209): tmp = x + (t - x) else: tmp = t * (y / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.3e+95) || !(z <= 2.8e+209)) tmp = Float64(x + Float64(t - x)); else tmp = Float64(t * Float64(y / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.3e+95) || ~((z <= 2.8e+209))) tmp = x + (t - x); else tmp = t * (y / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.3e+95], N[Not[LessEqual[z, 2.8e+209]], $MachinePrecision]], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+95} \lor \neg \left(z \leq 2.8 \cdot 10^{+209}\right):\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -4.3e95 or 2.80000000000000013e209 < z Initial program 33.9%
Taylor expanded in z around inf
lower--.f6443.8
Applied rewrites43.8%
if -4.3e95 < z < 2.80000000000000013e209Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6489.7
Applied rewrites89.7%
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--.f6453.6
Applied rewrites53.6%
Taylor expanded in x around 0
Applied rewrites32.1%
Final simplification35.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.5e-41) (not (<= z 3.9e+159))) (+ x (- t x)) (/ (* y t) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.5e-41) || !(z <= 3.9e+159)) {
tmp = x + (t - x);
} else {
tmp = (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 <= (-5.5d-41)) .or. (.not. (z <= 3.9d+159))) then
tmp = x + (t - x)
else
tmp = (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 <= -5.5e-41) || !(z <= 3.9e+159)) {
tmp = x + (t - x);
} else {
tmp = (y * t) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.5e-41) or not (z <= 3.9e+159): tmp = x + (t - x) else: tmp = (y * t) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.5e-41) || !(z <= 3.9e+159)) tmp = Float64(x + Float64(t - x)); else tmp = Float64(Float64(y * t) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.5e-41) || ~((z <= 3.9e+159))) tmp = x + (t - x); else tmp = (y * t) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.5e-41], N[Not[LessEqual[z, 3.9e+159]], $MachinePrecision]], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-41} \lor \neg \left(z \leq 3.9 \cdot 10^{+159}\right):\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -5.50000000000000022e-41 or 3.9000000000000001e159 < z Initial program 45.2%
Taylor expanded in z around inf
lower--.f6434.8
Applied rewrites34.8%
if -5.50000000000000022e-41 < z < 3.9000000000000001e159Initial program 79.9%
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 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--.f6455.7
Applied rewrites55.7%
Taylor expanded in x around 0
Applied rewrites33.8%
Taylor expanded in z around 0
Applied rewrites20.5%
Final simplification26.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.2e-9) (+ x (- t x)) (if (<= t 5.5e-67) (/ (* y x) z) (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.2e-9) {
tmp = x + (t - x);
} else if (t <= 5.5e-67) {
tmp = (y * x) / z;
} else {
tmp = t * (y / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-2.2d-9)) then
tmp = x + (t - x)
else if (t <= 5.5d-67) then
tmp = (y * x) / z
else
tmp = t * (y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.2e-9) {
tmp = x + (t - x);
} else if (t <= 5.5e-67) {
tmp = (y * x) / z;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.2e-9: tmp = x + (t - x) elif t <= 5.5e-67: tmp = (y * x) / z else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.2e-9) tmp = Float64(x + Float64(t - x)); elseif (t <= 5.5e-67) tmp = Float64(Float64(y * x) / z); else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.2e-9) tmp = x + (t - x); elseif (t <= 5.5e-67) tmp = (y * x) / z; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.2e-9], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e-67], N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{-9}:\\
\;\;\;\;x + \left(t - x\right)\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-67}:\\
\;\;\;\;\frac{y \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.1999999999999998e-9Initial program 55.8%
Taylor expanded in z around inf
lower--.f6430.2
Applied rewrites30.2%
if -2.1999999999999998e-9 < t < 5.5000000000000003e-67Initial program 67.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6472.7
Applied rewrites72.7%
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--.f6451.3
Applied rewrites51.3%
Taylor expanded in z around inf
Applied rewrites33.7%
Taylor expanded in x around inf
Applied rewrites27.6%
if 5.5000000000000003e-67 < t Initial program 68.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6496.6
Applied rewrites96.6%
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--.f6450.8
Applied rewrites50.8%
Taylor expanded in x around 0
Applied rewrites40.6%
Taylor expanded in z around 0
Applied rewrites34.9%
(FPCore (x y z t a) :precision binary64 (+ x (- t x)))
double code(double x, double y, double z, double t, double a) {
return x + (t - 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 + (t - x)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t - x);
}
def code(x, y, z, t, a): return x + (t - x)
function code(x, y, z, t, a) return Float64(x + Float64(t - x)) end
function tmp = code(x, y, z, t, a) tmp = x + (t - x); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t - x\right)
\end{array}
Initial program 65.1%
Taylor expanded in z around inf
lower--.f6419.3
Applied rewrites19.3%
(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(x + Float64(-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}
\\
x + \left(-x\right)
\end{array}
Initial program 65.1%
Taylor expanded in z around inf
lower--.f6419.3
Applied rewrites19.3%
Taylor expanded in x around inf
Applied rewrites2.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* (/ y z) (- t x)))))
(if (< z -1.2536131056095036e+188)
t_1
(if (< z 4.446702369113811e+64)
(+ x (/ (- y z) (/ (- a z) (- t x))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - 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 = t - ((y / z) * (t - x))
if (z < (-1.2536131056095036d+188)) then
tmp = t_1
else if (z < 4.446702369113811d+64) then
tmp = x + ((y - z) / ((a - z) / (t - 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 = t - ((y / z) * (t - x));
double tmp;
if (z < -1.2536131056095036e+188) {
tmp = t_1;
} else if (z < 4.446702369113811e+64) {
tmp = x + ((y - z) / ((a - z) / (t - x)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - ((y / z) * (t - x)) tmp = 0 if z < -1.2536131056095036e+188: tmp = t_1 elif z < 4.446702369113811e+64: tmp = x + ((y - z) / ((a - z) / (t - x))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(Float64(y / z) * Float64(t - x))) tmp = 0.0 if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / Float64(t - x)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - ((y / z) * (t - x)); tmp = 0.0; if (z < -1.2536131056095036e+188) tmp = t_1; elseif (z < 4.446702369113811e+64) tmp = x + ((y - z) / ((a - z) / (t - x))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(y / z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -1.2536131056095036e+188], t$95$1, If[Less[z, 4.446702369113811e+64], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - \frac{y}{z} \cdot \left(t - x\right)\\
\mathbf{if}\;z < -1.2536131056095036 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024313
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (if (< z -125361310560950360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- t (* (/ y z) (- t x))) (if (< z 44467023691138110000000000000000000000000000000000000000000000000) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x))))))
(+ x (/ (* (- y z) (- t x)) (- a z))))