
(FPCore (x y z t) :precision binary64 :pre TRUE (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = ((x - y) / (z - y)) * t END code
\frac{x - y}{z - y} \cdot t
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 :pre TRUE (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = ((x - y) / (z - y)) * t END code
\frac{x - y}{z - y} \cdot t
(FPCore (x y z t) :precision binary64 :pre TRUE (/ t (/ (- y z) (- y x))))
double code(double x, double y, double z, double t) {
return t / ((y - z) / (y - x));
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t / ((y - z) / (y - x))
end function
public static double code(double x, double y, double z, double t) {
return t / ((y - z) / (y - x));
}
def code(x, y, z, t): return t / ((y - z) / (y - x))
function code(x, y, z, t) return Float64(t / Float64(Float64(y - z) / Float64(y - x))) end
function tmp = code(x, y, z, t) tmp = t / ((y - z) / (y - x)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(y - z), $MachinePrecision] / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = t / ((y - z) / (y - x)) END code
\frac{t}{\frac{y - z}{y - x}}
Initial program 97.3%
Applied rewrites83.8%
Applied rewrites97.3%
(FPCore (x y z t) :precision binary64 :pre TRUE (* (copysign 1.0 t) (if (<= (fabs t) 6.006193981458982e-11) (/ (* (fabs t) (- x y)) (- z y)) (* (- x y) (/ (fabs t) (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (fabs(t) <= 6.006193981458982e-11) {
tmp = (fabs(t) * (x - y)) / (z - y);
} else {
tmp = (x - y) * (fabs(t) / (z - y));
}
return copysign(1.0, t) * tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (Math.abs(t) <= 6.006193981458982e-11) {
tmp = (Math.abs(t) * (x - y)) / (z - y);
} else {
tmp = (x - y) * (Math.abs(t) / (z - y));
}
return Math.copySign(1.0, t) * tmp;
}
def code(x, y, z, t): tmp = 0 if math.fabs(t) <= 6.006193981458982e-11: tmp = (math.fabs(t) * (x - y)) / (z - y) else: tmp = (x - y) * (math.fabs(t) / (z - y)) return math.copysign(1.0, t) * tmp
function code(x, y, z, t) tmp = 0.0 if (abs(t) <= 6.006193981458982e-11) tmp = Float64(Float64(abs(t) * Float64(x - y)) / Float64(z - y)); else tmp = Float64(Float64(x - y) * Float64(abs(t) / Float64(z - y))); end return Float64(copysign(1.0, t) * tmp) end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (abs(t) <= 6.006193981458982e-11) tmp = (abs(t) * (x - y)) / (z - y); else tmp = (x - y) * (abs(t) / (z - y)); end tmp_2 = (sign(t) * abs(1.0)) * tmp; end
code[x_, y_, z_, t_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[t], $MachinePrecision], 6.006193981458982e-11], N[(N[(N[Abs[t], $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(N[Abs[t], $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|t\right| \leq 6.006193981458982 \cdot 10^{-11}:\\
\;\;\;\;\frac{\left|t\right| \cdot \left(x - y\right)}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{\left|t\right|}{z - y}\\
\end{array}
if t < 6.0061939814589824e-11Initial program 97.3%
Taylor expanded in t around 0
Applied rewrites83.9%
if 6.0061939814589824e-11 < t Initial program 97.3%
Applied rewrites85.0%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (/ (- x y) (- z y))))
(if (<= t_1 -200000.0)
(* x (/ t (- z y)))
(if (<= t_1 0.2)
(* (/ (- x y) z) t)
(if (<= t_1 5.0) (* (/ (- y x) y) t) (* (/ x (- z y)) t))))))double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= -200000.0) {
tmp = x * (t / (z - y));
} else if (t_1 <= 0.2) {
tmp = ((x - y) / z) * t;
} else if (t_1 <= 5.0) {
tmp = ((y - x) / y) * t;
} else {
tmp = (x / (z - y)) * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x - y) / (z - y)
if (t_1 <= (-200000.0d0)) then
tmp = x * (t / (z - y))
else if (t_1 <= 0.2d0) then
tmp = ((x - y) / z) * t
else if (t_1 <= 5.0d0) then
tmp = ((y - x) / y) * t
else
tmp = (x / (z - y)) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= -200000.0) {
tmp = x * (t / (z - y));
} else if (t_1 <= 0.2) {
tmp = ((x - y) / z) * t;
} else if (t_1 <= 5.0) {
tmp = ((y - x) / y) * t;
} else {
tmp = (x / (z - y)) * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - y) / (z - y) tmp = 0 if t_1 <= -200000.0: tmp = x * (t / (z - y)) elif t_1 <= 0.2: tmp = ((x - y) / z) * t elif t_1 <= 5.0: tmp = ((y - x) / y) * t else: tmp = (x / (z - y)) * t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - y) / Float64(z - y)) tmp = 0.0 if (t_1 <= -200000.0) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (t_1 <= 0.2) tmp = Float64(Float64(Float64(x - y) / z) * t); elseif (t_1 <= 5.0) tmp = Float64(Float64(Float64(y - x) / y) * t); else tmp = Float64(Float64(x / Float64(z - y)) * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - y) / (z - y); tmp = 0.0; if (t_1 <= -200000.0) tmp = x * (t / (z - y)); elseif (t_1 <= 0.2) tmp = ((x - y) / z) * t; elseif (t_1 <= 5.0) tmp = ((y - x) / y) * t; else tmp = (x / (z - y)) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -200000.0], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.2], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$1, 5.0], N[(N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision] * t), $MachinePrecision], N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x - y) / (z - y)) IN LET tmp_2 = IF (t_1 <= (5)) THEN (((y - x) / y) * t) ELSE ((x / (z - y)) * t) ENDIF IN LET tmp_1 = IF (t_1 <= (200000000000000011102230246251565404236316680908203125e-54)) THEN (((x - y) / z) * t) ELSE tmp_2 ENDIF IN LET tmp = IF (t_1 <= (-2e5)) THEN (x * (t / (z - y))) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x - y}{z - y}\\
\mathbf{if}\;t\_1 \leq -200000:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;t\_1 \leq 0.2:\\
\;\;\;\;\frac{x - y}{z} \cdot t\\
\mathbf{elif}\;t\_1 \leq 5:\\
\;\;\;\;\frac{y - x}{y} \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z - y} \cdot t\\
\end{array}
if (/.f64 (-.f64 x y) (-.f64 z y)) < -2e5Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites50.7%
Applied rewrites50.5%
if -2e5 < (/.f64 (-.f64 x y) (-.f64 z y)) < 0.20000000000000001Initial program 97.3%
Taylor expanded in y around 0
Applied rewrites51.1%
if 0.20000000000000001 < (/.f64 (-.f64 x y) (-.f64 z y)) < 5Initial program 97.3%
Applied rewrites97.1%
Taylor expanded in z around 0
Applied rewrites52.1%
if 5 < (/.f64 (-.f64 x y) (-.f64 z y)) Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites53.9%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (/ (- x y) (- z y))))
(if (<= t_1 -9e-5)
(* x (/ t (- z y)))
(if (<= t_1 2e-17)
(/ (* t (- x y)) z)
(if (<= t_1 5.0) (* (/ (- y x) y) t) (* (/ x (- z y)) t))))))double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= -9e-5) {
tmp = x * (t / (z - y));
} else if (t_1 <= 2e-17) {
tmp = (t * (x - y)) / z;
} else if (t_1 <= 5.0) {
tmp = ((y - x) / y) * t;
} else {
tmp = (x / (z - y)) * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x - y) / (z - y)
if (t_1 <= (-9d-5)) then
tmp = x * (t / (z - y))
else if (t_1 <= 2d-17) then
tmp = (t * (x - y)) / z
else if (t_1 <= 5.0d0) then
tmp = ((y - x) / y) * t
else
tmp = (x / (z - y)) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= -9e-5) {
tmp = x * (t / (z - y));
} else if (t_1 <= 2e-17) {
tmp = (t * (x - y)) / z;
} else if (t_1 <= 5.0) {
tmp = ((y - x) / y) * t;
} else {
tmp = (x / (z - y)) * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - y) / (z - y) tmp = 0 if t_1 <= -9e-5: tmp = x * (t / (z - y)) elif t_1 <= 2e-17: tmp = (t * (x - y)) / z elif t_1 <= 5.0: tmp = ((y - x) / y) * t else: tmp = (x / (z - y)) * t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - y) / Float64(z - y)) tmp = 0.0 if (t_1 <= -9e-5) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (t_1 <= 2e-17) tmp = Float64(Float64(t * Float64(x - y)) / z); elseif (t_1 <= 5.0) tmp = Float64(Float64(Float64(y - x) / y) * t); else tmp = Float64(Float64(x / Float64(z - y)) * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - y) / (z - y); tmp = 0.0; if (t_1 <= -9e-5) tmp = x * (t / (z - y)); elseif (t_1 <= 2e-17) tmp = (t * (x - y)) / z; elseif (t_1 <= 5.0) tmp = ((y - x) / y) * t; else tmp = (x / (z - y)) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -9e-5], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-17], N[(N[(t * N[(x - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 5.0], N[(N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision] * t), $MachinePrecision], N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x - y) / (z - y)) IN LET tmp_2 = IF (t_1 <= (5)) THEN (((y - x) / y) * t) ELSE ((x / (z - y)) * t) ENDIF IN LET tmp_1 = IF (t_1 <= (20000000000000001430848481092438490170561123698464954523412728804032667540013790130615234375e-108)) THEN ((t * (x - y)) / z) ELSE tmp_2 ENDIF IN LET tmp = IF (t_1 <= (-90000000000000005668208957754217180990963242948055267333984375e-66)) THEN (x * (t / (z - y))) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x - y}{z - y}\\
\mathbf{if}\;t\_1 \leq -9 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-17}:\\
\;\;\;\;\frac{t \cdot \left(x - y\right)}{z}\\
\mathbf{elif}\;t\_1 \leq 5:\\
\;\;\;\;\frac{y - x}{y} \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z - y} \cdot t\\
\end{array}
if (/.f64 (-.f64 x y) (-.f64 z y)) < -9.0000000000000006e-5Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites50.7%
Applied rewrites50.5%
if -9.0000000000000006e-5 < (/.f64 (-.f64 x y) (-.f64 z y)) < 2.0000000000000001e-17Initial program 97.3%
Taylor expanded in z around inf
Applied rewrites47.9%
if 2.0000000000000001e-17 < (/.f64 (-.f64 x y) (-.f64 z y)) < 5Initial program 97.3%
Applied rewrites97.1%
Taylor expanded in z around 0
Applied rewrites52.1%
if 5 < (/.f64 (-.f64 x y) (-.f64 z y)) Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites53.9%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (/ (- x y) (- z y))))
(if (<= t_1 -9e-5)
(* x (/ t (- z y)))
(if (<= t_1 2e-17)
(/ (* t (- x y)) z)
(if (<= t_1 5.0) (* (/ (- y x) y) t) (/ (* t x) (- z y)))))))double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= -9e-5) {
tmp = x * (t / (z - y));
} else if (t_1 <= 2e-17) {
tmp = (t * (x - y)) / z;
} else if (t_1 <= 5.0) {
tmp = ((y - x) / y) * t;
} else {
tmp = (t * x) / (z - y);
}
return tmp;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x - y) / (z - y)
if (t_1 <= (-9d-5)) then
tmp = x * (t / (z - y))
else if (t_1 <= 2d-17) then
tmp = (t * (x - y)) / z
else if (t_1 <= 5.0d0) then
tmp = ((y - x) / y) * t
else
tmp = (t * x) / (z - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= -9e-5) {
tmp = x * (t / (z - y));
} else if (t_1 <= 2e-17) {
tmp = (t * (x - y)) / z;
} else if (t_1 <= 5.0) {
tmp = ((y - x) / y) * t;
} else {
tmp = (t * x) / (z - y);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - y) / (z - y) tmp = 0 if t_1 <= -9e-5: tmp = x * (t / (z - y)) elif t_1 <= 2e-17: tmp = (t * (x - y)) / z elif t_1 <= 5.0: tmp = ((y - x) / y) * t else: tmp = (t * x) / (z - y) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - y) / Float64(z - y)) tmp = 0.0 if (t_1 <= -9e-5) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (t_1 <= 2e-17) tmp = Float64(Float64(t * Float64(x - y)) / z); elseif (t_1 <= 5.0) tmp = Float64(Float64(Float64(y - x) / y) * t); else tmp = Float64(Float64(t * x) / Float64(z - y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - y) / (z - y); tmp = 0.0; if (t_1 <= -9e-5) tmp = x * (t / (z - y)); elseif (t_1 <= 2e-17) tmp = (t * (x - y)) / z; elseif (t_1 <= 5.0) tmp = ((y - x) / y) * t; else tmp = (t * x) / (z - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -9e-5], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-17], N[(N[(t * N[(x - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 5.0], N[(N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision] * t), $MachinePrecision], N[(N[(t * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x - y) / (z - y)) IN LET tmp_2 = IF (t_1 <= (5)) THEN (((y - x) / y) * t) ELSE ((t * x) / (z - y)) ENDIF IN LET tmp_1 = IF (t_1 <= (20000000000000001430848481092438490170561123698464954523412728804032667540013790130615234375e-108)) THEN ((t * (x - y)) / z) ELSE tmp_2 ENDIF IN LET tmp = IF (t_1 <= (-90000000000000005668208957754217180990963242948055267333984375e-66)) THEN (x * (t / (z - y))) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x - y}{z - y}\\
\mathbf{if}\;t\_1 \leq -9 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-17}:\\
\;\;\;\;\frac{t \cdot \left(x - y\right)}{z}\\
\mathbf{elif}\;t\_1 \leq 5:\\
\;\;\;\;\frac{y - x}{y} \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot x}{z - y}\\
\end{array}
if (/.f64 (-.f64 x y) (-.f64 z y)) < -9.0000000000000006e-5Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites50.7%
Applied rewrites50.5%
if -9.0000000000000006e-5 < (/.f64 (-.f64 x y) (-.f64 z y)) < 2.0000000000000001e-17Initial program 97.3%
Taylor expanded in z around inf
Applied rewrites47.9%
if 2.0000000000000001e-17 < (/.f64 (-.f64 x y) (-.f64 z y)) < 5Initial program 97.3%
Applied rewrites97.1%
Taylor expanded in z around 0
Applied rewrites52.1%
if 5 < (/.f64 (-.f64 x y) (-.f64 z y)) Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites50.7%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (/ (- x y) (- z y))))
(if (<= t_1 -9e-5)
(* x (/ t (- z y)))
(if (<= t_1 2e-5)
(/ (* t (- x y)) z)
(if (<= t_1 2.0) (* (/ y (- y z)) t) (/ (* t x) (- z y)))))))double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= -9e-5) {
tmp = x * (t / (z - y));
} else if (t_1 <= 2e-5) {
tmp = (t * (x - y)) / z;
} else if (t_1 <= 2.0) {
tmp = (y / (y - z)) * t;
} else {
tmp = (t * x) / (z - y);
}
return tmp;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x - y) / (z - y)
if (t_1 <= (-9d-5)) then
tmp = x * (t / (z - y))
else if (t_1 <= 2d-5) then
tmp = (t * (x - y)) / z
else if (t_1 <= 2.0d0) then
tmp = (y / (y - z)) * t
else
tmp = (t * x) / (z - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= -9e-5) {
tmp = x * (t / (z - y));
} else if (t_1 <= 2e-5) {
tmp = (t * (x - y)) / z;
} else if (t_1 <= 2.0) {
tmp = (y / (y - z)) * t;
} else {
tmp = (t * x) / (z - y);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - y) / (z - y) tmp = 0 if t_1 <= -9e-5: tmp = x * (t / (z - y)) elif t_1 <= 2e-5: tmp = (t * (x - y)) / z elif t_1 <= 2.0: tmp = (y / (y - z)) * t else: tmp = (t * x) / (z - y) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - y) / Float64(z - y)) tmp = 0.0 if (t_1 <= -9e-5) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (t_1 <= 2e-5) tmp = Float64(Float64(t * Float64(x - y)) / z); elseif (t_1 <= 2.0) tmp = Float64(Float64(y / Float64(y - z)) * t); else tmp = Float64(Float64(t * x) / Float64(z - y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - y) / (z - y); tmp = 0.0; if (t_1 <= -9e-5) tmp = x * (t / (z - y)); elseif (t_1 <= 2e-5) tmp = (t * (x - y)) / z; elseif (t_1 <= 2.0) tmp = (y / (y - z)) * t; else tmp = (t * x) / (z - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -9e-5], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-5], N[(N[(t * N[(x - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 2.0], N[(N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], N[(N[(t * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x - y) / (z - y)) IN LET tmp_2 = IF (t_1 <= (2)) THEN ((y / (y - z)) * t) ELSE ((t * x) / (z - y)) ENDIF IN LET tmp_1 = IF (t_1 <= (2000000000000000163606107828062619091724627651274204254150390625e-68)) THEN ((t * (x - y)) / z) ELSE tmp_2 ENDIF IN LET tmp = IF (t_1 <= (-90000000000000005668208957754217180990963242948055267333984375e-66)) THEN (x * (t / (z - y))) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x - y}{z - y}\\
\mathbf{if}\;t\_1 \leq -9 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\frac{t \cdot \left(x - y\right)}{z}\\
\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;\frac{y}{y - z} \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot x}{z - y}\\
\end{array}
if (/.f64 (-.f64 x y) (-.f64 z y)) < -9.0000000000000006e-5Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites50.7%
Applied rewrites50.5%
if -9.0000000000000006e-5 < (/.f64 (-.f64 x y) (-.f64 z y)) < 2.0000000000000002e-5Initial program 97.3%
Taylor expanded in z around inf
Applied rewrites47.9%
if 2.0000000000000002e-5 < (/.f64 (-.f64 x y) (-.f64 z y)) < 2Initial program 97.3%
Applied rewrites97.1%
Taylor expanded in x around 0
Applied rewrites53.8%
if 2 < (/.f64 (-.f64 x y) (-.f64 z y)) Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites50.7%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (/ (- x y) (- z y))))
(if (<= t_1 -9e-5)
(* x (/ t (- z y)))
(if (<= t_1 0.2)
(/ (* t (- x y)) z)
(if (<= t_1 2.0) (fma (/ z y) t t) (/ (* t x) (- z y)))))))double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= -9e-5) {
tmp = x * (t / (z - y));
} else if (t_1 <= 0.2) {
tmp = (t * (x - y)) / z;
} else if (t_1 <= 2.0) {
tmp = fma((z / y), t, t);
} else {
tmp = (t * x) / (z - y);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x - y) / Float64(z - y)) tmp = 0.0 if (t_1 <= -9e-5) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (t_1 <= 0.2) tmp = Float64(Float64(t * Float64(x - y)) / z); elseif (t_1 <= 2.0) tmp = fma(Float64(z / y), t, t); else tmp = Float64(Float64(t * x) / Float64(z - y)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -9e-5], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.2], N[(N[(t * N[(x - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 2.0], N[(N[(z / y), $MachinePrecision] * t + t), $MachinePrecision], N[(N[(t * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x - y) / (z - y)) IN LET tmp_2 = IF (t_1 <= (2)) THEN (((z / y) * t) + t) ELSE ((t * x) / (z - y)) ENDIF IN LET tmp_1 = IF (t_1 <= (200000000000000011102230246251565404236316680908203125e-54)) THEN ((t * (x - y)) / z) ELSE tmp_2 ENDIF IN LET tmp = IF (t_1 <= (-90000000000000005668208957754217180990963242948055267333984375e-66)) THEN (x * (t / (z - y))) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x - y}{z - y}\\
\mathbf{if}\;t\_1 \leq -9 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;t\_1 \leq 0.2:\\
\;\;\;\;\frac{t \cdot \left(x - y\right)}{z}\\
\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{y}, t, t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot x}{z - y}\\
\end{array}
if (/.f64 (-.f64 x y) (-.f64 z y)) < -9.0000000000000006e-5Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites50.7%
Applied rewrites50.5%
if -9.0000000000000006e-5 < (/.f64 (-.f64 x y) (-.f64 z y)) < 0.20000000000000001Initial program 97.3%
Taylor expanded in z around inf
Applied rewrites47.9%
if 0.20000000000000001 < (/.f64 (-.f64 x y) (-.f64 z y)) < 2Initial program 97.3%
Applied rewrites47.1%
Taylor expanded in x around 0
Applied rewrites44.2%
Taylor expanded in y around inf
Applied rewrites32.9%
Applied rewrites34.5%
if 2 < (/.f64 (-.f64 x y) (-.f64 z y)) Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites50.7%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (/ (- x y) (- z y))))
(if (<= t_1 0.2)
(* x (/ t (- z y)))
(if (<= t_1 2.0) (fma (/ z y) t t) (/ (* t x) (- z y))))))double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= 0.2) {
tmp = x * (t / (z - y));
} else if (t_1 <= 2.0) {
tmp = fma((z / y), t, t);
} else {
tmp = (t * x) / (z - y);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x - y) / Float64(z - y)) tmp = 0.0 if (t_1 <= 0.2) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (t_1 <= 2.0) tmp = fma(Float64(z / y), t, t); else tmp = Float64(Float64(t * x) / Float64(z - y)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.2], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2.0], N[(N[(z / y), $MachinePrecision] * t + t), $MachinePrecision], N[(N[(t * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x - y) / (z - y)) IN LET tmp_1 = IF (t_1 <= (2)) THEN (((z / y) * t) + t) ELSE ((t * x) / (z - y)) ENDIF IN LET tmp = IF (t_1 <= (200000000000000011102230246251565404236316680908203125e-54)) THEN (x * (t / (z - y))) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x - y}{z - y}\\
\mathbf{if}\;t\_1 \leq 0.2:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{y}, t, t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot x}{z - y}\\
\end{array}
if (/.f64 (-.f64 x y) (-.f64 z y)) < 0.20000000000000001Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites50.7%
Applied rewrites50.5%
if 0.20000000000000001 < (/.f64 (-.f64 x y) (-.f64 z y)) < 2Initial program 97.3%
Applied rewrites47.1%
Taylor expanded in x around 0
Applied rewrites44.2%
Taylor expanded in y around inf
Applied rewrites32.9%
Applied rewrites34.5%
if 2 < (/.f64 (-.f64 x y) (-.f64 z y)) Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites50.7%
(FPCore (x y z t) :precision binary64 :pre TRUE (let* ((t_1 (/ (- x y) (- z y))) (t_2 (* x (/ t (- z y))))) (if (<= t_1 0.2) t_2 (if (<= t_1 2.0) (fma (/ z y) t t) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double t_2 = x * (t / (z - y));
double tmp;
if (t_1 <= 0.2) {
tmp = t_2;
} else if (t_1 <= 2.0) {
tmp = fma((z / y), t, t);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x - y) / Float64(z - y)) t_2 = Float64(x * Float64(t / Float64(z - y))) tmp = 0.0 if (t_1 <= 0.2) tmp = t_2; elseif (t_1 <= 2.0) tmp = fma(Float64(z / y), t, t); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.2], t$95$2, If[LessEqual[t$95$1, 2.0], N[(N[(z / y), $MachinePrecision] * t + t), $MachinePrecision], t$95$2]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x - y) / (z - y)) IN LET t_2 = (x * (t / (z - y))) IN LET tmp_1 = IF (t_1 <= (2)) THEN (((z / y) * t) + t) ELSE t_2 ENDIF IN LET tmp = IF (t_1 <= (200000000000000011102230246251565404236316680908203125e-54)) THEN t_2 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x - y}{z - y}\\
t_2 := x \cdot \frac{t}{z - y}\\
\mathbf{if}\;t\_1 \leq 0.2:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{y}, t, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (-.f64 x y) (-.f64 z y)) < 0.20000000000000001 or 2 < (/.f64 (-.f64 x y) (-.f64 z y)) Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites50.7%
Applied rewrites50.5%
if 0.20000000000000001 < (/.f64 (-.f64 x y) (-.f64 z y)) < 2Initial program 97.3%
Applied rewrites47.1%
Taylor expanded in x around 0
Applied rewrites44.2%
Taylor expanded in y around inf
Applied rewrites32.9%
Applied rewrites34.5%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (/ (- x y) (- z y))))
(if (<= t_1 0.2)
(/ t (/ z x))
(if (<= t_1 5.0) (fma (/ z y) t t) (* (/ x z) t)))))double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= 0.2) {
tmp = t / (z / x);
} else if (t_1 <= 5.0) {
tmp = fma((z / y), t, t);
} else {
tmp = (x / z) * t;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x - y) / Float64(z - y)) tmp = 0.0 if (t_1 <= 0.2) tmp = Float64(t / Float64(z / x)); elseif (t_1 <= 5.0) tmp = fma(Float64(z / y), t, t); else tmp = Float64(Float64(x / z) * t); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.2], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5.0], N[(N[(z / y), $MachinePrecision] * t + t), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * t), $MachinePrecision]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x - y) / (z - y)) IN LET tmp_1 = IF (t_1 <= (5)) THEN (((z / y) * t) + t) ELSE ((x / z) * t) ENDIF IN LET tmp = IF (t_1 <= (200000000000000011102230246251565404236316680908203125e-54)) THEN (t / (z / x)) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x - y}{z - y}\\
\mathbf{if}\;t\_1 \leq 0.2:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{elif}\;t\_1 \leq 5:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{y}, t, t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot t\\
\end{array}
if (/.f64 (-.f64 x y) (-.f64 z y)) < 0.20000000000000001Initial program 97.3%
Applied rewrites83.8%
Applied rewrites97.3%
Taylor expanded in y around 0
Applied rewrites39.9%
if 0.20000000000000001 < (/.f64 (-.f64 x y) (-.f64 z y)) < 5Initial program 97.3%
Applied rewrites47.1%
Taylor expanded in x around 0
Applied rewrites44.2%
Taylor expanded in y around inf
Applied rewrites32.9%
Applied rewrites34.5%
if 5 < (/.f64 (-.f64 x y) (-.f64 z y)) Initial program 97.3%
Taylor expanded in y around 0
Applied rewrites40.0%
(FPCore (x y z t) :precision binary64 :pre TRUE (let* ((t_1 (/ (- x y) (- z y)))) (if (<= t_1 2e-5) (/ t (/ z x)) (if (<= t_1 5.0) t (* (/ x z) t)))))
double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= 2e-5) {
tmp = t / (z / x);
} else if (t_1 <= 5.0) {
tmp = t;
} else {
tmp = (x / z) * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x - y) / (z - y)
if (t_1 <= 2d-5) then
tmp = t / (z / x)
else if (t_1 <= 5.0d0) then
tmp = t
else
tmp = (x / z) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= 2e-5) {
tmp = t / (z / x);
} else if (t_1 <= 5.0) {
tmp = t;
} else {
tmp = (x / z) * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - y) / (z - y) tmp = 0 if t_1 <= 2e-5: tmp = t / (z / x) elif t_1 <= 5.0: tmp = t else: tmp = (x / z) * t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - y) / Float64(z - y)) tmp = 0.0 if (t_1 <= 2e-5) tmp = Float64(t / Float64(z / x)); elseif (t_1 <= 5.0) tmp = t; else tmp = Float64(Float64(x / z) * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - y) / (z - y); tmp = 0.0; if (t_1 <= 2e-5) tmp = t / (z / x); elseif (t_1 <= 5.0) tmp = t; else tmp = (x / z) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-5], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5.0], t, N[(N[(x / z), $MachinePrecision] * t), $MachinePrecision]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x - y) / (z - y)) IN LET tmp_1 = IF (t_1 <= (5)) THEN t ELSE ((x / z) * t) ENDIF IN LET tmp = IF (t_1 <= (2000000000000000163606107828062619091724627651274204254150390625e-68)) THEN (t / (z / x)) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x - y}{z - y}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{elif}\;t\_1 \leq 5:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot t\\
\end{array}
if (/.f64 (-.f64 x y) (-.f64 z y)) < 2.0000000000000002e-5Initial program 97.3%
Applied rewrites83.8%
Applied rewrites97.3%
Taylor expanded in y around 0
Applied rewrites39.9%
if 2.0000000000000002e-5 < (/.f64 (-.f64 x y) (-.f64 z y)) < 5Initial program 97.3%
Taylor expanded in y around inf
Applied rewrites34.2%
if 5 < (/.f64 (-.f64 x y) (-.f64 z y)) Initial program 97.3%
Taylor expanded in y around 0
Applied rewrites40.0%
(FPCore (x y z t) :precision binary64 :pre TRUE (let* ((t_1 (/ (- x y) (- z y))) (t_2 (* (/ x z) t))) (if (<= t_1 2e-5) t_2 (if (<= t_1 5.0) t t_2))))
double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double t_2 = (x / z) * t;
double tmp;
if (t_1 <= 2e-5) {
tmp = t_2;
} else if (t_1 <= 5.0) {
tmp = t;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x - y) / (z - y)
t_2 = (x / z) * t
if (t_1 <= 2d-5) then
tmp = t_2
else if (t_1 <= 5.0d0) then
tmp = t
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double t_2 = (x / z) * t;
double tmp;
if (t_1 <= 2e-5) {
tmp = t_2;
} else if (t_1 <= 5.0) {
tmp = t;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - y) / (z - y) t_2 = (x / z) * t tmp = 0 if t_1 <= 2e-5: tmp = t_2 elif t_1 <= 5.0: tmp = t else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - y) / Float64(z - y)) t_2 = Float64(Float64(x / z) * t) tmp = 0.0 if (t_1 <= 2e-5) tmp = t_2; elseif (t_1 <= 5.0) tmp = t; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - y) / (z - y); t_2 = (x / z) * t; tmp = 0.0; if (t_1 <= 2e-5) tmp = t_2; elseif (t_1 <= 5.0) tmp = t; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-5], t$95$2, If[LessEqual[t$95$1, 5.0], t, t$95$2]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x - y) / (z - y)) IN LET t_2 = ((x / z) * t) IN LET tmp_1 = IF (t_1 <= (5)) THEN t ELSE t_2 ENDIF IN LET tmp = IF (t_1 <= (2000000000000000163606107828062619091724627651274204254150390625e-68)) THEN t_2 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x - y}{z - y}\\
t_2 := \frac{x}{z} \cdot t\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-5}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (-.f64 x y) (-.f64 z y)) < 2.0000000000000002e-5 or 5 < (/.f64 (-.f64 x y) (-.f64 z y)) Initial program 97.3%
Taylor expanded in y around 0
Applied rewrites40.0%
if 2.0000000000000002e-5 < (/.f64 (-.f64 x y) (-.f64 z y)) < 5Initial program 97.3%
Taylor expanded in y around inf
Applied rewrites34.2%
(FPCore (x y z t) :precision binary64 :pre TRUE (let* ((t_1 (/ (- x y) (- z y)))) (if (<= t_1 2e-5) (* x (/ t z)) (if (<= t_1 5.0) t (/ (* t x) z)))))
double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= 2e-5) {
tmp = x * (t / z);
} else if (t_1 <= 5.0) {
tmp = t;
} else {
tmp = (t * x) / z;
}
return tmp;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x - y) / (z - y)
if (t_1 <= 2d-5) then
tmp = x * (t / z)
else if (t_1 <= 5.0d0) then
tmp = t
else
tmp = (t * x) / z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double tmp;
if (t_1 <= 2e-5) {
tmp = x * (t / z);
} else if (t_1 <= 5.0) {
tmp = t;
} else {
tmp = (t * x) / z;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - y) / (z - y) tmp = 0 if t_1 <= 2e-5: tmp = x * (t / z) elif t_1 <= 5.0: tmp = t else: tmp = (t * x) / z return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - y) / Float64(z - y)) tmp = 0.0 if (t_1 <= 2e-5) tmp = Float64(x * Float64(t / z)); elseif (t_1 <= 5.0) tmp = t; else tmp = Float64(Float64(t * x) / z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - y) / (z - y); tmp = 0.0; if (t_1 <= 2e-5) tmp = x * (t / z); elseif (t_1 <= 5.0) tmp = t; else tmp = (t * x) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-5], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5.0], t, N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x - y) / (z - y)) IN LET tmp_1 = IF (t_1 <= (5)) THEN t ELSE ((t * x) / z) ENDIF IN LET tmp = IF (t_1 <= (2000000000000000163606107828062619091724627651274204254150390625e-68)) THEN (x * (t / z)) ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x - y}{z - y}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;t\_1 \leq 5:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot x}{z}\\
\end{array}
if (/.f64 (-.f64 x y) (-.f64 z y)) < 2.0000000000000002e-5Initial program 97.3%
Taylor expanded in y around 0
Applied rewrites38.0%
Applied rewrites37.7%
if 2.0000000000000002e-5 < (/.f64 (-.f64 x y) (-.f64 z y)) < 5Initial program 97.3%
Taylor expanded in y around inf
Applied rewrites34.2%
if 5 < (/.f64 (-.f64 x y) (-.f64 z y)) Initial program 97.3%
Taylor expanded in y around 0
Applied rewrites38.0%
(FPCore (x y z t) :precision binary64 :pre TRUE (let* ((t_1 (/ (- x y) (- z y))) (t_2 (* x (/ t z)))) (if (<= t_1 2e-5) t_2 (if (<= t_1 5e+22) t t_2))))
double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double t_2 = x * (t / z);
double tmp;
if (t_1 <= 2e-5) {
tmp = t_2;
} else if (t_1 <= 5e+22) {
tmp = t;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x - y) / (z - y)
t_2 = x * (t / z)
if (t_1 <= 2d-5) then
tmp = t_2
else if (t_1 <= 5d+22) then
tmp = t
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - y) / (z - y);
double t_2 = x * (t / z);
double tmp;
if (t_1 <= 2e-5) {
tmp = t_2;
} else if (t_1 <= 5e+22) {
tmp = t;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - y) / (z - y) t_2 = x * (t / z) tmp = 0 if t_1 <= 2e-5: tmp = t_2 elif t_1 <= 5e+22: tmp = t else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - y) / Float64(z - y)) t_2 = Float64(x * Float64(t / z)) tmp = 0.0 if (t_1 <= 2e-5) tmp = t_2; elseif (t_1 <= 5e+22) tmp = t; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - y) / (z - y); t_2 = x * (t / z); tmp = 0.0; if (t_1 <= 2e-5) tmp = t_2; elseif (t_1 <= 5e+22) tmp = t; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-5], t$95$2, If[LessEqual[t$95$1, 5e+22], t, t$95$2]]]]
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = LET t_1 = ((x - y) / (z - y)) IN LET t_2 = (x * (t / z)) IN LET tmp_1 = IF (t_1 <= (49999999999999995805696)) THEN t ELSE t_2 ENDIF IN LET tmp = IF (t_1 <= (2000000000000000163606107828062619091724627651274204254150390625e-68)) THEN t_2 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x - y}{z - y}\\
t_2 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-5}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+22}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (-.f64 x y) (-.f64 z y)) < 2.0000000000000002e-5 or 4.9999999999999996e22 < (/.f64 (-.f64 x y) (-.f64 z y)) Initial program 97.3%
Taylor expanded in y around 0
Applied rewrites38.0%
Applied rewrites37.7%
if 2.0000000000000002e-5 < (/.f64 (-.f64 x y) (-.f64 z y)) < 4.9999999999999996e22Initial program 97.3%
Taylor expanded in y around inf
Applied rewrites34.2%
(FPCore (x y z t) :precision binary64 :pre TRUE t)
double code(double x, double y, double z, double t) {
return t;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t
end function
public static double code(double x, double y, double z, double t) {
return t;
}
def code(x, y, z, t): return t
function code(x, y, z, t) return t end
function tmp = code(x, y, z, t) tmp = t; end
code[x_, y_, z_, t_] := t
f(x, y, z, t): x in [-inf, +inf], y in [-inf, +inf], z in [-inf, +inf], t in [-inf, +inf] code: THEORY BEGIN f(x, y, z, t: real): real = t END code
t
Initial program 97.3%
Taylor expanded in y around inf
Applied rewrites34.2%
herbie shell --seed 2026092
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
(* (/ (- x y) (- z y)) t))