
(FPCore (x y z t) :precision binary64 :pre TRUE (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
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) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $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 = x / ((y - z) * (t - z)) END code
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 :pre TRUE (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
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) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((y - z) * (t - z));
}
def code(x, y, z, t): return x / ((y - z) * (t - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(y - z) * Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x / ((y - z) * (t - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $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 = x / ((y - z) * (t - z)) END code
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
(FPCore (x y z t) :precision binary64 :pre TRUE (/ (/ x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - z);
}
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)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x / (y - z)) / (t - z);
}
def code(x, y, z, t): return (x / (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x / Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x / (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $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 = (x / (y - z)) / (t - z) END code
\frac{\frac{x}{y - z}}{t - z}
Initial program 88.9%
Applied rewrites97.0%
(FPCore (x y z t) :precision binary64 :pre TRUE (/ (/ x (- (fmax y t) z)) (- (fmin y t) z)))
double code(double x, double y, double z, double t) {
return (x / (fmax(y, t) - z)) / (fmin(y, t) - z);
}
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 / (fmax(y, t) - z)) / (fmin(y, t) - z)
end function
public static double code(double x, double y, double z, double t) {
return (x / (fmax(y, t) - z)) / (fmin(y, t) - z);
}
def code(x, y, z, t): return (x / (fmax(y, t) - z)) / (fmin(y, t) - z)
function code(x, y, z, t) return Float64(Float64(x / Float64(fmax(y, t) - z)) / Float64(fmin(y, t) - z)) end
function tmp = code(x, y, z, t) tmp = (x / (max(y, t) - z)) / (min(y, t) - z); end
code[x_, y_, z_, t_] := N[(N[(x / N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / N[(N[Min[y, t], $MachinePrecision] - z), $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 tmp = IF (y > t) THEN y ELSE t ENDIF IN LET tmp_1 = IF (y < t) THEN y ELSE t ENDIF IN (x / (tmp - z)) / (tmp_1 - z) END code
\frac{\frac{x}{\mathsf{max}\left(y, t\right) - z}}{\mathsf{min}\left(y, t\right) - z}
Initial program 88.9%
Applied rewrites97.0%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (/ (/ x (- z (fmax y t))) z)))
(if (<= z -3.9302923701976847e+146)
t_1
(if (<= z 2.374453777408555e+51)
(/ x (* (- (fmin y t) z) (- (fmax y t) z)))
t_1))))double code(double x, double y, double z, double t) {
double t_1 = (x / (z - fmax(y, t))) / z;
double tmp;
if (z <= -3.9302923701976847e+146) {
tmp = t_1;
} else if (z <= 2.374453777408555e+51) {
tmp = x / ((fmin(y, t) - z) * (fmax(y, t) - z));
} else {
tmp = t_1;
}
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 / (z - fmax(y, t))) / z
if (z <= (-3.9302923701976847d+146)) then
tmp = t_1
else if (z <= 2.374453777408555d+51) then
tmp = x / ((fmin(y, t) - z) * (fmax(y, t) - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / (z - fmax(y, t))) / z;
double tmp;
if (z <= -3.9302923701976847e+146) {
tmp = t_1;
} else if (z <= 2.374453777408555e+51) {
tmp = x / ((fmin(y, t) - z) * (fmax(y, t) - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / (z - fmax(y, t))) / z tmp = 0 if z <= -3.9302923701976847e+146: tmp = t_1 elif z <= 2.374453777408555e+51: tmp = x / ((fmin(y, t) - z) * (fmax(y, t) - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / Float64(z - fmax(y, t))) / z) tmp = 0.0 if (z <= -3.9302923701976847e+146) tmp = t_1; elseif (z <= 2.374453777408555e+51) tmp = Float64(x / Float64(Float64(fmin(y, t) - z) * Float64(fmax(y, t) - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / (z - max(y, t))) / z; tmp = 0.0; if (z <= -3.9302923701976847e+146) tmp = t_1; elseif (z <= 2.374453777408555e+51) tmp = x / ((min(y, t) - z) * (max(y, t) - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -3.9302923701976847e+146], t$95$1, If[LessEqual[z, 2.374453777408555e+51], N[(x / N[(N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
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 tmp = IF (y > t) THEN y ELSE t ENDIF IN LET t_1 = ((x / (z - tmp)) / z) IN LET tmp_5 = IF (y < t) THEN y ELSE t ENDIF IN LET tmp_6 = IF (y > t) THEN y ELSE t ENDIF IN LET tmp_4 = IF (z <= (2374453777408554942724961889908802081675692130435072)) THEN (x / ((tmp_5 - z) * (tmp_6 - z))) ELSE t_1 ENDIF IN LET tmp_1 = IF (z <= (-393029237019768472749749612585895278290671128232087283321139767428522924840095506821764308339924924092735625843948442452069914357908363464916598784)) THEN t_1 ELSE tmp_4 ENDIF IN tmp_1 END code
\begin{array}{l}
t_1 := \frac{\frac{x}{z - \mathsf{max}\left(y, t\right)}}{z}\\
\mathbf{if}\;z \leq -3.9302923701976847 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.374453777408555 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{\left(\mathsf{min}\left(y, t\right) - z\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -3.9302923701976847e146 or 2.3744537774085549e51 < z Initial program 88.9%
Applied rewrites97.0%
Taylor expanded in y around 0
Applied rewrites59.9%
Applied rewrites59.9%
if -3.9302923701976847e146 < z < 2.3744537774085549e51Initial program 88.9%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(if (<= (fmin y t) -5253760622657619.0)
(/ (/ x (fmin y t)) (- (fmax y t) z))
(if (<= (fmin y t) 4.449894915789624e-160)
(/ (/ x (- z (fmax y t))) z)
(/ x (* (- (fmin y t) z) (fmax y t))))))double code(double x, double y, double z, double t) {
double tmp;
if (fmin(y, t) <= -5253760622657619.0) {
tmp = (x / fmin(y, t)) / (fmax(y, t) - z);
} else if (fmin(y, t) <= 4.449894915789624e-160) {
tmp = (x / (z - fmax(y, t))) / z;
} else {
tmp = x / ((fmin(y, t) - z) * fmax(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) :: tmp
if (fmin(y, t) <= (-5253760622657619.0d0)) then
tmp = (x / fmin(y, t)) / (fmax(y, t) - z)
else if (fmin(y, t) <= 4.449894915789624d-160) then
tmp = (x / (z - fmax(y, t))) / z
else
tmp = x / ((fmin(y, t) - z) * fmax(y, t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (fmin(y, t) <= -5253760622657619.0) {
tmp = (x / fmin(y, t)) / (fmax(y, t) - z);
} else if (fmin(y, t) <= 4.449894915789624e-160) {
tmp = (x / (z - fmax(y, t))) / z;
} else {
tmp = x / ((fmin(y, t) - z) * fmax(y, t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if fmin(y, t) <= -5253760622657619.0: tmp = (x / fmin(y, t)) / (fmax(y, t) - z) elif fmin(y, t) <= 4.449894915789624e-160: tmp = (x / (z - fmax(y, t))) / z else: tmp = x / ((fmin(y, t) - z) * fmax(y, t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (fmin(y, t) <= -5253760622657619.0) tmp = Float64(Float64(x / fmin(y, t)) / Float64(fmax(y, t) - z)); elseif (fmin(y, t) <= 4.449894915789624e-160) tmp = Float64(Float64(x / Float64(z - fmax(y, t))) / z); else tmp = Float64(x / Float64(Float64(fmin(y, t) - z) * fmax(y, t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (min(y, t) <= -5253760622657619.0) tmp = (x / min(y, t)) / (max(y, t) - z); elseif (min(y, t) <= 4.449894915789624e-160) tmp = (x / (z - max(y, t))) / z; else tmp = x / ((min(y, t) - z) * max(y, t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[Min[y, t], $MachinePrecision], -5253760622657619.0], N[(N[(x / N[Min[y, t], $MachinePrecision]), $MachinePrecision] / N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[y, t], $MachinePrecision], 4.449894915789624e-160], N[(N[(x / N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision] * N[Max[y, t], $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 = LET tmp_3 = IF (y < t) THEN y ELSE t ENDIF IN LET tmp_4 = IF (y < t) THEN y ELSE t ENDIF IN LET tmp_5 = IF (y > t) THEN y ELSE t ENDIF IN LET tmp_8 = IF (y < t) THEN y ELSE t ENDIF IN LET tmp_9 = IF (y > t) THEN y ELSE t ENDIF IN LET tmp_10 = IF (y < t) THEN y ELSE t ENDIF IN LET tmp_11 = IF (y > t) THEN y ELSE t ENDIF IN LET tmp_7 = IF (tmp_8 <= (4449894915789623913831566850262283476187929204818645135142934964900178259117378027582790579181082150341245562157903549932732692476848818095553312237589043816921614382394947242702394262709576292094619635131127587917043320181003218016254075150114183574391889930585488448421319577296232667836672553038912906551757316735357729569871150010534428095570380016647027827372526616764463239760141188838815651251934468746185302734375e-580)) THEN ((x / (z - tmp_9)) / z) ELSE (x / ((tmp_10 - z) * tmp_11)) ENDIF IN LET tmp_2 = IF (tmp_3 <= (-5253760622657619)) THEN ((x / tmp_4) / (tmp_5 - z)) ELSE tmp_7 ENDIF IN tmp_2 END code
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(y, t\right) \leq -5253760622657619:\\
\;\;\;\;\frac{\frac{x}{\mathsf{min}\left(y, t\right)}}{\mathsf{max}\left(y, t\right) - z}\\
\mathbf{elif}\;\mathsf{min}\left(y, t\right) \leq 4.449894915789624 \cdot 10^{-160}:\\
\;\;\;\;\frac{\frac{x}{z - \mathsf{max}\left(y, t\right)}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(\mathsf{min}\left(y, t\right) - z\right) \cdot \mathsf{max}\left(y, t\right)}\\
\end{array}
if y < -5253760622657619Initial program 88.9%
Applied rewrites97.0%
Taylor expanded in y around inf
Applied rewrites58.5%
if -5253760622657619 < y < 4.4498949157896239e-160Initial program 88.9%
Applied rewrites97.0%
Taylor expanded in y around 0
Applied rewrites59.9%
Applied rewrites59.9%
if 4.4498949157896239e-160 < y Initial program 88.9%
Taylor expanded in z around 0
Applied rewrites57.4%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(if (<= (fmin y t) -1.7320108458749014e-63)
(/ (/ x (fmin y t)) (- (fmax y t) z))
(if (<= (fmin y t) 7.337371283321506e-227)
(/ x (* z (- z (fmax y t))))
(/ x (* (- (fmin y t) z) (fmax y t))))))double code(double x, double y, double z, double t) {
double tmp;
if (fmin(y, t) <= -1.7320108458749014e-63) {
tmp = (x / fmin(y, t)) / (fmax(y, t) - z);
} else if (fmin(y, t) <= 7.337371283321506e-227) {
tmp = x / (z * (z - fmax(y, t)));
} else {
tmp = x / ((fmin(y, t) - z) * fmax(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) :: tmp
if (fmin(y, t) <= (-1.7320108458749014d-63)) then
tmp = (x / fmin(y, t)) / (fmax(y, t) - z)
else if (fmin(y, t) <= 7.337371283321506d-227) then
tmp = x / (z * (z - fmax(y, t)))
else
tmp = x / ((fmin(y, t) - z) * fmax(y, t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (fmin(y, t) <= -1.7320108458749014e-63) {
tmp = (x / fmin(y, t)) / (fmax(y, t) - z);
} else if (fmin(y, t) <= 7.337371283321506e-227) {
tmp = x / (z * (z - fmax(y, t)));
} else {
tmp = x / ((fmin(y, t) - z) * fmax(y, t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if fmin(y, t) <= -1.7320108458749014e-63: tmp = (x / fmin(y, t)) / (fmax(y, t) - z) elif fmin(y, t) <= 7.337371283321506e-227: tmp = x / (z * (z - fmax(y, t))) else: tmp = x / ((fmin(y, t) - z) * fmax(y, t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (fmin(y, t) <= -1.7320108458749014e-63) tmp = Float64(Float64(x / fmin(y, t)) / Float64(fmax(y, t) - z)); elseif (fmin(y, t) <= 7.337371283321506e-227) tmp = Float64(x / Float64(z * Float64(z - fmax(y, t)))); else tmp = Float64(x / Float64(Float64(fmin(y, t) - z) * fmax(y, t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (min(y, t) <= -1.7320108458749014e-63) tmp = (x / min(y, t)) / (max(y, t) - z); elseif (min(y, t) <= 7.337371283321506e-227) tmp = x / (z * (z - max(y, t))); else tmp = x / ((min(y, t) - z) * max(y, t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[Min[y, t], $MachinePrecision], -1.7320108458749014e-63], N[(N[(x / N[Min[y, t], $MachinePrecision]), $MachinePrecision] / N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[y, t], $MachinePrecision], 7.337371283321506e-227], N[(x / N[(z * N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision] * N[Max[y, t], $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 = LET tmp_3 = IF (y < t) THEN y ELSE t ENDIF IN LET tmp_4 = IF (y < t) THEN y ELSE t ENDIF IN LET tmp_5 = IF (y > t) THEN y ELSE t ENDIF IN LET tmp_8 = IF (y < t) THEN y ELSE t ENDIF IN LET tmp_9 = IF (y > t) THEN y ELSE t ENDIF IN LET tmp_10 = IF (y < t) THEN y ELSE t ENDIF IN LET tmp_11 = IF (y > t) THEN y ELSE t ENDIF IN LET tmp_7 = IF (tmp_8 <= (73373712833215061292565009373237834571999141893366095698072774680515204560827912474110709842400991321700683793368125794964987225504096331194719565134548141977046174739388207060094336804831971658793404110952495989024241303845683286326425176469401196668048528006474817529400001842753723010672501021888800459603640519533214488828957378881565209134450564434543649210745446904544759505238134806130531232908413646644028739292411428132108060435280569514485151628500673303405762358497571614457581227237405424687884394940238596358822510743100922710191458264716857229359447956085205078125e-804)) THEN (x / (z * (z - tmp_9))) ELSE (x / ((tmp_10 - z) * tmp_11)) ENDIF IN LET tmp_2 = IF (tmp_3 <= (-1732010845874901431086603907297239526225307146380434947007428059875732760751335816545166403245113172335231147954021319991333364212907063812091055542255173412512225805670595946139656007289886474609375e-261)) THEN ((x / tmp_4) / (tmp_5 - z)) ELSE tmp_7 ENDIF IN tmp_2 END code
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(y, t\right) \leq -1.7320108458749014 \cdot 10^{-63}:\\
\;\;\;\;\frac{\frac{x}{\mathsf{min}\left(y, t\right)}}{\mathsf{max}\left(y, t\right) - z}\\
\mathbf{elif}\;\mathsf{min}\left(y, t\right) \leq 7.337371283321506 \cdot 10^{-227}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - \mathsf{max}\left(y, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(\mathsf{min}\left(y, t\right) - z\right) \cdot \mathsf{max}\left(y, t\right)}\\
\end{array}
if y < -1.7320108458749014e-63Initial program 88.9%
Applied rewrites97.0%
Taylor expanded in y around inf
Applied rewrites58.5%
if -1.7320108458749014e-63 < y < 7.3373712833215061e-227Initial program 88.9%
Applied rewrites97.0%
Taylor expanded in y around 0
Applied rewrites52.7%
if 7.3373712833215061e-227 < y Initial program 88.9%
Taylor expanded in z around 0
Applied rewrites57.4%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(if (<= (fmin y t) -1.7320108458749014e-63)
(/ x (* (fmin y t) (- (fmax y t) z)))
(if (<= (fmin y t) 7.337371283321506e-227)
(/ x (* z (- z (fmax y t))))
(/ x (* (- (fmin y t) z) (fmax y t))))))double code(double x, double y, double z, double t) {
double tmp;
if (fmin(y, t) <= -1.7320108458749014e-63) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= 7.337371283321506e-227) {
tmp = x / (z * (z - fmax(y, t)));
} else {
tmp = x / ((fmin(y, t) - z) * fmax(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) :: tmp
if (fmin(y, t) <= (-1.7320108458749014d-63)) then
tmp = x / (fmin(y, t) * (fmax(y, t) - z))
else if (fmin(y, t) <= 7.337371283321506d-227) then
tmp = x / (z * (z - fmax(y, t)))
else
tmp = x / ((fmin(y, t) - z) * fmax(y, t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (fmin(y, t) <= -1.7320108458749014e-63) {
tmp = x / (fmin(y, t) * (fmax(y, t) - z));
} else if (fmin(y, t) <= 7.337371283321506e-227) {
tmp = x / (z * (z - fmax(y, t)));
} else {
tmp = x / ((fmin(y, t) - z) * fmax(y, t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if fmin(y, t) <= -1.7320108458749014e-63: tmp = x / (fmin(y, t) * (fmax(y, t) - z)) elif fmin(y, t) <= 7.337371283321506e-227: tmp = x / (z * (z - fmax(y, t))) else: tmp = x / ((fmin(y, t) - z) * fmax(y, t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (fmin(y, t) <= -1.7320108458749014e-63) tmp = Float64(x / Float64(fmin(y, t) * Float64(fmax(y, t) - z))); elseif (fmin(y, t) <= 7.337371283321506e-227) tmp = Float64(x / Float64(z * Float64(z - fmax(y, t)))); else tmp = Float64(x / Float64(Float64(fmin(y, t) - z) * fmax(y, t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (min(y, t) <= -1.7320108458749014e-63) tmp = x / (min(y, t) * (max(y, t) - z)); elseif (min(y, t) <= 7.337371283321506e-227) tmp = x / (z * (z - max(y, t))); else tmp = x / ((min(y, t) - z) * max(y, t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[Min[y, t], $MachinePrecision], -1.7320108458749014e-63], N[(x / N[(N[Min[y, t], $MachinePrecision] * N[(N[Max[y, t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[y, t], $MachinePrecision], 7.337371283321506e-227], N[(x / N[(z * N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(N[Min[y, t], $MachinePrecision] - z), $MachinePrecision] * N[Max[y, t], $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 = LET tmp_3 = IF (y < t) THEN y ELSE t ENDIF IN LET tmp_4 = IF (y < t) THEN y ELSE t ENDIF IN LET tmp_5 = IF (y > t) THEN y ELSE t ENDIF IN LET tmp_8 = IF (y < t) THEN y ELSE t ENDIF IN LET tmp_9 = IF (y > t) THEN y ELSE t ENDIF IN LET tmp_10 = IF (y < t) THEN y ELSE t ENDIF IN LET tmp_11 = IF (y > t) THEN y ELSE t ENDIF IN LET tmp_7 = IF (tmp_8 <= (73373712833215061292565009373237834571999141893366095698072774680515204560827912474110709842400991321700683793368125794964987225504096331194719565134548141977046174739388207060094336804831971658793404110952495989024241303845683286326425176469401196668048528006474817529400001842753723010672501021888800459603640519533214488828957378881565209134450564434543649210745446904544759505238134806130531232908413646644028739292411428132108060435280569514485151628500673303405762358497571614457581227237405424687884394940238596358822510743100922710191458264716857229359447956085205078125e-804)) THEN (x / (z * (z - tmp_9))) ELSE (x / ((tmp_10 - z) * tmp_11)) ENDIF IN LET tmp_2 = IF (tmp_3 <= (-1732010845874901431086603907297239526225307146380434947007428059875732760751335816545166403245113172335231147954021319991333364212907063812091055542255173412512225805670595946139656007289886474609375e-261)) THEN (x / (tmp_4 * (tmp_5 - z))) ELSE tmp_7 ENDIF IN tmp_2 END code
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(y, t\right) \leq -1.7320108458749014 \cdot 10^{-63}:\\
\;\;\;\;\frac{x}{\mathsf{min}\left(y, t\right) \cdot \left(\mathsf{max}\left(y, t\right) - z\right)}\\
\mathbf{elif}\;\mathsf{min}\left(y, t\right) \leq 7.337371283321506 \cdot 10^{-227}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - \mathsf{max}\left(y, t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(\mathsf{min}\left(y, t\right) - z\right) \cdot \mathsf{max}\left(y, t\right)}\\
\end{array}
if y < -1.7320108458749014e-63Initial program 88.9%
Taylor expanded in y around inf
Applied rewrites56.8%
if -1.7320108458749014e-63 < y < 7.3373712833215061e-227Initial program 88.9%
Applied rewrites97.0%
Taylor expanded in y around 0
Applied rewrites52.7%
if 7.3373712833215061e-227 < y Initial program 88.9%
Taylor expanded in z around 0
Applied rewrites57.4%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (/ x (* y (- t z)))))
(if (<= y -1.7320108458749014e-63)
t_1
(if (<= y 7.06778189178903e-78) (/ x (* z (- z t))) t_1))))double code(double x, double y, double z, double t) {
double t_1 = x / (y * (t - z));
double tmp;
if (y <= -1.7320108458749014e-63) {
tmp = t_1;
} else if (y <= 7.06778189178903e-78) {
tmp = x / (z * (z - t));
} else {
tmp = t_1;
}
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 * (t - z))
if (y <= (-1.7320108458749014d-63)) then
tmp = t_1
else if (y <= 7.06778189178903d-78) then
tmp = x / (z * (z - t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (y * (t - z));
double tmp;
if (y <= -1.7320108458749014e-63) {
tmp = t_1;
} else if (y <= 7.06778189178903e-78) {
tmp = x / (z * (z - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (y * (t - z)) tmp = 0 if y <= -1.7320108458749014e-63: tmp = t_1 elif y <= 7.06778189178903e-78: tmp = x / (z * (z - t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(y * Float64(t - z))) tmp = 0.0 if (y <= -1.7320108458749014e-63) tmp = t_1; elseif (y <= 7.06778189178903e-78) tmp = Float64(x / Float64(z * Float64(z - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (y * (t - z)); tmp = 0.0; if (y <= -1.7320108458749014e-63) tmp = t_1; elseif (y <= 7.06778189178903e-78) tmp = x / (z * (z - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.7320108458749014e-63], t$95$1, If[LessEqual[y, 7.06778189178903e-78], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
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 * (t - z))) IN LET tmp_1 = IF (y <= (706778189178903007512052708929084011067276864109926505557010173106811663577853612848515957122079736704100203374596887953468419467134204832314552946460674578180815863114317421974535719968245166267006851512633147649466991424560546875e-308)) THEN (x / (z * (z - t))) ELSE t_1 ENDIF IN LET tmp = IF (y <= (-1732010845874901431086603907297239526225307146380434947007428059875732760751335816545166403245113172335231147954021319991333364212907063812091055542255173412512225805670595946139656007289886474609375e-261)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x}{y \cdot \left(t - z\right)}\\
\mathbf{if}\;y \leq -1.7320108458749014 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.06778189178903 \cdot 10^{-78}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.7320108458749014e-63 or 7.0677818917890301e-78 < y Initial program 88.9%
Taylor expanded in y around inf
Applied rewrites56.8%
if -1.7320108458749014e-63 < y < 7.0677818917890301e-78Initial program 88.9%
Applied rewrites97.0%
Taylor expanded in y around 0
Applied rewrites52.7%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (/ x (* z (- z (fmax y t))))))
(if (<= z -514813737448.82904)
t_1
(if (<= z 2.946255668158648e-53)
(/ (/ x (fmin y t)) (fmax y t))
t_1))))double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - fmax(y, t)));
double tmp;
if (z <= -514813737448.82904) {
tmp = t_1;
} else if (z <= 2.946255668158648e-53) {
tmp = (x / fmin(y, t)) / fmax(y, t);
} else {
tmp = t_1;
}
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 / (z * (z - fmax(y, t)))
if (z <= (-514813737448.82904d0)) then
tmp = t_1
else if (z <= 2.946255668158648d-53) then
tmp = (x / fmin(y, t)) / fmax(y, t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z * (z - fmax(y, t)));
double tmp;
if (z <= -514813737448.82904) {
tmp = t_1;
} else if (z <= 2.946255668158648e-53) {
tmp = (x / fmin(y, t)) / fmax(y, t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * (z - fmax(y, t))) tmp = 0 if z <= -514813737448.82904: tmp = t_1 elif z <= 2.946255668158648e-53: tmp = (x / fmin(y, t)) / fmax(y, t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * Float64(z - fmax(y, t)))) tmp = 0.0 if (z <= -514813737448.82904) tmp = t_1; elseif (z <= 2.946255668158648e-53) tmp = Float64(Float64(x / fmin(y, t)) / fmax(y, t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z * (z - max(y, t))); tmp = 0.0; if (z <= -514813737448.82904) tmp = t_1; elseif (z <= 2.946255668158648e-53) tmp = (x / min(y, t)) / max(y, t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * N[(z - N[Max[y, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -514813737448.82904], t$95$1, If[LessEqual[z, 2.946255668158648e-53], N[(N[(x / N[Min[y, t], $MachinePrecision]), $MachinePrecision] / N[Max[y, t], $MachinePrecision]), $MachinePrecision], t$95$1]]]
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 tmp = IF (y > t) THEN y ELSE t ENDIF IN LET t_1 = (x / (z * (z - tmp))) IN LET tmp_5 = IF (y < t) THEN y ELSE t ENDIF IN LET tmp_6 = IF (y > t) THEN y ELSE t ENDIF IN LET tmp_4 = IF (z <= (294625566815864805475848502786037652921335831608451668075107686129328063297012558875639118832237652949908052023963065263153490846840566741438038889100425876677036285400390625e-226)) THEN ((x / tmp_5) / tmp_6) ELSE t_1 ENDIF IN LET tmp_1 = IF (z <= (-51481373744882904052734375e-14)) THEN t_1 ELSE tmp_4 ENDIF IN tmp_1 END code
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(z - \mathsf{max}\left(y, t\right)\right)}\\
\mathbf{if}\;z \leq -514813737448.82904:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.946255668158648 \cdot 10^{-53}:\\
\;\;\;\;\frac{\frac{x}{\mathsf{min}\left(y, t\right)}}{\mathsf{max}\left(y, t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -514813737448.82904 or 2.9462556681586481e-53 < z Initial program 88.9%
Applied rewrites97.0%
Taylor expanded in y around 0
Applied rewrites52.7%
if -514813737448.82904 < z < 2.9462556681586481e-53Initial program 88.9%
Applied rewrites97.0%
Taylor expanded in y around inf
Applied rewrites58.5%
Taylor expanded in z around 0
Applied rewrites43.3%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (/ x (* z z))))
(if (<= z -514813737448.82904)
t_1
(if (<= z 1.0402751454864074e+27)
(/ (/ x (fmin y t)) (fmax y t))
t_1))))double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -514813737448.82904) {
tmp = t_1;
} else if (z <= 1.0402751454864074e+27) {
tmp = (x / fmin(y, t)) / fmax(y, t);
} else {
tmp = t_1;
}
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 / (z * z)
if (z <= (-514813737448.82904d0)) then
tmp = t_1
else if (z <= 1.0402751454864074d+27) then
tmp = (x / fmin(y, t)) / fmax(y, t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -514813737448.82904) {
tmp = t_1;
} else if (z <= 1.0402751454864074e+27) {
tmp = (x / fmin(y, t)) / fmax(y, t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * z) tmp = 0 if z <= -514813737448.82904: tmp = t_1 elif z <= 1.0402751454864074e+27: tmp = (x / fmin(y, t)) / fmax(y, t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * z)) tmp = 0.0 if (z <= -514813737448.82904) tmp = t_1; elseif (z <= 1.0402751454864074e+27) tmp = Float64(Float64(x / fmin(y, t)) / fmax(y, t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z * z); tmp = 0.0; if (z <= -514813737448.82904) tmp = t_1; elseif (z <= 1.0402751454864074e+27) tmp = (x / min(y, t)) / max(y, t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -514813737448.82904], t$95$1, If[LessEqual[z, 1.0402751454864074e+27], N[(N[(x / N[Min[y, t], $MachinePrecision]), $MachinePrecision] / N[Max[y, t], $MachinePrecision]), $MachinePrecision], t$95$1]]]
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 / (z * z)) IN LET tmp_4 = IF (y < t) THEN y ELSE t ENDIF IN LET tmp_5 = IF (y > t) THEN y ELSE t ENDIF IN LET tmp_3 = IF (z <= (1040275145486407391231606784)) THEN ((x / tmp_4) / tmp_5) ELSE t_1 ENDIF IN LET tmp = IF (z <= (-51481373744882904052734375e-14)) THEN t_1 ELSE tmp_3 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x}{z \cdot z}\\
\mathbf{if}\;z \leq -514813737448.82904:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.0402751454864074 \cdot 10^{+27}:\\
\;\;\;\;\frac{\frac{x}{\mathsf{min}\left(y, t\right)}}{\mathsf{max}\left(y, t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -514813737448.82904 or 1.0402751454864074e27 < z Initial program 88.9%
Taylor expanded in t around 0
Applied rewrites52.4%
Applied rewrites52.4%
Taylor expanded in y around 0
Applied rewrites40.0%
if -514813737448.82904 < z < 1.0402751454864074e27Initial program 88.9%
Applied rewrites97.0%
Taylor expanded in y around inf
Applied rewrites58.5%
Taylor expanded in z around 0
Applied rewrites43.3%
(FPCore (x y z t)
:precision binary64
:pre TRUE
(let* ((t_1 (/ x (* z z))))
(if (<= z -514813737448.82904)
t_1
(if (<= z 4.2071591210536425e+26) (/ x (* t y)) t_1))))double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -514813737448.82904) {
tmp = t_1;
} else if (z <= 4.2071591210536425e+26) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
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 / (z * z)
if (z <= (-514813737448.82904d0)) then
tmp = t_1
else if (z <= 4.2071591210536425d+26) then
tmp = x / (t * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (z * z);
double tmp;
if (z <= -514813737448.82904) {
tmp = t_1;
} else if (z <= 4.2071591210536425e+26) {
tmp = x / (t * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (z * z) tmp = 0 if z <= -514813737448.82904: tmp = t_1 elif z <= 4.2071591210536425e+26: tmp = x / (t * y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(z * z)) tmp = 0.0 if (z <= -514813737448.82904) tmp = t_1; elseif (z <= 4.2071591210536425e+26) tmp = Float64(x / Float64(t * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (z * z); tmp = 0.0; if (z <= -514813737448.82904) tmp = t_1; elseif (z <= 4.2071591210536425e+26) tmp = x / (t * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -514813737448.82904], t$95$1, If[LessEqual[z, 4.2071591210536425e+26], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
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 / (z * z)) IN LET tmp_1 = IF (z <= (420715912105364252576972800)) THEN (x / (t * y)) ELSE t_1 ENDIF IN LET tmp = IF (z <= (-51481373744882904052734375e-14)) THEN t_1 ELSE tmp_1 ENDIF IN tmp END code
\begin{array}{l}
t_1 := \frac{x}{z \cdot z}\\
\mathbf{if}\;z \leq -514813737448.82904:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.2071591210536425 \cdot 10^{+26}:\\
\;\;\;\;\frac{x}{t \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -514813737448.82904 or 4.2071591210536425e26 < z Initial program 88.9%
Taylor expanded in t around 0
Applied rewrites52.4%
Applied rewrites52.4%
Taylor expanded in y around 0
Applied rewrites40.0%
if -514813737448.82904 < z < 4.2071591210536425e26Initial program 88.9%
Taylor expanded in z around 0
Applied rewrites39.7%
(FPCore (x y z t) :precision binary64 :pre TRUE (/ x (* t y)))
double code(double x, double y, double z, double t) {
return x / (t * y);
}
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 / (t * y)
end function
public static double code(double x, double y, double z, double t) {
return x / (t * y);
}
def code(x, y, z, t): return x / (t * y)
function code(x, y, z, t) return Float64(x / Float64(t * y)) end
function tmp = code(x, y, z, t) tmp = x / (t * y); end
code[x_, y_, z_, t_] := N[(x / N[(t * 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 = x / (t * y) END code
\frac{x}{t \cdot y}
Initial program 88.9%
Taylor expanded in z around 0
Applied rewrites39.7%
herbie shell --seed 2026092
(FPCore (x y z t)
:name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
:precision binary64
(/ x (* (- y z) (- t z))))