
(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 20 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 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (or (<= t_1 -1e-307) (not (<= t_1 0.0)))
(fma (/ (- z t) (- a t)) (- y x) x)
(- y (/ (fma (- x) (- z a) (* (- z a) y)) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if ((t_1 <= -1e-307) || !(t_1 <= 0.0)) {
tmp = fma(((z - t) / (a - t)), (y - x), x);
} else {
tmp = y - (fma(-x, (z - a), ((z - a) * y)) / t);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -1e-307) || !(t_1 <= 0.0)) tmp = fma(Float64(Float64(z - t) / Float64(a - t)), Float64(y - x), x); else tmp = Float64(y - Float64(fma(Float64(-x), Float64(z - a), Float64(Float64(z - a) * y)) / t)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e-307], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(y - N[(N[((-x) * N[(z - a), $MachinePrecision] + N[(N[(z - a), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-307} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;y - \frac{\mathsf{fma}\left(-x, z - a, \left(z - a\right) \cdot y\right)}{t}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -9.99999999999999909e-308 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 74.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6492.4
Applied rewrites92.4%
if -9.99999999999999909e-308 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 4.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f644.3
Applied rewrites4.3%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/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--.f6494.7
Applied rewrites94.7%
Taylor expanded in x around 0
Applied rewrites99.7%
Final simplification92.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (or (<= t_1 -1e-307) (not (<= t_1 0.0)))
(fma (/ (- z t) (- a t)) (- y x) x)
(- y (* (/ (- y x) t) (- z a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if ((t_1 <= -1e-307) || !(t_1 <= 0.0)) {
tmp = fma(((z - t) / (a - t)), (y - x), x);
} else {
tmp = y - (((y - x) / t) * (z - a));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -1e-307) || !(t_1 <= 0.0)) tmp = fma(Float64(Float64(z - t) / Float64(a - t)), Float64(y - x), x); else tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * Float64(z - a))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e-307], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-307} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a - t}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;y - \frac{y - x}{t} \cdot \left(z - a\right)\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -9.99999999999999909e-308 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 74.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6492.4
Applied rewrites92.4%
if -9.99999999999999909e-308 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 4.3%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f644.3
Applied rewrites4.3%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/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--.f6494.7
Applied rewrites94.7%
Final simplification92.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- y x) (/ z (- a t)))) (t_2 (* (- y) (/ (- z t) t))))
(if (<= t -1.55e+121)
t_2
(if (<= t -1500000.0)
t_1
(if (<= t 8.5e-180)
(fma (/ z a) (- y x) x)
(if (<= t 5.5e+104) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - x) * (z / (a - t));
double t_2 = -y * ((z - t) / t);
double tmp;
if (t <= -1.55e+121) {
tmp = t_2;
} else if (t <= -1500000.0) {
tmp = t_1;
} else if (t <= 8.5e-180) {
tmp = fma((z / a), (y - x), x);
} else if (t <= 5.5e+104) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y - x) * Float64(z / Float64(a - t))) t_2 = Float64(Float64(-y) * Float64(Float64(z - t) / t)) tmp = 0.0 if (t <= -1.55e+121) tmp = t_2; elseif (t <= -1500000.0) tmp = t_1; elseif (t <= 8.5e-180) tmp = fma(Float64(z / a), Float64(y - x), x); elseif (t <= 5.5e+104) 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] * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-y) * N[(N[(z - t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.55e+121], t$95$2, If[LessEqual[t, -1500000.0], t$95$1, If[LessEqual[t, 8.5e-180], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t, 5.5e+104], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - x\right) \cdot \frac{z}{a - t}\\
t_2 := \left(-y\right) \cdot \frac{z - t}{t}\\
\mathbf{if}\;t \leq -1.55 \cdot 10^{+121}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1500000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-180}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -1.55000000000000004e121 or 5.50000000000000017e104 < t Initial program 33.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6467.9
Applied rewrites67.9%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.8
Applied rewrites38.8%
Taylor expanded in a around 0
Applied rewrites65.4%
if -1.55000000000000004e121 < t < -1.5e6 or 8.4999999999999993e-180 < t < 5.50000000000000017e104Initial program 81.0%
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.2
Applied rewrites62.2%
if -1.5e6 < t < 8.4999999999999993e-180Initial program 93.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6498.8
Applied rewrites98.8%
Taylor expanded in t around 0
lower-/.f6482.1
Applied rewrites82.1%
Final simplification70.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.55e+121)
(* (- y) (/ (- z t) t))
(if (<= t -1500000.0)
(* (- y x) (/ z (- a t)))
(if (<= t 4.8e-28) (fma (/ z a) (- y x) x) (* (- z t) (/ y (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.55e+121) {
tmp = -y * ((z - t) / t);
} else if (t <= -1500000.0) {
tmp = (y - x) * (z / (a - t));
} else if (t <= 4.8e-28) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = (z - t) * (y / (a - t));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.55e+121) tmp = Float64(Float64(-y) * Float64(Float64(z - t) / t)); elseif (t <= -1500000.0) tmp = Float64(Float64(y - x) * Float64(z / Float64(a - t))); elseif (t <= 4.8e-28) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = Float64(Float64(z - t) * Float64(y / Float64(a - t))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.55e+121], N[((-y) * N[(N[(z - t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1500000.0], N[(N[(y - x), $MachinePrecision] * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e-28], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+121}:\\
\;\;\;\;\left(-y\right) \cdot \frac{z - t}{t}\\
\mathbf{elif}\;t \leq -1500000:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-28}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -1.55000000000000004e121Initial program 38.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6470.4
Applied rewrites70.4%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6443.5
Applied rewrites43.5%
Taylor expanded in a around 0
Applied rewrites67.7%
if -1.55000000000000004e121 < t < -1.5e6Initial program 74.3%
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--.f6456.3
Applied rewrites56.3%
if -1.5e6 < t < 4.8000000000000004e-28Initial program 92.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6498.2
Applied rewrites98.2%
Taylor expanded in t around 0
lower-/.f6477.0
Applied rewrites77.0%
if 4.8000000000000004e-28 < t Initial program 48.5%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6462.3
Applied rewrites62.3%
Final simplification69.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9.5e+117) (not (<= t 2e+30))) (- y (* (/ (- y x) t) (- z a))) (+ x (/ (* (- y x) z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.5e+117) || !(t <= 2e+30)) {
tmp = y - (((y - x) / t) * (z - a));
} else {
tmp = x + (((y - x) * z) / (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 <= (-9.5d+117)) .or. (.not. (t <= 2d+30))) then
tmp = y - (((y - x) / t) * (z - a))
else
tmp = x + (((y - x) * z) / (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 <= -9.5e+117) || !(t <= 2e+30)) {
tmp = y - (((y - x) / t) * (z - a));
} else {
tmp = x + (((y - x) * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9.5e+117) or not (t <= 2e+30): tmp = y - (((y - x) / t) * (z - a)) else: tmp = x + (((y - x) * z) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9.5e+117) || !(t <= 2e+30)) tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * Float64(z - a))); else tmp = Float64(x + Float64(Float64(Float64(y - x) * z) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -9.5e+117) || ~((t <= 2e+30))) tmp = y - (((y - x) / t) * (z - a)); else tmp = x + (((y - x) * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9.5e+117], N[Not[LessEqual[t, 2e+30]], $MachinePrecision]], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{+117} \lor \neg \left(t \leq 2 \cdot 10^{+30}\right):\\
\;\;\;\;y - \frac{y - x}{t} \cdot \left(z - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{a - t}\\
\end{array}
\end{array}
if t < -9.50000000000000041e117 or 2e30 < t Initial program 41.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6471.3
Applied rewrites71.3%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/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--.f6484.4
Applied rewrites84.4%
if -9.50000000000000041e117 < t < 2e30Initial program 89.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6482.4
Applied rewrites82.4%
Final simplification83.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -0.32) (not (<= t 3.1e-24))) (- y (* (/ (- y x) t) (- z a))) (fma (/ (- z t) a) (- y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -0.32) || !(t <= 3.1e-24)) {
tmp = y - (((y - x) / t) * (z - a));
} else {
tmp = fma(((z - t) / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -0.32) || !(t <= 3.1e-24)) tmp = Float64(y - Float64(Float64(Float64(y - x) / t) * Float64(z - a))); else tmp = fma(Float64(Float64(z - t) / a), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -0.32], N[Not[LessEqual[t, 3.1e-24]], $MachinePrecision]], N[(y - N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.32 \lor \neg \left(t \leq 3.1 \cdot 10^{-24}\right):\\
\;\;\;\;y - \frac{y - x}{t} \cdot \left(z - a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y - x, x\right)\\
\end{array}
\end{array}
if t < -0.320000000000000007 or 3.1e-24 < t Initial program 49.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6475.4
Applied rewrites75.4%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/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--.f6478.6
Applied rewrites78.6%
if -0.320000000000000007 < t < 3.1e-24Initial program 92.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6498.2
Applied rewrites98.2%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6479.9
Applied rewrites79.9%
Final simplification79.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y x) x)))
(if (<= t -4.2e+118)
t_1
(if (<= t 4600.0)
(fma (/ (- y x) a) z x)
(if (<= t 6.5e+118) (* x (/ (- z a) t)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / x) * x;
double tmp;
if (t <= -4.2e+118) {
tmp = t_1;
} else if (t <= 4600.0) {
tmp = fma(((y - x) / a), z, x);
} else if (t <= 6.5e+118) {
tmp = x * ((z - a) / t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y / x) * x) tmp = 0.0 if (t <= -4.2e+118) tmp = t_1; elseif (t <= 4600.0) tmp = fma(Float64(Float64(y - x) / a), z, x); elseif (t <= 6.5e+118) tmp = Float64(x * Float64(Float64(z - a) / t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / x), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -4.2e+118], t$95$1, If[LessEqual[t, 4600.0], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[t, 6.5e+118], N[(x * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{x} \cdot x\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4600:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+118}:\\
\;\;\;\;x \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.2e118 or 6.5e118 < t Initial program 33.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites56.2%
Taylor expanded in t around inf
Applied rewrites51.6%
if -4.2e118 < t < 4600Initial program 90.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6467.6
Applied rewrites67.6%
if 4600 < t < 6.5e118Initial program 73.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6486.0
Applied rewrites86.0%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/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--.f6471.8
Applied rewrites71.8%
Taylor expanded in x around inf
Applied rewrites38.4%
Final simplification59.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y x) x)))
(if (<= t -8e+119)
t_1
(if (<= t 3000.0)
(fma (/ y a) z x)
(if (<= t 6.5e+118) (* x (/ (- z a) t)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / x) * x;
double tmp;
if (t <= -8e+119) {
tmp = t_1;
} else if (t <= 3000.0) {
tmp = fma((y / a), z, x);
} else if (t <= 6.5e+118) {
tmp = x * ((z - a) / t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(y / x) * x) tmp = 0.0 if (t <= -8e+119) tmp = t_1; elseif (t <= 3000.0) tmp = fma(Float64(y / a), z, x); elseif (t <= 6.5e+118) tmp = Float64(x * Float64(Float64(z - a) / t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / x), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -8e+119], t$95$1, If[LessEqual[t, 3000.0], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[t, 6.5e+118], N[(x * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{x} \cdot x\\
\mathbf{if}\;t \leq -8 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3000:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+118}:\\
\;\;\;\;x \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.99999999999999955e119 or 6.5e118 < t Initial program 33.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites56.8%
Taylor expanded in t around inf
Applied rewrites52.2%
if -7.99999999999999955e119 < t < 3e3Initial program 89.4%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6467.1
Applied rewrites67.1%
Taylor expanded in x around 0
Applied rewrites62.5%
if 3e3 < t < 6.5e118Initial program 73.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6486.0
Applied rewrites86.0%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/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--.f6471.8
Applied rewrites71.8%
Taylor expanded in x around inf
Applied rewrites38.4%
Final simplification56.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.2e+18) (not (<= a 5.2e+36))) (fma (/ (- z t) a) (- y x) x) (- y (/ (* (- y x) z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.2e+18) || !(a <= 5.2e+36)) {
tmp = fma(((z - t) / a), (y - x), x);
} else {
tmp = y - (((y - x) * z) / t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6.2e+18) || !(a <= 5.2e+36)) tmp = fma(Float64(Float64(z - t) / a), Float64(y - x), x); else tmp = Float64(y - Float64(Float64(Float64(y - x) * z) / t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.2e+18], N[Not[LessEqual[a, 5.2e+36]], $MachinePrecision]], N[(N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(y - N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{+18} \lor \neg \left(a \leq 5.2 \cdot 10^{+36}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;y - \frac{\left(y - x\right) \cdot z}{t}\\
\end{array}
\end{array}
if a < -6.2e18 or 5.2000000000000003e36 < a Initial program 70.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.6
Applied rewrites93.6%
Taylor expanded in a around inf
lower-/.f64N/A
lower--.f6479.0
Applied rewrites79.0%
if -6.2e18 < a < 5.2000000000000003e36Initial program 68.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6480.1
Applied rewrites80.1%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/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--.f6478.0
Applied rewrites78.0%
Taylor expanded in z around inf
Applied rewrites74.0%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.2e+18) (not (<= a 5.2e+36))) (fma (- z t) (/ (- y x) a) x) (- y (/ (* (- y x) z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.2e+18) || !(a <= 5.2e+36)) {
tmp = fma((z - t), ((y - x) / a), x);
} else {
tmp = y - (((y - x) * z) / t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6.2e+18) || !(a <= 5.2e+36)) tmp = fma(Float64(z - t), Float64(Float64(y - x) / a), x); else tmp = Float64(y - Float64(Float64(Float64(y - x) * z) / t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.2e+18], N[Not[LessEqual[a, 5.2e+36]], $MachinePrecision]], N[(N[(z - t), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(y - N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{+18} \lor \neg \left(a \leq 5.2 \cdot 10^{+36}\right):\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y - \frac{\left(y - x\right) \cdot z}{t}\\
\end{array}
\end{array}
if a < -6.2e18 or 5.2000000000000003e36 < a Initial program 70.2%
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.3
Applied rewrites76.3%
if -6.2e18 < a < 5.2000000000000003e36Initial program 68.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6480.1
Applied rewrites80.1%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/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--.f6478.0
Applied rewrites78.0%
Taylor expanded in z around inf
Applied rewrites74.0%
Final simplification75.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.8e+19) (not (<= a 5.2e+36))) (fma (/ z a) (- y x) x) (- y (/ (* (- y x) z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.8e+19) || !(a <= 5.2e+36)) {
tmp = fma((z / a), (y - x), x);
} else {
tmp = y - (((y - x) * z) / t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.8e+19) || !(a <= 5.2e+36)) tmp = fma(Float64(z / a), Float64(y - x), x); else tmp = Float64(y - Float64(Float64(Float64(y - x) * z) / t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.8e+19], N[Not[LessEqual[a, 5.2e+36]], $MachinePrecision]], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(y - N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{+19} \lor \neg \left(a \leq 5.2 \cdot 10^{+36}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;y - \frac{\left(y - x\right) \cdot z}{t}\\
\end{array}
\end{array}
if a < -4.8e19 or 5.2000000000000003e36 < a Initial program 70.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.6
Applied rewrites93.6%
Taylor expanded in t around 0
lower-/.f6470.2
Applied rewrites70.2%
if -4.8e19 < a < 5.2000000000000003e36Initial program 68.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6480.1
Applied rewrites80.1%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/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--.f6478.0
Applied rewrites78.0%
Taylor expanded in z around inf
Applied rewrites74.0%
Final simplification72.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ y x) x)))
(if (<= t -4.8e+118)
t_1
(if (<= t 4.6e-303) (* 1.0 x) (if (<= t 2.5e+29) (* y (/ z a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / x) * x;
double tmp;
if (t <= -4.8e+118) {
tmp = t_1;
} else if (t <= 4.6e-303) {
tmp = 1.0 * x;
} else if (t <= 2.5e+29) {
tmp = y * (z / a);
} 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) * x
if (t <= (-4.8d+118)) then
tmp = t_1
else if (t <= 4.6d-303) then
tmp = 1.0d0 * x
else if (t <= 2.5d+29) then
tmp = y * (z / a)
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) * x;
double tmp;
if (t <= -4.8e+118) {
tmp = t_1;
} else if (t <= 4.6e-303) {
tmp = 1.0 * x;
} else if (t <= 2.5e+29) {
tmp = y * (z / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / x) * x tmp = 0 if t <= -4.8e+118: tmp = t_1 elif t <= 4.6e-303: tmp = 1.0 * x elif t <= 2.5e+29: tmp = y * (z / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / x) * x) tmp = 0.0 if (t <= -4.8e+118) tmp = t_1; elseif (t <= 4.6e-303) tmp = Float64(1.0 * x); elseif (t <= 2.5e+29) tmp = Float64(y * Float64(z / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / x) * x; tmp = 0.0; if (t <= -4.8e+118) tmp = t_1; elseif (t <= 4.6e-303) tmp = 1.0 * x; elseif (t <= 2.5e+29) tmp = y * (z / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / x), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -4.8e+118], t$95$1, If[LessEqual[t, 4.6e-303], N[(1.0 * x), $MachinePrecision], If[LessEqual[t, 2.5e+29], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{x} \cdot x\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-303}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+29}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.8e118 or 2.5e29 < t Initial program 41.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.1%
Taylor expanded in t around inf
Applied rewrites45.1%
if -4.8e118 < t < 4.59999999999999991e-303Initial program 91.7%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.6
Applied rewrites66.6%
Taylor expanded in x around inf
Applied rewrites56.7%
Taylor expanded in z around 0
Applied rewrites45.3%
if 4.59999999999999991e-303 < t < 2.5e29Initial program 87.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6465.3
Applied rewrites65.3%
Taylor expanded in x around inf
Applied rewrites39.2%
Taylor expanded in z around 0
Applied rewrites25.1%
Taylor expanded in x around 0
Applied rewrites42.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma 1.0 (- y x) x)))
(if (<= t -6.5e+118)
t_1
(if (<= t 4.6e-303) (* 1.0 x) (if (<= t 4.1e+29) (* y (/ z a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(1.0, (y - x), x);
double tmp;
if (t <= -6.5e+118) {
tmp = t_1;
} else if (t <= 4.6e-303) {
tmp = 1.0 * x;
} else if (t <= 4.1e+29) {
tmp = y * (z / a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(1.0, Float64(y - x), x) tmp = 0.0 if (t <= -6.5e+118) tmp = t_1; elseif (t <= 4.6e-303) tmp = Float64(1.0 * x); elseif (t <= 4.1e+29) tmp = Float64(y * Float64(z / a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t, -6.5e+118], t$95$1, If[LessEqual[t, 4.6e-303], N[(1.0 * x), $MachinePrecision], If[LessEqual[t, 4.1e+29], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-303}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{+29}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.5e118 or 4.1000000000000003e29 < t Initial program 41.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6471.3
Applied rewrites71.3%
Taylor expanded in t around inf
Applied rewrites38.0%
if -6.5e118 < t < 4.59999999999999991e-303Initial program 91.7%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.6
Applied rewrites66.6%
Taylor expanded in x around inf
Applied rewrites56.7%
Taylor expanded in z around 0
Applied rewrites45.3%
if 4.59999999999999991e-303 < t < 4.1000000000000003e29Initial program 87.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6465.3
Applied rewrites65.3%
Taylor expanded in x around inf
Applied rewrites39.2%
Taylor expanded in z around 0
Applied rewrites25.1%
Taylor expanded in x around 0
Applied rewrites42.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3e+118) (not (<= t 1.2e-23))) (* (- y) (/ (- z t) t)) (fma (/ z a) (- y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3e+118) || !(t <= 1.2e-23)) {
tmp = -y * ((z - t) / t);
} else {
tmp = fma((z / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3e+118) || !(t <= 1.2e-23)) tmp = Float64(Float64(-y) * Float64(Float64(z - t) / t)); else tmp = fma(Float64(z / a), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3e+118], N[Not[LessEqual[t, 1.2e-23]], $MachinePrecision]], N[((-y) * N[(N[(z - t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{+118} \lor \neg \left(t \leq 1.2 \cdot 10^{-23}\right):\\
\;\;\;\;\left(-y\right) \cdot \frac{z - t}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\end{array}
\end{array}
if t < -3e118 or 1.19999999999999998e-23 < t Initial program 44.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6473.8
Applied rewrites73.8%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6442.4
Applied rewrites42.4%
Taylor expanded in a around 0
Applied rewrites60.6%
if -3e118 < t < 1.19999999999999998e-23Initial program 90.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6496.3
Applied rewrites96.3%
Taylor expanded in t around 0
lower-/.f6471.4
Applied rewrites71.4%
Final simplification66.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.5e+118) (not (<= t 2.05e+30))) (fma a (/ (- y x) t) y) (fma (/ z a) (- y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.5e+118) || !(t <= 2.05e+30)) {
tmp = fma(a, ((y - x) / t), y);
} else {
tmp = fma((z / a), (y - x), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.5e+118) || !(t <= 2.05e+30)) tmp = fma(a, Float64(Float64(y - x) / t), y); else tmp = fma(Float64(z / a), Float64(y - x), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.5e+118], N[Not[LessEqual[t, 2.05e+30]], $MachinePrecision]], N[(a * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+118} \lor \neg \left(t \leq 2.05 \cdot 10^{+30}\right):\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y - x}{t}, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y - x, x\right)\\
\end{array}
\end{array}
if t < -6.5e118 or 2.05000000000000003e30 < t Initial program 41.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6471.3
Applied rewrites71.3%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/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--.f6484.4
Applied rewrites84.4%
Taylor expanded in z around 0
Applied rewrites58.3%
if -6.5e118 < t < 2.05000000000000003e30Initial program 89.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6496.6
Applied rewrites96.6%
Taylor expanded in t around 0
lower-/.f6469.4
Applied rewrites69.4%
Final simplification64.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3e+118) (not (<= t 2.05e+30))) (fma a (/ (- y x) t) y) (fma (/ (- y x) a) z x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3e+118) || !(t <= 2.05e+30)) {
tmp = fma(a, ((y - x) / t), y);
} else {
tmp = fma(((y - x) / a), z, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3e+118) || !(t <= 2.05e+30)) tmp = fma(a, Float64(Float64(y - x) / t), y); else tmp = fma(Float64(Float64(y - x) / a), z, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3e+118], N[Not[LessEqual[t, 2.05e+30]], $MachinePrecision]], N[(a * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], N[(N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{+118} \lor \neg \left(t \leq 2.05 \cdot 10^{+30}\right):\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y - x}{t}, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{a}, z, x\right)\\
\end{array}
\end{array}
if t < -3e118 or 2.05000000000000003e30 < t Initial program 41.2%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6471.3
Applied rewrites71.3%
Taylor expanded in t around inf
fp-cancel-sub-sign-invN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
metadata-evalN/A
*-lft-identityN/A
associate-+l-N/A
div-subN/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--.f6484.4
Applied rewrites84.4%
Taylor expanded in z around 0
Applied rewrites58.3%
if -3e118 < t < 2.05000000000000003e30Initial program 89.7%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6466.0
Applied rewrites66.0%
Final simplification62.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8e+119) (not (<= t 2.2e+30))) (* (/ y x) x) (fma (/ y a) z x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8e+119) || !(t <= 2.2e+30)) {
tmp = (y / x) * x;
} else {
tmp = fma((y / a), z, x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8e+119) || !(t <= 2.2e+30)) tmp = Float64(Float64(y / x) * x); else tmp = fma(Float64(y / a), z, x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8e+119], N[Not[LessEqual[t, 2.2e+30]], $MachinePrecision]], N[(N[(y / x), $MachinePrecision] * x), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+119} \lor \neg \left(t \leq 2.2 \cdot 10^{+30}\right):\\
\;\;\;\;\frac{y}{x} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
\end{array}
\end{array}
if t < -7.99999999999999955e119 or 2.2e30 < t Initial program 41.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.6%
Taylor expanded in t around inf
Applied rewrites45.4%
if -7.99999999999999955e119 < t < 2.2e30Initial program 89.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6465.6
Applied rewrites65.6%
Taylor expanded in x around 0
Applied rewrites61.2%
Final simplification54.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.5e+118) (not (<= t 7.5e-12))) (fma 1.0 (- y x) x) (* 1.0 x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.5e+118) || !(t <= 7.5e-12)) {
tmp = fma(1.0, (y - x), x);
} else {
tmp = 1.0 * x;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.5e+118) || !(t <= 7.5e-12)) tmp = fma(1.0, Float64(y - x), x); else tmp = Float64(1.0 * x); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.5e+118], N[Not[LessEqual[t, 7.5e-12]], $MachinePrecision]], N[(1.0 * N[(y - x), $MachinePrecision] + x), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+118} \lor \neg \left(t \leq 7.5 \cdot 10^{-12}\right):\\
\;\;\;\;\mathsf{fma}\left(1, y - x, x\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if t < -6.5e118 or 7.5e-12 < t Initial program 43.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6473.3
Applied rewrites73.3%
Taylor expanded in t around inf
Applied rewrites36.5%
if -6.5e118 < t < 7.5e-12Initial program 90.6%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6468.2
Applied rewrites68.2%
Taylor expanded in x around inf
Applied rewrites50.3%
Taylor expanded in z around 0
Applied rewrites37.7%
Final simplification37.2%
(FPCore (x y z t a) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t, double a) {
return 1.0 * 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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t, double a) {
return 1.0 * x;
}
def code(x, y, z, t, a): return 1.0 * x
function code(x, y, z, t, a) return Float64(1.0 * x) end
function tmp = code(x, y, z, t, a) tmp = 1.0 * x; end
code[x_, y_, z_, t_, a_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 69.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6443.4
Applied rewrites43.4%
Taylor expanded in x around inf
Applied rewrites33.3%
Taylor expanded in z around 0
Applied rewrites25.3%
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
return 0.0;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return 0.0;
}
def code(x, y, z, t, a): return 0.0
function code(x, y, z, t, a) return 0.0 end
function tmp = code(x, y, z, t, a) tmp = 0.0; end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 69.0%
Taylor expanded in x around inf
+-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
*-lft-identityN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6440.6
Applied rewrites40.6%
Taylor expanded in t around inf
Applied rewrites2.9%
(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 2024337
(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))))