
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (/ y (/ (- a z) (- t z))) x))
double code(double x, double y, double z, double t, double a) {
return (y / ((a - z) / (t - z))) + x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (y / ((a - z) / (t - z))) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (y / ((a - z) / (t - z))) + x;
}
def code(x, y, z, t, a): return (y / ((a - z) / (t - z))) + x
function code(x, y, z, t, a) return Float64(Float64(y / Float64(Float64(a - z) / Float64(t - z))) + x) end
function tmp = code(x, y, z, t, a) tmp = (y / ((a - z) / (t - z))) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(y / N[(N[(a - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{\frac{a - z}{t - z}} + x
\end{array}
Initial program 98.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.0
Applied rewrites99.0%
Final simplification99.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -1e+161)
(/ (* t y) (- a z))
(if (<= t_1 2e-46)
(+ (* (/ (- t z) a) y) x)
(if (<= t_1 500000.0)
(fma (/ z (- z a)) y x)
(* (/ y (- z a)) (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+161) {
tmp = (t * y) / (a - z);
} else if (t_1 <= 2e-46) {
tmp = (((t - z) / a) * y) + x;
} else if (t_1 <= 500000.0) {
tmp = fma((z / (z - a)), y, x);
} else {
tmp = (y / (z - a)) * (z - t);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -1e+161) tmp = Float64(Float64(t * y) / Float64(a - z)); elseif (t_1 <= 2e-46) tmp = Float64(Float64(Float64(Float64(t - z) / a) * y) + x); elseif (t_1 <= 500000.0) tmp = fma(Float64(z / Float64(z - a)), y, x); else tmp = Float64(Float64(y / Float64(z - a)) * Float64(z - t)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+161], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-46], N[(N[(N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 500000.0], N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+161}:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-46}:\\
\;\;\;\;\frac{t - z}{a} \cdot y + x\\
\mathbf{elif}\;t\_1 \leq 500000:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{z - a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z - a} \cdot \left(z - t\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -1e161Initial program 95.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6498.3
Applied rewrites98.3%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6489.0
Applied rewrites89.0%
Applied rewrites90.9%
if -1e161 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2.00000000000000005e-46Initial program 99.9%
Taylor expanded in a around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f6493.5
Applied rewrites93.5%
if 2.00000000000000005e-46 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5e5Initial program 100.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64100.0
Applied rewrites100.0%
if 5e5 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 94.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--.f6481.7
Applied rewrites81.7%
Final simplification93.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -1e+161)
(/ (* t y) (- a z))
(if (<= t_1 2e-46)
(fma (- t z) (/ y a) x)
(if (<= t_1 500000.0)
(fma (/ z (- z a)) y x)
(* (/ y (- z a)) (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+161) {
tmp = (t * y) / (a - z);
} else if (t_1 <= 2e-46) {
tmp = fma((t - z), (y / a), x);
} else if (t_1 <= 500000.0) {
tmp = fma((z / (z - a)), y, x);
} else {
tmp = (y / (z - a)) * (z - t);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -1e+161) tmp = Float64(Float64(t * y) / Float64(a - z)); elseif (t_1 <= 2e-46) tmp = fma(Float64(t - z), Float64(y / a), x); elseif (t_1 <= 500000.0) tmp = fma(Float64(z / Float64(z - a)), y, x); else tmp = Float64(Float64(y / Float64(z - a)) * Float64(z - t)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+161], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-46], N[(N[(t - z), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 500000.0], N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+161}:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-46}:\\
\;\;\;\;\mathsf{fma}\left(t - z, \frac{y}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 500000:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{z - a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z - a} \cdot \left(z - t\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -1e161Initial program 95.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6498.3
Applied rewrites98.3%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6489.0
Applied rewrites89.0%
Applied rewrites90.9%
if -1e161 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2.00000000000000005e-46Initial program 99.9%
Taylor expanded in a around inf
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f6490.0
Applied rewrites90.0%
if 2.00000000000000005e-46 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5e5Initial program 100.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64100.0
Applied rewrites100.0%
if 5e5 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 94.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--.f6481.7
Applied rewrites81.7%
Final simplification92.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -1e+161)
(/ (* t y) (- a z))
(if (<= t_1 2e-46)
(fma (- t z) (/ y a) x)
(if (<= t_1 500000.0) (fma (/ z (- z a)) y x) (* (/ y (- a z)) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+161) {
tmp = (t * y) / (a - z);
} else if (t_1 <= 2e-46) {
tmp = fma((t - z), (y / a), x);
} else if (t_1 <= 500000.0) {
tmp = fma((z / (z - a)), y, x);
} else {
tmp = (y / (a - z)) * t;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -1e+161) tmp = Float64(Float64(t * y) / Float64(a - z)); elseif (t_1 <= 2e-46) tmp = fma(Float64(t - z), Float64(y / a), x); elseif (t_1 <= 500000.0) tmp = fma(Float64(z / Float64(z - a)), y, x); else tmp = Float64(Float64(y / Float64(a - z)) * t); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+161], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-46], N[(N[(t - z), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 500000.0], N[(N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+161}:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-46}:\\
\;\;\;\;\mathsf{fma}\left(t - z, \frac{y}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 500000:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{z - a}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - z} \cdot t\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -1e161Initial program 95.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6498.3
Applied rewrites98.3%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6489.0
Applied rewrites89.0%
Applied rewrites90.9%
if -1e161 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2.00000000000000005e-46Initial program 99.9%
Taylor expanded in a around inf
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f6490.0
Applied rewrites90.0%
if 2.00000000000000005e-46 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5e5Initial program 100.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64100.0
Applied rewrites100.0%
if 5e5 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 94.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6494.9
Applied rewrites94.9%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6481.4
Applied rewrites81.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -1e+161)
(/ (* t y) (- a z))
(if (<= t_1 1e-7)
(fma (- t z) (/ y a) x)
(if (<= t_1 500000.0) (+ y x) (* (/ y (- a z)) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+161) {
tmp = (t * y) / (a - z);
} else if (t_1 <= 1e-7) {
tmp = fma((t - z), (y / a), x);
} else if (t_1 <= 500000.0) {
tmp = y + x;
} else {
tmp = (y / (a - z)) * t;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -1e+161) tmp = Float64(Float64(t * y) / Float64(a - z)); elseif (t_1 <= 1e-7) tmp = fma(Float64(t - z), Float64(y / a), x); elseif (t_1 <= 500000.0) tmp = Float64(y + x); else tmp = Float64(Float64(y / Float64(a - z)) * t); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+161], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-7], N[(N[(t - z), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 500000.0], N[(y + x), $MachinePrecision], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+161}:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\mathbf{elif}\;t\_1 \leq 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(t - z, \frac{y}{a}, x\right)\\
\mathbf{elif}\;t\_1 \leq 500000:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - z} \cdot t\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -1e161Initial program 95.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6498.3
Applied rewrites98.3%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6489.0
Applied rewrites89.0%
Applied rewrites90.9%
if -1e161 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999995e-8Initial program 99.9%
Taylor expanded in a around inf
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f6490.6
Applied rewrites90.6%
if 9.9999999999999995e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5e5Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6499.1
Applied rewrites99.1%
if 5e5 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 94.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6494.9
Applied rewrites94.9%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6481.4
Applied rewrites81.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -1e+161)
(/ (* t y) (- a z))
(if (<= t_1 1e-7)
(+ (* (/ t a) y) x)
(if (<= t_1 500000.0) (+ y x) (* (/ y (- a z)) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+161) {
tmp = (t * y) / (a - z);
} else if (t_1 <= 1e-7) {
tmp = ((t / a) * y) + x;
} else if (t_1 <= 500000.0) {
tmp = y + x;
} else {
tmp = (y / (a - z)) * 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) :: t_1
real(8) :: tmp
t_1 = (z - t) / (z - a)
if (t_1 <= (-1d+161)) then
tmp = (t * y) / (a - z)
else if (t_1 <= 1d-7) then
tmp = ((t / a) * y) + x
else if (t_1 <= 500000.0d0) then
tmp = y + x
else
tmp = (y / (a - z)) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+161) {
tmp = (t * y) / (a - z);
} else if (t_1 <= 1e-7) {
tmp = ((t / a) * y) + x;
} else if (t_1 <= 500000.0) {
tmp = y + x;
} else {
tmp = (y / (a - z)) * t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= -1e+161: tmp = (t * y) / (a - z) elif t_1 <= 1e-7: tmp = ((t / a) * y) + x elif t_1 <= 500000.0: tmp = y + x else: tmp = (y / (a - z)) * t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -1e+161) tmp = Float64(Float64(t * y) / Float64(a - z)); elseif (t_1 <= 1e-7) tmp = Float64(Float64(Float64(t / a) * y) + x); elseif (t_1 <= 500000.0) tmp = Float64(y + x); else tmp = Float64(Float64(y / Float64(a - z)) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= -1e+161) tmp = (t * y) / (a - z); elseif (t_1 <= 1e-7) tmp = ((t / a) * y) + x; elseif (t_1 <= 500000.0) tmp = y + x; else tmp = (y / (a - z)) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+161], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-7], N[(N[(N[(t / a), $MachinePrecision] * y), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 500000.0], N[(y + x), $MachinePrecision], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+161}:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\mathbf{elif}\;t\_1 \leq 10^{-7}:\\
\;\;\;\;\frac{t}{a} \cdot y + x\\
\mathbf{elif}\;t\_1 \leq 500000:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - z} \cdot t\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -1e161Initial program 95.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6498.3
Applied rewrites98.3%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6489.0
Applied rewrites89.0%
Applied rewrites90.9%
if -1e161 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999995e-8Initial program 99.9%
Taylor expanded in z around 0
lower-/.f6486.1
Applied rewrites86.1%
if 9.9999999999999995e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5e5Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6499.1
Applied rewrites99.1%
if 5e5 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 94.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6494.9
Applied rewrites94.9%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6481.4
Applied rewrites81.4%
Final simplification90.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (* (/ y (- a z)) t)))
(if (<= t_1 -2e+156)
t_2
(if (<= t_1 1e-7)
(+ (/ (* t y) a) x)
(if (<= t_1 500000.0) (+ y x) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y / (a - z)) * t;
double tmp;
if (t_1 <= -2e+156) {
tmp = t_2;
} else if (t_1 <= 1e-7) {
tmp = ((t * y) / a) + x;
} else if (t_1 <= 500000.0) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z - t) / (z - a)
t_2 = (y / (a - z)) * t
if (t_1 <= (-2d+156)) then
tmp = t_2
else if (t_1 <= 1d-7) then
tmp = ((t * y) / a) + x
else if (t_1 <= 500000.0d0) then
tmp = y + x
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y / (a - z)) * t;
double tmp;
if (t_1 <= -2e+156) {
tmp = t_2;
} else if (t_1 <= 1e-7) {
tmp = ((t * y) / a) + x;
} else if (t_1 <= 500000.0) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = (y / (a - z)) * t tmp = 0 if t_1 <= -2e+156: tmp = t_2 elif t_1 <= 1e-7: tmp = ((t * y) / a) + x elif t_1 <= 500000.0: tmp = y + x else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(Float64(y / Float64(a - z)) * t) tmp = 0.0 if (t_1 <= -2e+156) tmp = t_2; elseif (t_1 <= 1e-7) tmp = Float64(Float64(Float64(t * y) / a) + x); elseif (t_1 <= 500000.0) tmp = Float64(y + x); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = (y / (a - z)) * t; tmp = 0.0; if (t_1 <= -2e+156) tmp = t_2; elseif (t_1 <= 1e-7) tmp = ((t * y) / a) + x; elseif (t_1 <= 500000.0) tmp = y + x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+156], t$95$2, If[LessEqual[t$95$1, 1e-7], N[(N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 500000.0], N[(y + x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \frac{y}{a - z} \cdot t\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+156}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{-7}:\\
\;\;\;\;\frac{t \cdot y}{a} + x\\
\mathbf{elif}\;t\_1 \leq 500000:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -2e156 or 5e5 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 95.2%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6496.3
Applied rewrites96.3%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6484.6
Applied rewrites84.6%
if -2e156 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999995e-8Initial program 99.9%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6484.2
Applied rewrites84.2%
if 9.9999999999999995e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5e5Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6499.1
Applied rewrites99.1%
Final simplification89.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -1e+161)
(/ (* t y) (- a z))
(if (<= t_1 1e-7)
(fma (/ y a) t x)
(if (<= t_1 500000.0) (+ y x) (* (/ y (- a z)) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+161) {
tmp = (t * y) / (a - z);
} else if (t_1 <= 1e-7) {
tmp = fma((y / a), t, x);
} else if (t_1 <= 500000.0) {
tmp = y + x;
} else {
tmp = (y / (a - z)) * t;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -1e+161) tmp = Float64(Float64(t * y) / Float64(a - z)); elseif (t_1 <= 1e-7) tmp = fma(Float64(y / a), t, x); elseif (t_1 <= 500000.0) tmp = Float64(y + x); else tmp = Float64(Float64(y / Float64(a - z)) * t); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+161], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-7], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], If[LessEqual[t$95$1, 500000.0], N[(y + x), $MachinePrecision], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+161}:\\
\;\;\;\;\frac{t \cdot y}{a - z}\\
\mathbf{elif}\;t\_1 \leq 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\mathbf{elif}\;t\_1 \leq 500000:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - z} \cdot t\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -1e161Initial program 95.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6498.3
Applied rewrites98.3%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6489.0
Applied rewrites89.0%
Applied rewrites90.9%
if -1e161 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999995e-8Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6483.6
Applied rewrites83.6%
if 9.9999999999999995e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5e5Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6499.1
Applied rewrites99.1%
if 5e5 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 94.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6494.9
Applied rewrites94.9%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6481.4
Applied rewrites81.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 1e-7)
(fma (/ y a) t x)
(if (<= t_1 500000.0) (+ y x) (* (/ y (- a z)) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 1e-7) {
tmp = fma((y / a), t, x);
} else if (t_1 <= 500000.0) {
tmp = y + x;
} else {
tmp = (y / (a - z)) * t;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= 1e-7) tmp = fma(Float64(y / a), t, x); elseif (t_1 <= 500000.0) tmp = Float64(y + x); else tmp = Float64(Float64(y / Float64(a - z)) * t); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-7], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], If[LessEqual[t$95$1, 500000.0], N[(y + x), $MachinePrecision], N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\mathbf{elif}\;t\_1 \leq 500000:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a - z} \cdot t\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999995e-8Initial program 99.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6481.8
Applied rewrites81.8%
if 9.9999999999999995e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5e5Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6499.1
Applied rewrites99.1%
if 5e5 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 94.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6494.9
Applied rewrites94.9%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6481.4
Applied rewrites81.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 1e-7)
(fma (/ y a) t x)
(if (<= t_1 500000.0) (+ y x) (* (/ t (- a z)) y)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 1e-7) {
tmp = fma((y / a), t, x);
} else if (t_1 <= 500000.0) {
tmp = y + x;
} else {
tmp = (t / (a - z)) * y;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= 1e-7) tmp = fma(Float64(y / a), t, x); elseif (t_1 <= 500000.0) tmp = Float64(y + x); else tmp = Float64(Float64(t / Float64(a - z)) * y); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-7], N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision], If[LessEqual[t$95$1, 500000.0], N[(y + x), $MachinePrecision], N[(N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\mathbf{elif}\;t\_1 \leq 500000:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{a - z} \cdot y\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999995e-8Initial program 99.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6481.8
Applied rewrites81.8%
if 9.9999999999999995e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5e5Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6499.1
Applied rewrites99.1%
if 5e5 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 94.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6494.9
Applied rewrites94.9%
Taylor expanded in t around inf
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6481.4
Applied rewrites81.4%
Applied rewrites79.0%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- z t) (- z a))) (t_2 (fma (/ y a) t x))) (if (<= t_1 1e-7) t_2 (if (<= t_1 1e+15) (+ y x) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = fma((y / a), t, x);
double tmp;
if (t_1 <= 1e-7) {
tmp = t_2;
} else if (t_1 <= 1e+15) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = fma(Float64(y / a), t, x) tmp = 0.0 if (t_1 <= 1e-7) tmp = t_2; elseif (t_1 <= 1e+15) tmp = Float64(y + x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] * t + x), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-7], t$95$2, If[LessEqual[t$95$1, 1e+15], N[(y + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \mathsf{fma}\left(\frac{y}{a}, t, x\right)\\
\mathbf{if}\;t\_1 \leq 10^{-7}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+15}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999995e-8 or 1e15 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 98.2%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6477.5
Applied rewrites77.5%
if 9.9999999999999995e-8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e15Initial program 100.0%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6496.9
Applied rewrites96.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- z t) (- z a))) (t_2 (* (/ y a) t))) (if (<= t_1 -2e+140) t_2 (if (<= t_1 2e+27) (+ y x) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y / a) * t;
double tmp;
if (t_1 <= -2e+140) {
tmp = t_2;
} else if (t_1 <= 2e+27) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z - t) / (z - a)
t_2 = (y / a) * t
if (t_1 <= (-2d+140)) then
tmp = t_2
else if (t_1 <= 2d+27) then
tmp = y + x
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = (y / a) * t;
double tmp;
if (t_1 <= -2e+140) {
tmp = t_2;
} else if (t_1 <= 2e+27) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = (y / a) * t tmp = 0 if t_1 <= -2e+140: tmp = t_2 elif t_1 <= 2e+27: tmp = y + x else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(Float64(y / a) * t) tmp = 0.0 if (t_1 <= -2e+140) tmp = t_2; elseif (t_1 <= 2e+27) tmp = Float64(y + x); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = (y / a) * t; tmp = 0.0; if (t_1 <= -2e+140) tmp = t_2; elseif (t_1 <= 2e+27) tmp = y + x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+140], t$95$2, If[LessEqual[t$95$1, 2e+27], N[(y + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \frac{y}{a} \cdot t\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+140}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+27}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -2.00000000000000012e140 or 2e27 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 95.2%
Taylor expanded in a around inf
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
lower--.f64N/A
lower-/.f6467.2
Applied rewrites67.2%
Taylor expanded in t around inf
Applied rewrites57.3%
if -2.00000000000000012e140 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2e27Initial program 99.9%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6470.4
Applied rewrites70.4%
(FPCore (x y z t a) :precision binary64 (fma (/ (- t z) (- a z)) y x))
double code(double x, double y, double z, double t, double a) {
return fma(((t - z) / (a - z)), y, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(t - z) / Float64(a - z)), y, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{t - z}{a - z}, y, x\right)
\end{array}
Initial program 98.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6498.8
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6498.8
Applied rewrites98.8%
(FPCore (x y z t a) :precision binary64 (+ y x))
double code(double x, double y, double z, double t, double a) {
return y + x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = y + x
end function
public static double code(double x, double y, double z, double t, double a) {
return y + x;
}
def code(x, y, z, t, a): return y + x
function code(x, y, z, t, a) return Float64(y + x) end
function tmp = code(x, y, z, t, a) tmp = y + x; end
code[x_, y_, z_, t_, a_] := N[(y + x), $MachinePrecision]
\begin{array}{l}
\\
y + x
\end{array}
Initial program 98.8%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6457.3
Applied rewrites57.3%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024248
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (* y (/ (- z t) (- z a)))))